Represents audio and video content that can be loaded into a Player to start a playback session. A source instance can be created via the Source.create function and will idle until it is loaded into a player. After loading the source into a player, isAttachedToPlayer is true and the same source can not be loaded into a different player until unloaded.
Multiple sources can be loaded into a player as part of a PlaylistConfig, where the first source in the playback session immediately becomes active. When the player transitions to another source in the playback session, that source becomes active. More information on how to manage multiple sources can be found on the PlaylistApi.
The source starts out LoadingState.Unloaded, transitions to LoadingState.Loading once the source starts loading and finally transitions to LoadingState.Loaded when it finished loading. When unloaded from a player, the source reverts to being LoadingState.Unloaded and detached. After this, the source can be loaded again into a (different) player.
The source emits events while it is attached to a player. See EventEmitter on how to subscribe to events. The source only emits events of type SourceEvent, and events that are emitted while the source is active are also emitted through the player it is attached to.
Removes the existing SubtitleTrack with trackId from the list of available subtitle tracks. If the track is currently selected, it will be de-selected and then removed. If no SubtitleTrack with the given trackId exists, the call has no effect. Use setSubtitleTrack and pass
null as the
trackId to just disable but not remove an active SubtitleTrack.