Configures the playback behaviour of the player.

interface PlaybackConfig {
    isAutoplayEnabled?: boolean;
    isBackgroundPlaybackEnabled?: boolean;
    isMuted?: boolean;
    isPictureInPictureEnabled?: boolean;
    isTimeShiftEnabled?: boolean;
}

Properties

isAutoplayEnabled?: boolean

Whether the player starts playing automatically after loading a source or not. Default is false.

Example

const player = new Player({
playbackConfig: {
isAutoplayEnabled: true,
},
});
isBackgroundPlaybackEnabled?: boolean

Whether background playback is enabled or not. Default is false.

When set to true, playback is not automatically paused anymore when the app moves to the background. When set to true, also make sure to properly configure your app to allow background playback.

Default is false.

Note

On Android, MediaControlConfig.isEnabled has to be true for background playback to work.

Note

On tvOS, background playback is only supported for audio-only content.

Example

const player = new Player({
playbackConfig: {
isBackgroundPlaybackEnabled: true,
},
});
isMuted?: boolean

Whether the sound is muted on startup or not. Default value is false.

Example

const player = new Player({
playbackConfig: {
isMuted: true,
},
});
isPictureInPictureEnabled?: boolean

Whether the Picture in Picture mode option is enabled or not. Default is false.

Example

const player = new Player({
playbackConfig: {
isPictureInPictureEnabled: true,
},
});

Deprecated

Use PictureInPictureConfig.isEnabled instead.

isTimeShiftEnabled?: boolean

Whether time shift / DVR for live streams is enabled or not. Default is true.

Example

const player = new Player({
playbackConfig: {
isTimeShiftEnabled: false,
},
});