Interface BackgroundAudioConfiguration

Describes the configuration of the background audio feature.

interface BackgroundAudioConfiguration {
    audioSessionMode?: AudioSessionMode;
    enabled?: boolean;
    shouldResumeAfterInterruption?: boolean;
    stopOnBackground?: boolean;
}

Properties

audioSessionMode?: AudioSessionMode

Specify the mode for the native iOS AVAudioSession.

Default Value

AudioSessionMode.MOVIE_PLAYBACK

Platform

iOS
enabled?: boolean

Whether background audio should be enabled when transitioning to background.

Remarks

When 'stopOnBackground' is true, 'enabled' is assumed to be false and background audio will not play.

Default Value

false

shouldResumeAfterInterruption?: boolean

Whether background audio should be resumed after an interruption on iOS (e.g. incoming call).

Default Value

false

Platform

iOS
stopOnBackground?: boolean

Whether the player should stop play-out when the app goes to background. This differs from enabled which allows play-out to either continue in background, or be paused. Note that when the app comes back to foreground, a new source would have to be set.

Default Value

false