The events that can be emitted from the Vindral instance
• channel switch:
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: readonly
When the available channels is changed
• connection state:
When the connection state changes
• context switch:
When a context switch state change has occured. E.g. when a channel change has been requested, or quality is changed.
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 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
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:
Emitted when a language switch has been completed and the new language starts playing.
• languages: readonly
When the available languages is changed
When a timed metadata event has been triggered
needs user input
• needs user input:
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:
When the playback state changes
• rendition level:
When the rendition level is changed
• rendition levels: readonly
When the available rendition levels is changed
server wallclock time
• server wallclock time:
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:
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.