Search Results for

    Show / Hide Table of Contents

    Class VideoPlayer

    Video playback utility. Video content can be presented in UI (via VideoBrush), used in materials (via texture parameter bind) or used manually in shaders.

    Inheritance
    System.Object
    Object
    SceneObject
    Actor
    VideoPlayer
    Implements
    ISerializable
    Inherited Members
    Actor.SetLayerRecursive(Int32)
    Actor.SetLayerNameRecursive(String)
    Actor.HasTag()
    Actor.HasTag(Tag)
    Actor.HasTag(String)
    Actor.AddTag(Tag)
    Actor.AddTagRecursive(Tag)
    Actor.RemoveTag(Tag)
    Actor.SetParent(Actor, Boolean, Boolean)
    Actor.GetChild(Int32)
    Actor.GetChild(String)
    Actor.GetChild(Type)
    Actor.GetChildren(Type)
    Actor.DestroyChildren(Single)
    Actor.GetScript(Int32)
    Actor.GetScript(Type)
    Actor.GetScripts(Type)
    Actor.AddMovement(Vector3)
    Actor.AddMovement(Vector3, Quaternion)
    Actor.GetWorldToLocalMatrix(Matrix)
    Actor.GetLocalToWorldMatrix(Matrix)
    Actor.OnDebugDraw()
    Actor.OnDebugDrawSelected()
    Actor.GetPrefabRoot()
    Actor.FindActor(String)
    Actor.FindActor(Type, Boolean)
    Actor.FindActor(Type, String)
    Actor.FindActor(Type, Tag, Boolean)
    Actor.FindScript(Type)
    Actor.HasActorInHierarchy(Actor)
    Actor.HasActorInChildren(Actor)
    Actor.IntersectsItself(Ray, Single, Vector3)
    Actor.Intersects(Ray, Single, Vector3)
    Actor.LookAt(Vector3)
    Actor.LookAt(Vector3, Vector3)
    Actor.LookingAt(Vector3)
    Actor.LookingAt(Vector3, Vector3)
    Actor.ToBytes(Actor[])
    Actor.FromBytes(Byte[])
    Actor.FromBytes(Byte[], Dictionary<Guid, Guid>)
    Actor.TryGetSerializedObjectsIds(Byte[])
    Actor.ToJson()
    Actor.FromJson(String)
    Actor.Clone()
    Actor.OnEnable()
    Actor.OnDisable()
    Actor.OnParentChanged()
    Actor.OnTransformChanged()
    Actor.OnActiveChanged()
    Actor.OnActiveInTreeChanged()
    Actor.OnOrderInParentChanged()
    Actor.OnStaticFlagsChanged()
    Actor.OnLayerChanged()
    Actor.OnBeginPlay()
    Actor.OnEndPlay()
    Actor.AddStaticFlags(StaticFlags)
    Actor.RemoveStaticFlags(StaticFlags)
    Actor.SetStaticFlag(StaticFlags, Boolean)
    Actor.HasStaticFlag(StaticFlags)
    Actor.ResetLocalTransform()
    Actor.AddChild(Type)
    Actor.AddChild<T>()
    Actor.GetChild<T>()
    Actor.TryGetChild<T>(T)
    Actor.GetOrAddChild<T>()
    Actor.AddScript(Type)
    Actor.AddScript<T>()
    Actor.GetScript<T>()
    Actor.TryGetScript<T>(T)
    Actor.FindScript<T>()
    Actor.FindActor<T>(Boolean)
    Actor.FindActor<T>(String)
    Actor.FindActor<T>(Tag, Boolean)
    Actor.GetChildren<T>()
    Actor.GetScripts<T>()
    Actor.RotateAround(Vector3, Vector3, Single, Boolean)
    Actor.ToString()
    Actor.Children
    Actor.Tags
    Actor.Layer
    Actor.Name
    Actor.IsActive
    Actor.StaticFlags
    Actor.PerInstanceRandom
    Actor.LocalPosition
    Actor.LocalOrientation
    Actor.LocalScale
    Actor.Sphere
    Actor.Box
    Actor.BoxWithChildren
    Actor.EditorBox
    Actor.EditorBoxChildren
    Actor.HasContentLoaded
    Actor.IsPrefabRoot
    Actor.IsStatic
    Actor.IsTransformStatic
    Actor.WorldToLocalMatrix
    Actor.LocalToWorldMatrix
    SceneObject.SetParent(Actor, Boolean)
    SceneObject.LinkPrefab(Guid, Guid)
    SceneObject.BreakPrefabLink()
    SceneObject.GetNamePath(Char)
    SceneObject.IsDuringPlay
    SceneObject.HasParent
    SceneObject.HasPrefabLink
    SceneObject.PrefabID
    SceneObject.PrefabObjectID
    Object.__unmanagedPtr
    Object.__internalId
    Object.Finalize()
    Object.As<T>()
    Object.NewValue(Type)
    Object.New(String)
    Object.Find<T>(Guid, Boolean)
    Object.Find(Guid, Type, Boolean)
    Object.TryFind<T>(Guid)
    Object.TryFind(Guid, Type)
    Object.Destroy(Object, Single)
    Object.DestroyNow(Object)
    Object.Destroy<T>(T, Single)
    Object.Equals(Object)
    Object.GetUnmanagedPtr(Object)
    Object.GetUnmanagedInterface(Object, Type)
    Object.FromUnmanagedPtr(IntPtr)
    Object.MapObjectID(Guid)
    Object.RemapObjectID(Guid)
    Object.GetHashCode()
    Object.ID
    Object.TypeName
    Namespace: FlaxEngine
    Assembly: FlaxEngine.CSharp.dll
    Syntax
    [ActorContextMenu("New/Visuals/Video Player")]
    [ActorToolbox("Visuals")]
    [Unmanaged]
    public class VideoPlayer : Actor, ISerializable

    Constructors

    VideoPlayer()

    Initializes a new instance of the VideoPlayer.

    Declaration
    public VideoPlayer()

    Properties

    AudioAttenuation

    Gets or sets the attenuation that controls how quickly does audio volume drop off as the listener moves further from the video player. Used by spatial audio only.

    Declaration
    [EditorOrder(130)]
    [Limit(0F, 3.40282347E+38F, 0.1F)]
    [EditorDisplay("Video Player", null)]
    [VisibleIf("IsAudioSpatial", false)]
    [Unmanaged]
    public float AudioAttenuation { get; set; }
    Property Value
    System.Single

    AudioMinDistance

    Gets or sets the minimum distance at which audio attenuation starts. When the listener is closer to the video player than this value, audio is heard at full volume. Once farther away the audio starts attenuating. Used by spatial audio only.

    Declaration
    [EditorOrder(120)]
    [Limit(0F, 3.40282347E+38F, 0.1F)]
    [EditorDisplay("Video Player", null)]
    [VisibleIf("IsAudioSpatial", false)]
    [Unmanaged]
    public float AudioMinDistance { get; set; }
    Property Value
    System.Single

    AudioPan

    Gets or sets the stereo pan of the played audio (-1 is left speaker, 1 is right speaker, 0 is balanced). The default is 0. Used by non-spatial audio only.

    Declaration
    [EditorOrder(110)]
    [Limit(-1F, 1F, 1F)]
    [EditorDisplay("Video Player", null)]
    [VisibleIf("IsAudioSpatial", true)]
    [Unmanaged]
    public float AudioPan { get; set; }
    Property Value
    System.Single

    AudioVolume

    Gets or sets the volume of the audio played from this video, in [0, 1] range.

    Declaration
    [EditorOrder(100)]
    [Limit(0F, 1F, 0.01F)]
    [EditorDisplay("Video Player", null)]
    [Unmanaged]
    public float AudioVolume { get; set; }
    Property Value
    System.Single

    Duration

    Gets the media duration of playback (in seconds). Valid only when media was loaded by the video backend.

    Declaration
    [Unmanaged]
    public float Duration { get; }
    Property Value
    System.Single

    Frame

    Gets the video frame texture (GPU resource). Created on the playback start. Can be binded to materials and shaders to display the video image.

    Declaration
    [Unmanaged]
    public GPUTexture Frame { get; }
    Property Value
    GPUTexture

    FrameRate

    Gets the media frame rate of playback (amount of frames to be played per second). Valid only when media was loaded by the video backend.

    Declaration
    [Unmanaged]
    public float FrameRate { get; }
    Property Value
    System.Single

    FramesCount

    Gets the amount of video frames decoded and send to GPU during playback. Can be used to detect if video has started playback with any visible changes (for video frame texture contents). Valid only when media was loaded by the video backend.

    Declaration
    [Unmanaged]
    public int FramesCount { get; }
    Property Value
    System.Int32

    IsAudioSpatial

    If checked, video player us using spatialization to play 3d audio, otherwise will always play as 2d sound.

    Declaration
    [EditorOrder(50)]
    [EditorDisplay("Video Player", null)]
    [Unmanaged]
    public bool IsAudioSpatial { get; set; }
    Property Value
    System.Boolean

    IsLooping

    Determines whether the video clip should loop when it finishes playing.

    Declaration
    [EditorOrder(20)]
    [EditorDisplay("Video Player", null)]
    [Unmanaged]
    public bool IsLooping { get; set; }
    Property Value
    System.Boolean

    PlayOnStart

    Determines whether the video clip should autoplay on level start.

    Declaration
    [EditorOrder(30)]
    [EditorDisplay("Video Player", "Play On Start")]
    [Unmanaged]
    public bool PlayOnStart { get; set; }
    Property Value
    System.Boolean

    Size

    Gets the video frame dimensions (in pixels). Valid only when media was loaded by the video backend.

    Declaration
    [Unmanaged]
    public Int2 Size { get; }
    Property Value
    Int2

    StartTime

    Determines the time (in seconds) at which the video clip starts playing if Play On Start is enabled.

    Declaration
    [EditorOrder(35)]
    [Limit(0F, 3.40282347E+38F, 0.01F)]
    [EditorDisplay("Video Player", null)]
    [VisibleIf("PlayOnStart", false)]
    [Unmanaged]
    public float StartTime { get; set; }
    Property Value
    System.Single

    State

    Gets the current state of the video playback (playing/paused/stopped).

    Declaration
    [Unmanaged]
    public VideoPlayer.States State { get; }
    Property Value
    VideoPlayer.States

    Url

    The video clip Url path used as a source of the media. Can be local file (absolute or relative path), or streamed resource ('http://').

    Declaration
    [EditorOrder(10)]
    [EditorDisplay("Video Player", null)]
    [AssetReference(".mp4", false)]
    [CustomEditorAlias("FlaxEditor.CustomEditors.Editors.FilePathEditor")]
    [Unmanaged]
    public string Url { get; set; }
    Property Value
    System.String

    Methods

    Pause()

    Pauses the video playback.

    Declaration
    [Unmanaged]
    public void Pause()

    Play()

    Starts playing the currently assigned video Url.

    Declaration
    [Unmanaged]
    public void Play()

    Stop()

    Stops video playback, rewinding it to the start.

    Declaration
    [Unmanaged]
    public void Stop()

    Extension Methods

    Extensions.ReflectiveCompare<T>(T, T)
    Extensions.DeepClone<T>(T)
    Extensions.RawClone<T>(T)
    In This Article
    Back to top Copyright © 2012-2024 Wojciech Figat