Table of Contents

Class VideoInstance

Namespace
Stride.Video
Assembly
Stride.Video.dll
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 IServiceRegistry

The service provider.

videoComponent VideoComponent

The video component associated with this instance

Fields

Logger

public static Logger Logger

Field Value

Logger

Properties

CurrentTime

public TimeSpan CurrentTime { get; }

Property Value

TimeSpan

Duration

The duration of the video.

public TimeSpan Duration { get; }

Property Value

TimeSpan

IsLooping

Define if the video loop or not after reaching the end of the range

public bool IsLooping { get; set; }

Property Value

bool

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

PlayRange

MaxMipMapCount

public uint MaxMipMapCount { get; }

Property Value

uint

PlayRange

public PlayRange PlayRange { get; set; }

Property Value

PlayRange

PlayState

The current state of the video.

public PlayState PlayState { get; }

Property Value

PlayState

SpeedFactor

Applies a speed factor the to the video playback. The default value is 1.0f.

public float SpeedFactor { get; set; }

Property Value

float

Volume

The global volume at which the sound is played.

public float Volume { get; set; }

Property Value

float

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

bool

True if item transitioned to a Paused state.

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.