Gondwana Game Engine Development (master) - 2.6.1
Gondwana is a cross-platform 2.5D game and rendering engine written in C#/.NET 8. It provides fine-grained control over rendering, timing, and scene composition, with built-in support for parallax, z-ordering, pixel overhang, collision detection, and particle effects. Gondwana targets desktop and web platforms using SkiaSharp for graphics and pluggable audio backends for desktop and browser targets.
Loading...
Searching...
No Matches
Gondwana.Video.IVideoPlayer Interface Reference

Defines the contract for a video player that can play, pause, stop, and seek video content. More...

Inheritance diagram for Gondwana.Video.IVideoPlayer:
Gondwana.Video.VlcVideoPlayer

Public Member Functions

void Open (Uri source)
 Opens a video from the specified source URI.
void Open (Stream source, bool leaveOpen=false)
 Opens a readable stream. Ownership transfers on success unless leaveOpen is true. Keep a borrowed stream alive and unused until the next Open or Dispose. Seek/loop require a seekable stream. Backends without stream support throw without taking ownership.
void Play ()
 Starts or resumes playback of the video.
void Pause ()
 Pauses the video playback.
void Stop ()
 Stops the video playback and resets the position.
void Seek (TimeSpan position)
 Seeks to the specified position in the video.
void SetRate (double rate)
 Sets the playback rate of the video.

Public Attributes

int width
 Gets the natural size (width and height) of the video in pixels.

Properties

VideoMetadata Metadata [get]
 Gets an atomic snapshot of metadata availability and values for the current source.
bool IsMetadataReady [get]
 True only when metadata for the current source is available.
bool Loop [get, set]
 Gets or sets a value indicating whether the video should loop when it reaches the end.
bool IsPlaying [get]
 Gets a value indicating whether the video is currently playing.
TimeSpan Duration [get]
 Gets the total duration of the video.
TimeSpan Position [get]
 Gets the current playback position in the video.
int int height NaturalSize [get]
bool HasAudio [get]
 Gets whether the video has an audio track. Consult IsMetadataReady before interpreting false.

Events

EventHandler Started
 Occurs when the video playback starts.
EventHandler Paused
 Occurs when the video playback is paused.
EventHandler Stopped
 Occurs when the video playback is stopped.
EventHandler Ended
 Occurs when the video playback reaches the end.
EventHandler< VideoStateChangedEventArgs > StateChanged
 Occurs when the video state changes, including MediaOpening, MediaOpened, MetadataReady, and MetadataFailed. MediaOpening must precede frames for a replacement source, after callbacks for the prior source have stopped. Events may run on background threads.
EventHandler< VideoFrameReadyEventArgs > FrameReady
 Occurs when a decoded BGRX frame is ready. The pointer is valid only during the callback. Copy it before returning. Do not call engine/render operations or player controls here.

Detailed Description

Defines the contract for a video player that can play, pause, stop, and seek video content.

Definition at line 6 of file IVideoPlayer.cs.

Member Function Documentation

◆ Open() [1/2]

void Gondwana.Video.IVideoPlayer.Open ( Stream source,
bool leaveOpen = false )

Opens a readable stream. Ownership transfers on success unless leaveOpen is true. Keep a borrowed stream alive and unused until the next Open or Dispose. Seek/loop require a seekable stream. Backends without stream support throw without taking ownership.

Parameters
sourceThe source.
leaveOpenWhether to leave the supplied stream open after use.

Implemented in Gondwana.Video.VlcVideoPlayer.

◆ Open() [2/2]

void Gondwana.Video.IVideoPlayer.Open ( Uri source)

Opens a video from the specified source URI.

Parameters
sourceThe URI of the video source to open.

Implemented in Gondwana.Video.VlcVideoPlayer.

◆ Pause()

void Gondwana.Video.IVideoPlayer.Pause ( )

Pauses the video playback.

Implemented in Gondwana.Video.VlcVideoPlayer.

◆ Play()

void Gondwana.Video.IVideoPlayer.Play ( )

Starts or resumes playback of the video.

Implemented in Gondwana.Video.VlcVideoPlayer.

◆ Seek()

void Gondwana.Video.IVideoPlayer.Seek ( TimeSpan position)

Seeks to the specified position in the video.

Parameters
positionThe position to seek to in the video timeline.

Implemented in Gondwana.Video.VlcVideoPlayer.

