observeInterruptions

Register a listener for audio interruptions (phone calls, focus loss).

On Apple this is AVAudioSessionInterruptionNotification. On Android this is audio-focus change after setActive (requires bind(context) on Android). JVM, JS, and desktop never fire.

Attached streams are paused on AudioInterruptionType.BEGAN and restarted on AudioInterruptionType.ENDED when AudioInterruptionInfo.shouldResume is true. Listeners still run after that.

Multiple listeners are fanned out; this does not replace a previous registration. Call clearInterruptions with the same listener instance to unregister.

Parameters

listener

Callback invoked when an interruption begins or ends.

Register a listener for audio interruptions (phone calls, focus loss).

On Apple this is AVAudioSessionInterruptionNotification. On Android this is audio-focus change after setActive (requires bind(context) on Android). JVM, JS, and desktop never fire.

Attached streams are paused on AudioInterruptionType.BEGAN and restarted on AudioInterruptionType.ENDED when AudioInterruptionInfo.shouldResume is true. Listeners still run after that.

Multiple listeners are fanned out; this does not replace a previous registration. Call clearInterruptions with the same listener instance to unregister.

Parameters

listener

Callback invoked when an interruption begins or ends.

Register a listener for audio interruptions (phone calls, focus loss).

On Apple this is AVAudioSessionInterruptionNotification. On Android this is audio-focus change after setActive (requires bind(context) on Android). JVM, JS, and desktop never fire.

Attached streams are paused on AudioInterruptionType.BEGAN and restarted on AudioInterruptionType.ENDED when AudioInterruptionInfo.shouldResume is true. Listeners still run after that.

Multiple listeners are fanned out; this does not replace a previous registration. Call clearInterruptions with the same listener instance to unregister.

Parameters

listener

Callback invoked when an interruption begins or ends.

Register a listener for audio interruptions (phone calls, focus loss).

On Apple this is AVAudioSessionInterruptionNotification. On Android this is audio-focus change after setActive (requires bind(context) on Android). JVM, JS, and desktop never fire.

Attached streams are paused on AudioInterruptionType.BEGAN and restarted on AudioInterruptionType.ENDED when AudioInterruptionInfo.shouldResume is true. Listeners still run after that.

Multiple listeners are fanned out; this does not replace a previous registration. Call clearInterruptions with the same listener instance to unregister.

Parameters

listener

Callback invoked when an interruption begins or ends.

Register a listener for audio interruptions (phone calls, focus loss).

On Apple this is AVAudioSessionInterruptionNotification. On Android this is audio-focus change after setActive (requires bind(context) on Android). JVM, JS, and desktop never fire.

Attached streams are paused on AudioInterruptionType.BEGAN and restarted on AudioInterruptionType.ENDED when AudioInterruptionInfo.shouldResume is true. Listeners still run after that.

Multiple listeners are fanned out; this does not replace a previous registration. Call clearInterruptions with the same listener instance to unregister.

Parameters

listener

Callback invoked when an interruption begins or ends.

Register a listener for audio interruptions (phone calls, focus loss).

On Apple this is AVAudioSessionInterruptionNotification. On Android this is audio-focus change after setActive (requires bind(context) on Android). JVM, JS, and desktop never fire.

Attached streams are paused on AudioInterruptionType.BEGAN and restarted on AudioInterruptionType.ENDED when AudioInterruptionInfo.shouldResume is true. Listeners still run after that.

Multiple listeners are fanned out; this does not replace a previous registration. Call clearInterruptions with the same listener instance to unregister.

Parameters

listener

Callback invoked when an interruption begins or ends.