VideoPlayerclass

Enables video playback and access to the video texture and audio.

object→VideoPlayer
Namespace
Sandbox
Assembly
Sandbox.Engine
Declaration
public sealed class Sandbox.VideoPlayer

Constructors1

Showing 1 constructors

Methods9

Showing 9 methods

public virtual sealed void Dispose()PUBLICVIRTUAL

Returns:void—

public void Pause()PUBLIC

Pauses video playback.

Returns:void—

public void Present()PUBLIC

Present a video frame.

Returns:void—

public void Resume()PUBLIC

Resumes video playback.

Returns:void—

public void Seek(float time)PUBLIC

Sets the playback position to a specified time in the video, given in seconds.

ParameterTypeDescription
timefloat—
Returns:void—

public void Stop()PUBLIC

Stops video playback.

Returns:void—

public void TogglePause()PUBLIC

Toggle video playback

Returns:void—

Properties17

Showing 17 properties

public int Sandbox.VideoPlayer.Channels { get; set; }PUBLICGETSET

Number of audio channels.

Returns:int—

public float Sandbox.VideoPlayer.Duration { get; set; }PUBLICGETSET

Gets the total duration of the video in seconds.

Returns:float—

public bool Sandbox.VideoPlayer.HasAudio { get; set; }PUBLICGETSET

Does the loaded video have audio?

Returns:bool—

public int Sandbox.VideoPlayer.Height { get; set; }PUBLICGETSET

Height of the video.

Returns:int—

public bool Sandbox.VideoPlayer.IsPaused { get; set; }PUBLICGETSET

Has the video been paused?

Returns:bool—

public bool Sandbox.VideoPlayer.Muted { get; set; }PUBLICGETSET

The video is muted

Returns:bool—

public System.Action Sandbox.VideoPlayer.OnAudioReady { get; set; }PUBLICGETSET

Event that is invoked when the audio stream is created and ready to use.

Returns:Action—

public System.Action Sandbox.VideoPlayer.OnFinished { get; set; }PUBLICGETSET

Video finished playing.

Returns:Action—

public System.Action Sandbox.VideoPlayer.OnLoaded { get; set; }PUBLICGETSET

Video successfully loaded.

Returns:Action—

public System.Action Sandbox.VideoPlayer.OnRepeated { get; set; }PUBLICGETSET

Video started playing again after looping.

Returns:Action—

public Sandbox.VideoPlayer.TextureChangedDelegate Sandbox.VideoPlayer.OnTextureData { get; set; }PUBLICGETSET

If this event is set, texture data will be provided instead of rendering to the texture.

public float Sandbox.VideoPlayer.PlaybackTime { get; set; }PUBLICGETSET

Gets the current playback time in seconds.

Returns:float—

public bool Sandbox.VideoPlayer.Repeat { get; set; }PUBLICGETSET

Sets whether the video should loop when it reaches the end.

Returns:bool—

public int Sandbox.VideoPlayer.SampleRate { get; set; }PUBLICGETSET

Audio sample rate.

Returns:int—

public int Sandbox.VideoPlayer.Width { get; set; }PUBLICGETSET

Width of the video.

Returns:int—

On this page

Constructorspublic VideoPlayer()Methodspublic virtual sealed System.Void Dispose()public System.Void Pause()public System.Void Play(Sandbox.BaseFileSystem filesystem, System.String path)public System.Void Play(System.String url)public System.Void Present()public System.Void Resume()public System.Void Seek(System.Single time)public System.Void Stop()public System.Void TogglePause()Propertiespublic Sandbox.VideoPlayer.AudioAccessor Sandbox.VideoPlayer.Audio { get; set; }public System.Int32 Sandbox.VideoPlayer.Channels { get; set; }public System.Single Sandbox.VideoPlayer.Duration { get; set; }public System.Boolean Sandbox.VideoPlayer.HasAudio { get; set; }public System.Int32 Sandbox.VideoPlayer.Height { get; set; }public System.Boolean Sandbox.VideoPlayer.IsPaused { get; set; }public System.Boolean Sandbox.VideoPlayer.Muted { get; set; }public System.Action Sandbox.VideoPlayer.OnAudioReady { get; set; }public System.Action Sandbox.VideoPlayer.OnFinished { get; set; }public System.Action Sandbox.VideoPlayer.OnLoaded { get; set; }public System.Action Sandbox.VideoPlayer.OnRepeated { get; set; }public Sandbox.VideoPlayer.TextureChangedDelegate Sandbox.VideoPlayer.OnTextureData { get; set; }public System.Single Sandbox.VideoPlayer.PlaybackTime { get; set; }public System.Boolean Sandbox.VideoPlayer.Repeat { get; set; }public System.Int32 Sandbox.VideoPlayer.SampleRate { get; set; }public Sandbox.Texture Sandbox.VideoPlayer.Texture { get; set; }public System.Int32 Sandbox.VideoPlayer.Width { get; set; }Metadata