Class VideoInstance
public sealed class VideoInstance : GraphicsResourceBase, IDisposable, IComponent, IReferencable, ICollectorHolder
- Inheritance
-
VideoInstance
- Implements
- Inherited Members
- Extension Methods
Constructors
VideoInstance(IServiceRegistry, VideoComponent)
Initializes a new instance of the VideoInstance class.
public VideoInstance(IServiceRegistry services, VideoComponent videoComponent)
Parameters
services
IServiceRegistryThe service provider.
videoComponent
VideoComponentThe video component associated with this instance
Fields
Logger
public static Logger Logger
Field Value
Properties
CurrentTime
public TimeSpan CurrentTime { get; }
Property Value
Duration
The duration of the video.
public TimeSpan Duration { get; }
Property Value
IsLooping
Define if the video loop or not after reaching the end of the range
public bool IsLooping { get; set; }
Property Value
LoopRange
if Loop is set to true: set the time at which we restart the video when we arrive at LoopRangeEnd
public PlayRange LoopRange { get; set; }
Property Value
MaxMipMapCount
public uint MaxMipMapCount { get; }
Property Value
PlayRange
public PlayRange PlayRange { get; set; }
Property Value
PlayState
The current state of the video.
public PlayState PlayState { get; }
Property Value
SpeedFactor
Applies a speed factor the to the video playback. The default value is 1.0f
.
public float SpeedFactor { get; set; }
Property Value
Volume
The global volume at which the sound is played.
public float Volume { get; set; }
Property Value
Remarks
Volume is ranging from 0.0f (silence) to 1.0f (full volume). Values beyond those limits are clamped.
Methods
InitializeFromDataSource()
public void InitializeFromDataSource()
OnPause()
Called when graphics device is inactive (put in the background and rendering is paused). It should voluntarily release objects that can be easily recreated, such as FBO and dynamic buffers.
protected override bool OnPause()
Returns
OnResume()
Called when graphics device is resumed from either paused or destroyed state. If possible, resource should be recreated.
protected override void OnResume()
Pause()
Pauses the video.
public void Pause()
Play()
Plays or resumes the video.
public void Play()
Remarks
If the video was stopped, plays from the beginning. If the video was paused, resumes playing. If the video is already playing, this method does nothing.
Release()
Release the VideoInstance
public void Release()
RestartVideo()
Restarts the video from the beginning.
public void RestartVideo()
Seek(TimeSpan)
Seeks the video to the provided time
.
public void Seek(TimeSpan time)
Parameters
time
TimeSpan
Stop()
Stops the video.
public void Stop()
Remarks
The resources used by the video are also released.