Class VideoPlayerElement
A VisualElement that is a VideoPlayer with a roll up play bar with play, speed and audio controls
Implements
Inherited Members
Namespace: Global Namespace
Assembly: Unity.Tutorials.Core.Editor.dll
Syntax
public class VideoPlayerElement : VisualElement, IEventHandler, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IResolvedStyle
Constructors
VideoPlayerElement()
Build a new VideoPlayer
Declaration
public VideoPlayerElement()
Methods
GetPlayPercent()
Return the percentage of the current clip/url the player is currently at
Declaration
public float GetPlayPercent()
Returns
Type | Description |
---|---|
float | The percent from 0 to 1 at which the player is at |
IsLooping()
Is the player set to loop?
Declaration
public bool IsLooping()
Returns
Type | Description |
---|---|
bool | True if looping, False otherwise |
SetLooping(bool)
Change the looping settings of the player
Declaration
public void SetLooping(bool looping)
Parameters
Type | Name | Description |
---|---|---|
bool | looping | If true the player loop once it reach the end of the video |
SetPlayPercent(float)
Set the percentage of the current clip/url the player is currently at
Declaration
public void SetPlayPercent(float percent)
Parameters
Type | Name | Description |
---|---|---|
float | percent | The percent of the current video from 0 to 1 to which to set the player |
SetVideoClip(VideoClip, bool)
Set the player used clip. Will set url to null if one was set.
Declaration
public void SetVideoClip(VideoClip clip, bool autoplay)
Parameters
Type | Name | Description |
---|---|---|
Video |
clip | The VideoClip to use |
bool | autoplay | If true, the video will immediately start to play the clip |
SetVideoUrl(string, bool)
Set the URL used by the player. If a clip was set, it will be set to null.
Declaration
public void SetVideoUrl(string url, bool autoplay)
Parameters
Type | Name | Description |
---|---|---|
string | url | The Url to be used by the player |
bool | autoplay | If true, the player will play immediately |