Skip to main content

Interface: PublicVindralEvents

The events that can be emitted from the Vindral instance

Properties

channel switch

channel switch: Readonly<ChannelSwitchContext>

Emitted when a channel switch has been completed and the first frame of the new channel is rendered. A string containing the channel id of the new channel is provided as an argument.


channels

channels: readonly Channel[]

When the available channels is changed


connection state

connection state: Readonly<State>

When the connection state changes


context switch

context switch: Readonly<ContextSwitchState>

When a context switch state change has occured. E.g. when a channel change has been requested, or quality is changed.


error

error: Readonly<VindralError>

When an error that requires action has occured

Can be a fatal error that will unload the Vindral instance - this is indicated by isFatal() on the error object returning true.

In case of a fatal error it is appropriate to indicate what the error was to the user, either by displaying the error.message or by using the error.code() as a key to look up a localization string. To resume streaming it is required to create a new Vindral instance.


is live

is live: boolean

Is emitted during connection whether the channel is live or not.

If the channel is not live, the Vindral instance will try to reconnect until the reconnectHandler determines that no more retries should be made.

Note: If the web-sdk is instantiated at the same time as you are starting the stream it is possible that this emits false until the started state has propagated through the system.


language switch

language switch: Readonly<LanguageSwitchContext>

Emitted when a language switch has been completed and the new language starts playing.


languages

languages: readonly string[]

When the available languages is changed


metadata

metadata: Readonly<Metadata>

When a timed metadata event has been triggered


needs user input

needs user input: NeedsUserInputContext

When the instance needs user input to activate audio or sometimes video playback. Is called with an object

{
forAudio: boolean // true if user input is needed for audio playback
forVideo: boolean // true if user input is needed for video playback
}

playback state

playback state: Readonly<PlaybackState>

When the playback state changes


rendition level

rendition level: Readonly<RenditionLevel>

When the rendition level is changed


rendition levels

rendition levels: readonly RenditionLevel[]

When the available rendition levels is changed


server wallclock time

server wallclock time: number

Emitted when a wallclock time message has been received from the server.

Note: This is the edge server wallclock time and thus may differ slightly between two viewers if they are connected to different edge servers.


volume state

volume state: Readonly<VolumeState>

Emitted when the volume state changes.

This is triggered triggered both when the user changes the volume through the Vindral instance, but also from external sources such as OS media shortcuts or other native UI outside of the browser.