Table of Contents

Class VideoStreamPlayback

Namespace
Godot
Assembly
GodotSharp.dll

This class is intended to be overridden by video decoder extensions with custom implementations of VideoStream.

public class VideoStreamPlayback : Resource, IDisposable
Inheritance
VideoStreamPlayback
Implements
Inherited Members

Constructors

VideoStreamPlayback()

public VideoStreamPlayback()

Methods

HasGodotClassMethod(in godot_string_name)

Check if the type contains a method with the given name. This method is used by Godot to check if a method exists before invoking it. Do not call or override this method.

protected override bool HasGodotClassMethod(in godot_string_name method)

Parameters

method godot_string_name

Name of the method to check for.

Returns

bool

HasGodotClassSignal(in godot_string_name)

Check if the type contains a signal with the given name. This method is used by Godot to check if a signal exists before raising it. Do not call or override this method.

protected override bool HasGodotClassSignal(in godot_string_name signal)

Parameters

signal godot_string_name

Name of the signal to check for.

Returns

bool

InvokeGodotClassMethod(in godot_string_name, NativeVariantPtrArgs, out godot_variant)

Invokes the method with the given name, using the given arguments. This method is used by Godot to invoke methods from the engine side. Do not call or override this method.

protected override bool InvokeGodotClassMethod(in godot_string_name method, NativeVariantPtrArgs args, out godot_variant ret)

Parameters

method godot_string_name

Name of the method to invoke.

args NativeVariantPtrArgs

Arguments to use with the invoked method.

ret godot_variant

Value returned by the invoked method.

Returns

bool

MixAudio(int, float[], int)

Render numFrames audio frames (of _GetChannels() floats each) from buffer, starting from index offset in the array. Returns the number of audio frames rendered, or -1 on error.

public int MixAudio(int numFrames, float[] buffer = null, int offset = 0)

Parameters

numFrames int
buffer float[]

If the parameter is null, then the default value is Array.Empty<float>().

offset int

Returns

int

_GetChannels()

Returns the number of audio channels.

public virtual int _GetChannels()

Returns

int

_GetLength()

Returns the video duration in seconds, if known, or 0 if unknown.

public virtual double _GetLength()

Returns

double

_GetMixRate()

Returns the audio sample rate used for mixing.

public virtual int _GetMixRate()

Returns

int

_GetPlaybackPosition()

Return the current playback timestamp. Called in response to the StreamPosition getter.

public virtual double _GetPlaybackPosition()

Returns

double

_GetTexture()

Allocates a Texture2D in which decoded video frames will be drawn.

public virtual Texture2D _GetTexture()

Returns

Texture2D

_IsPaused()

Returns the paused status, as set by _SetPaused(bool).

public virtual bool _IsPaused()

Returns

bool

_IsPlaying()

Returns the playback state, as determined by calls to _Play() and _Stop().

public virtual bool _IsPlaying()

Returns

bool

_Play()

Called in response to Autoplay or Play(). Note that manual playback may also invoke _Stop() multiple times before this method is called. _IsPlaying() should return true once playing.

public virtual void _Play()

_Seek(double)

Seeks to time seconds. Called in response to the StreamPosition setter.

public virtual void _Seek(double time)

Parameters

time double

_SetAudioTrack(int)

Select the audio track idx. Called when playback starts, and in response to the AudioTrack setter.

public virtual void _SetAudioTrack(int idx)

Parameters

idx int

_SetPaused(bool)

Set the paused status of video playback. _IsPaused() must return paused. Called in response to the Paused setter.

public virtual void _SetPaused(bool paused)

Parameters

paused bool

_Stop()

Stops playback. May be called multiple times before _Play(), or in response to Stop(). _IsPlaying() should return false once stopped.

public virtual void _Stop()

_Update(double)

Ticks video playback for delta seconds. Called every frame as long as _IsPaused() and _IsPlaying() return true.

public virtual void _Update(double delta)

Parameters

delta double