VideoPlayerBaseBehaviour Class¶
Description¶
VideoPlayerBaseBehaviour is the component to control VideoPlayer in the AR scene.
A VideoPlayerBaseBehaviour can be added to any object and the Video will be displayed on top of the object.
It should be child or grandchild to an ImageTargetBaseBehaviour to use the auto scale.
To play a transparent video, you need to set the object material to display alpha channel. EasyAR provides a sample material TransparentVideo.mat .
Public Types¶
Public Fields¶
Public Properties¶
Public Functions¶
Public Events¶
Overwritten MonoBahaviour Functions¶
enum ScaleMode¶
Constant |
Value |
Description |
---|---|---|
None |
0 |
Do not scale. |
Fill |
1 |
Fill the ImageTarget, video will be scaled to the same size of Imagetarget. |
Fit |
2 |
Fit the ImageTarget, video will be scaled to max that can fit into the Imagetarget. |
FitWidth |
3 |
Fit the ImageTarget width, video width will be set to the same value of Imagetarget width and the video ratio will be kept unchanged. |
FitHeight |
4 |
Fit the ImageTarget height, video height will be set to the same value of Imagetarget height and the video ratio will be kept unchanged. |
enum ScalePlane¶
Constant |
Value |
Description |
---|---|---|
XY |
1 |
Scale on XY plane. |
XZ |
2 |
Scale on XZ plane. |
YX |
4 |
Scale on YX plane. |
YZ |
6 |
Scale on YZ plane. |
ZX |
8 |
Scale on ZX plane. |
ZY |
9 |
Scale on ZY plane. |
bool EnableAutoPlay¶
Enables auto play. If enabled, when video finished open and ready, it will automatically start to play.
bool EnableLoop¶
Enables loop play. If enabled, when video reach end, it will play again from the start.
bool OpenWhenStart¶
Open Video when MonoBehaviour.Start
bool DisplayTextMessage¶
Display unsupport message on platforms that are not supported.
string Path¶
Video path. The set operation should be called before Open. See StorageType for more details.
StorageType Storage¶
Video storage type. The set operation should be called before Open. See StorageType for more details.
VideoPlayer.VideoType Type¶
Video type. The set operation should be called before Open.
VideoPlayer VideoPlayer¶
The VideoPlayer object. You can reach advanced controls with VideoPlayer. See VideoPlayer for more details.
float VideoScaleFactorBase¶
The base factor for video scale. It will be multiplied to the scaled size when scale. Normally you can set 0.1 for plane and 1 for other simple objects.
ScaleMode VideoScaleMode¶
The scale mode.
ScalePlane VideoScalePlane¶
The plane used for scale. Object size will be adjusted according to the scale mode and ImageTarget size in the plane direction.
float Volume¶
Current volume. Use after a successful Open.
void Open()¶
Opens the video. Reference VideoPlayer.Open for more deatils.
void Close()¶
Closes the video.
bool Play()¶
Starts or continues to play video.
bool Pause()¶
Pauses the video playback.
bool Stop()¶
Stops the video playback.
bool Seek(int position)¶
Seek to play to position . Use after a successful Open.
int CurPosition()¶
Returns the current position of video. Use after a successful Open.
int Duration()¶
Returns the video duration. Use after a successful Open.
int Width()¶
Returns the video size. Use after a successful Open.
int Height()¶
Returns the video height. Use after a successful Open.
event EventHandler VideoErrorEvent¶
Event for video open error and play error.
event EventHandler VideoReachEndEvent¶
Event when video reaches end.
event EventHandler VideoReadyEvent¶
Event when video finished open and ready for play. You can start to play when this event triggers.