docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class VideoPlayerElement

    A VisualElement that is a VideoPlayer with a roll up play bar with play, speed and audio controls

    Inheritance
    object
    CallbackEventHandler
    Focusable
    VisualElement
    VideoPlayerElement
    Implements
    IEventHandler
    ITransform
    ITransitionAnimations
    IExperimentalFeatures
    IVisualElementScheduler
    IResolvedStyle
    Inherited Members
    VisualElement.disabledUssClassName
    VisualElement.ExecuteDefaultAction(EventBase)
    VisualElement.Focus()
    VisualElement.SendEvent(EventBase)
    VisualElement.SetEnabledFromHierarchy(bool)
    VisualElement.SetEnabled(bool)
    VisualElement.MarkDirtyRepaint()
    VisualElement.ContainsPoint(Vector2)
    VisualElement.Overlaps(Rect)
    VisualElement.DoMeasure(float, VisualElement.MeasureMode, float, VisualElement.MeasureMode)
    VisualElement.ToString()
    VisualElement.GetClasses()
    VisualElement.ClearClassList()
    VisualElement.AddToClassList(string)
    VisualElement.RemoveFromClassList(string)
    VisualElement.ToggleInClassList(string)
    VisualElement.EnableInClassList(string, bool)
    VisualElement.ClassListContains(string)
    VisualElement.FindAncestorUserData()
    VisualElement.Add(VisualElement)
    VisualElement.Insert(int, VisualElement)
    VisualElement.Remove(VisualElement)
    VisualElement.RemoveAt(int)
    VisualElement.Clear()
    VisualElement.ElementAt(int)
    VisualElement.IndexOf(VisualElement)
    VisualElement.Children()
    VisualElement.Sort(Comparison<VisualElement>)
    VisualElement.BringToFront()
    VisualElement.SendToBack()
    VisualElement.PlaceBehind(VisualElement)
    VisualElement.PlaceInFront(VisualElement)
    VisualElement.RemoveFromHierarchy()
    VisualElement.GetFirstOfType<T>()
    VisualElement.GetFirstAncestorOfType<T>()
    VisualElement.Contains(VisualElement)
    VisualElement.FindCommonAncestor(VisualElement)
    VisualElement.viewDataKey
    VisualElement.userData
    VisualElement.canGrabFocus
    VisualElement.focusController
    VisualElement.usageHints
    VisualElement.transform
    VisualElement.layout
    VisualElement.contentRect
    VisualElement.paddingRect
    VisualElement.worldBound
    VisualElement.localBound
    VisualElement.worldTransform
    VisualElement.pickingMode
    VisualElement.name
    VisualElement.enabledInHierarchy
    VisualElement.enabledSelf
    VisualElement.visible
    VisualElement.generateVisualContent
    VisualElement.experimental
    VisualElement.hierarchy
    VisualElement.cacheAsBitmap
    VisualElement.parent
    VisualElement.panel
    VisualElement.contentContainer
    VisualElement.visualTreeAssetSource
    VisualElement.this[int]
    VisualElement.childCount
    VisualElement.schedule
    VisualElement.style
    VisualElement.customStyle
    VisualElement.styleSheets
    VisualElement.tooltip
    VisualElement.resolvedStyle
    Focusable.Blur()
    Focusable.focusable
    Focusable.tabIndex
    Focusable.delegatesFocus
    CallbackEventHandler.RegisterCallback<TEventType>(EventCallback<TEventType>, TrickleDown)
    CallbackEventHandler.RegisterCallback<TEventType, TUserArgsType>(EventCallback<TEventType, TUserArgsType>, TUserArgsType, TrickleDown)
    CallbackEventHandler.UnregisterCallback<TEventType>(EventCallback<TEventType>, TrickleDown)
    CallbackEventHandler.UnregisterCallback<TEventType, TUserArgsType>(EventCallback<TEventType, TUserArgsType>, TrickleDown)
    CallbackEventHandler.HandleEvent(EventBase)
    CallbackEventHandler.HasTrickleDownHandlers()
    CallbackEventHandler.HasBubbleUpHandlers()
    CallbackEventHandler.ExecuteDefaultActionAtTarget(EventBase)
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    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
    VideoClip 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

    Implements

    IEventHandler
    ITransform
    ITransitionAnimations
    IExperimentalFeatures
    IVisualElementScheduler
    IResolvedStyle
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)