Class VideoInstance
public sealed class VideoInstance : GraphicsResourceBase, IDisposable, IComponent, IReferencable, ICollectorHolder
- Inheritance
-
objectVideoInstance
- Implements
- Inherited Members
- Extension Methods
Constructors
VideoInstance(IServiceRegistry, VideoComponent)
Initializes a new instance of the VideoInstance class.
public VideoInstance(IServiceRegistry services, VideoComponent videoComponent)
Parameters
servicesIServiceRegistryThe service provider.
videoComponentVideoComponentThe 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 the GraphicsDevice is inactive (put in the background and rendering is paused). By default, it does nothing.
protected override bool OnPause()
Returns
Remarks
This method may be overriden in derived classes to voluntarily release objects that can be easily recreated, such as Dynamic Buffers and Frame Buffers / Render Targets.
OnResume()
Called when the GraphicsDevice has resumed from either a paused or destroyed state. By default, it does nothing.
protected override void OnResume()
Remarks
This method may be overriden in derived classes to recreate the Graphics Resource if possible.
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
timeTimeSpan
Stop()
Stops the video.
public void Stop()
Remarks
The resources used by the video are also released.