IFluxVideoPlayer

csharp
public interface IFluxVideoPlayer : IDisposable

Namespace NodeWorld.SDK.Client.Flux.

One video player. Called on the main thread only; Update once per frame. States and errors use the values of the FL# API (NodeWorld.Flux.VideoState, VideoError).

Properties

Time

csharp
double Time { get; set; }

Seconds; setting it seeks.

Duration

csharp
double Duration { get; }

Seconds; 0 while unknown, and for a live stream.

IsLive

csharp
bool IsLive { get; }

A live stream: no duration, no seeking.

Rate

csharp
float Rate { get; set; }

Playback speed (1: normal).

State

csharp
int State { get; }

Where the player is, a NodeWorld.Flux.VideoState value.

Error

csharp
int Error { get; }

Why it failed, a NodeWorld.Flux.VideoError value.

Width

csharp
int Width { get; }

Width of the picture, in pixels.

Height

csharp
int Height { get; }

Height of the picture, in pixels.

Texture

csharp
Texture Texture { get; }

The picture (sRGB, upright), null until the first one. It may be replaced when the size changes.

Methods

Load

csharp
void Load(string url, double start, bool play)

Opens the media at url (a page of a video site is resolved by the client) from start seconds; plays when loaded if play.

Play

csharp
void Play()

Plays the media.

Pause

csharp
void Pause()

Pauses the media.

Stop

csharp
void Stop()

Unloads the media.

SetAudioOutputs

csharp
void SetAudioOutputs(AudioSource[] sources, float[] gainsDb)

These audio sources play the sound from now on, each with its gain (dB); their volume, mute and 3D settings apply after it.

Update

csharp
void Update()

Moves the player on: called once per frame, on the main thread.