Loads, controls and renders audio and video content represented through Sources. A player instance can be created via the Player.create function and will idle until one or more Sources are loaded. Once load is called, the player starts a playback session and initiates necessary downloads to start playback of the loaded source(s).
In case multiple sources were loaded into the player, Source.isActive identifies which source is currently active in the playback session. Only one source can be active at any time and API calls on the player will act on that source. More information on how to manage multiple sources can be found on the PlaylistApi.
The player emits events during its lifecycle. See EventEmitter on how to subscribe to events. Events are divided into PlayerEvent and SourceEvent, depending on if they are specific to the player and playback session as a whole or a source. While SourceEvents are naturally emitted from a source, they are also emitted from the player for the active source. This allows for all event handling to be done through the player in case only a single source is loaded, enabling the same workflows as on v2 of the Bitmovin Player SDK, where it was not possible to load multiple sources and where each event was a PlayerEvent.
The player implements the RemoteControlApi, which offers the ability to connect to a cast-compatible device, allowing remote playback of the loaded sources.
By default, a player instance does not provide any UI components. To use the default Bitmovin Player Web UI, a player instance can be attached to a PlayerView. The PlayerView already comes with a Surface to render video into, a ViewGroup to display ads, the Bitmovin Player Web UI and handling for standard UI use-cases. If a custom UI is preferred, a Surface must be provided to the player via setSurface and a ViewGroup must be set via setAdViewGroup if advertising features are needed.
Starts a new playback session consisting of the source.
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 setSubtitle to just disable but not remove an active SubtitleTrack.
Sets the upper bitrate boundary for video qualities to bitrate. All qualities with a bitrate that is higher than this threshold will not be eligible for automatic quality selection, although they are still available for manual quality selection.
Sets the Surface onto which video will be rendered. The player tracks the life cycle of the surface automatically.
Shifts the time to the given offset in seconds from the live edge. The resulting offset has to be within the timeShift window as specified by maxTimeShift (which is a negative value) and 0. When the provided offset is positive, it will be interpreted as a UNIX timestamp in seconds and converted to fit into the timeShift window. When the provided offset is negative, but lower than maxTimeShift, then it will be clamped to maxTimeShift. Has no effect for VoD.
The AudioQuality that is currently being played back or null if no audio is currently being played back. The returned quality always represents the actual current audio quality, while audioQuality represents what the player is working towards playing (e.g. a new quality can be selected even though it is not being played yet).
The VideoQuality that is currently being played back or null if no video is currently being played back. The returned quality always represents the actual current video quality, while videoQuality represents what the player is working towards playing (e.g. a new quality can be selected even though it is not being played yet).