◆ SetRate()

void Gondwana.Video.IVideoPlayer.SetRate ( double rate)

Sets the playback rate of the video.

Parameters
rateThe playback rate multiplier (e.g., 1.0 for normal speed, 2.0 for double speed).

Implemented in Gondwana.Video.VlcVideoPlayer.

◆ Stop()

void Gondwana.Video.IVideoPlayer.Stop ( )

Stops the video playback and resets the position.

Implemented in Gondwana.Video.VlcVideoPlayer.

Member Data Documentation

◆ width

int Gondwana.Video.IVideoPlayer.width

Gets the natural size (width and height) of the video in pixels.

Definition at line 81 of file IVideoPlayer.cs.

Property Documentation

◆ Duration

TimeSpan Gondwana.Video.IVideoPlayer.Duration
get

Gets the total duration of the video.

Implemented in Gondwana.Video.VlcVideoPlayer.

Definition at line 71 of file IVideoPlayer.cs.

◆ HasAudio

bool Gondwana.Video.IVideoPlayer.HasAudio
get

Gets whether the video has an audio track. Consult IsMetadataReady before interpreting false.

Implemented in Gondwana.Video.VlcVideoPlayer.

Definition at line 86 of file IVideoPlayer.cs.

◆ IsMetadataReady

bool Gondwana.Video.IVideoPlayer.IsMetadataReady
get

True only when metadata for the current source is available.

Implemented in Gondwana.Video.VlcVideoPlayer.

Definition at line 27 of file IVideoPlayer.cs.

◆ IsPlaying

bool Gondwana.Video.IVideoPlayer.IsPlaying
get

Gets a value indicating whether the video is currently playing.

Implemented in Gondwana.Video.VlcVideoPlayer.

Definition at line 66 of file IVideoPlayer.cs.

◆ Loop

bool Gondwana.Video.IVideoPlayer.Loop
getset

Gets or sets a value indicating whether the video should loop when it reaches the end.

Implemented in Gondwana.Video.VlcVideoPlayer.

Definition at line 59 of file IVideoPlayer.cs.

◆ Metadata

VideoMetadata Gondwana.Video.IVideoPlayer.Metadata
get

Gets an atomic snapshot of metadata availability and values for the current source.

Implemented in Gondwana.Video.VlcVideoPlayer.

Definition at line 24 of file IVideoPlayer.cs.

◆ NaturalSize

int int height Gondwana.Video.IVideoPlayer.NaturalSize
get

Implemented in Gondwana.Video.VlcVideoPlayer.

Definition at line 81 of file IVideoPlayer.cs.

◆ Position

TimeSpan Gondwana.Video.IVideoPlayer.Position
get

Gets the current playback position in the video.

Implemented in Gondwana.Video.VlcVideoPlayer.

Definition at line 76 of file IVideoPlayer.cs.

Event Documentation

◆ Ended

EventHandler Gondwana.Video.IVideoPlayer.Ended

Occurs when the video playback reaches the end.

Definition at line 108 of file IVideoPlayer.cs.

◆ FrameReady

EventHandler<VideoFrameReadyEventArgs> Gondwana.Video.IVideoPlayer.FrameReady

Occurs when a decoded BGRX frame is ready. The pointer is valid only during the callback. Copy it before returning. Do not call engine/render operations or player controls here.

Definition at line 121 of file IVideoPlayer.cs.

◆ Paused

EventHandler Gondwana.Video.IVideoPlayer.Paused

Occurs when the video playback is paused.

Definition at line 98 of file IVideoPlayer.cs.

◆ Started

EventHandler Gondwana.Video.IVideoPlayer.Started

Occurs when the video playback starts.

Definition at line 93 of file IVideoPlayer.cs.

◆ StateChanged

EventHandler<VideoStateChangedEventArgs> Gondwana.Video.IVideoPlayer.StateChanged

Occurs when the video state changes, including MediaOpening, MediaOpened, MetadataReady, and MetadataFailed. MediaOpening must precede frames for a replacement source, after callbacks for the prior source have stopped. Events may run on background threads.

Definition at line 115 of file IVideoPlayer.cs.

◆ Stopped

EventHandler Gondwana.Video.IVideoPlayer.Stopped

Occurs when the video playback is stopped.

Definition at line 103 of file IVideoPlayer.cs.