Table of Contents

Interface IMediaPlayer

Namespace
VAST.Media
Assembly
VAST.Common.dll

Defines the contract for a media player that can play audio and video content.

public interface IMediaPlayer : IDisposable
Inherited Members

Properties

AbsolutePlaybackTime

Gets the absolute playback time if available from the media source.

DateTime? AbsolutePlaybackTime { get; }

Property Value

DateTime?

AudioStreamCount

Gets the number of available audio streams.

int AudioStreamCount { get; }

Property Value

int

AudioStreamIndex

Gets or sets the index of the audio stream currently being rendered.

int AudioStreamIndex { get; set; }

Property Value

int

AutoPlay

Gets or sets a value indicating whether playback starts automatically when URI or IMediaSource is assigned.

bool AutoPlay { get; set; }

Property Value

bool

Balance

Gets or sets the audio balance between left and right channels.

float Balance { get; set; }

Property Value

float

CanPause

Gets a value indicating whether the media can be paused.

bool CanPause { get; }

Property Value

bool

CanSeek

Gets a value indicating whether the media supports seeking.

bool CanSeek { get; }

Property Value

bool

CurrentState

Gets the current player state.

PlayerState CurrentState { get; }

Property Value

PlayerState

CurrentStatistics

Gets the current network statistics.

NetworkStat CurrentStatistics { get; }

Property Value

NetworkStat

Duration

Gets the total duration of the media.

TimeSpan Duration { get; }

Property Value

TimeSpan

EchoCanceller

Gets or sets the echo canceller for two-way communication scenarios.

IEchoCanceller EchoCanceller { get; set; }

Property Value

IEchoCanceller

InstanceId

Gets the unique identifier for this player instance.

Guid InstanceId { get; }

Property Value

Guid

IsFullScreen

Gets or sets a value indicating whether the player is in fullscreen mode.

bool IsFullScreen { get; set; }

Property Value

bool

IsLooping

Gets or sets a value indicating whether playback should loop continuously.

bool IsLooping { get; set; }

Property Value

bool

IsMuted

Gets or sets a value indicating whether the audio is muted.

bool IsMuted { get; set; }

Property Value

bool

PlaybackParameters

Gets or sets the playback parameters.

PlaybackParameters PlaybackParameters { get; set; }

Property Value

PlaybackParameters

PlaybackRate

Gets or sets the playback rate multiplier.

double PlaybackRate { get; set; }

Property Value

double

PlayerBackgroundColor

Gets or sets the player background color as a hexadecimal string. Acceptable formats: #AARRGGBB, #RRGGBB, AARRGGBB, RRGGBB. Examples: #FFFFFFFF, #FFFF00, FFFF0000, FF0000. The default value is #FF000000 (black).

string PlayerBackgroundColor { get; set; }

Property Value

string

Position

Gets or sets the current playback position.

TimeSpan Position { get; set; }

Property Value

TimeSpan

Source

Gets or sets the media source URI.

Uri Source { get; set; }

Property Value

Uri

SourceMedia

Gets or sets the media source object directly.

IMediaSource SourceMedia { get; set; }

Property Value

IMediaSource

Stretch

Gets or sets the video stretch mode.

StretchType Stretch { get; set; }

Property Value

StretchType

SubtitleStreamCount

Gets the number of available subtitle streams.

int SubtitleStreamCount { get; }

Property Value

int

SubtitleStreamIndex

Gets or sets the index of the subtitle stream currently being rendered.

int SubtitleStreamIndex { get; set; }

Property Value

int

VideoStreamCount

Gets the number of available video streams.

int VideoStreamCount { get; }

Property Value

int

VideoStreamIndex

Gets or sets the index of the video stream currently being rendered.

int VideoStreamIndex { get; set; }

Property Value

int

Volume

Gets or sets the audio volume level.

float Volume { get; set; }

Property Value

float

Methods

GetAudioMediaType(int)

Gets the media type of the audio stream at the specified index.

MediaType GetAudioMediaType(int streamIndex)

Parameters

streamIndex int

The index of the audio stream.

Returns

MediaType

The media type of the audio stream.

GetSubtitleMediaType(int)

Gets the media type of the subtitle stream at the specified index.

MediaType GetSubtitleMediaType(int streamIndex)

Parameters

streamIndex int

The index of the subtitle stream.

Returns

MediaType

The media type of the subtitle stream.

GetVideoMediaType(int)

Gets the media type of the video stream at the specified index.

MediaType GetVideoMediaType(int streamIndex)

Parameters

streamIndex int

The index of the video stream.

Returns

MediaType

The media type of the video stream.

Pause()

Pauses media playback.

void Pause()

Play()

Starts or resumes media playback.

void Play()

Stop()

Stops media playback and resets the position.

void Stop()

TakeSnapshot()

Takes a JPEG image snapshot of the current video frame.

Task<Stream> TakeSnapshot()

Returns

Task<Stream>

A task that returns a stream containing the JPEG image data.

Events

CurrentStateChanged

Occurs when the current player state changes.

event EventHandler<PlayerState> CurrentStateChanged

Event Type

EventHandler<PlayerState>

MediaEnded

Occurs when the media playback has ended.

event EventHandler MediaEnded

Event Type

EventHandler

MediaFailed

Occurs when a critical error prevents media playback.

event EventHandler<ErrorEventArgs> MediaFailed

Event Type

EventHandler<ErrorEventArgs>

MediaOpened

Occurs when the media has been successfully opened.

event EventHandler MediaOpened

Event Type

EventHandler

SeekCompleted

Occurs when a seek operation has been completed.

event EventHandler SeekCompleted

Event Type

EventHandler

VideoRenderingStarted

Occurs when video rendering has started.

event EventHandler VideoRenderingStarted

Event Type

EventHandler