Type Alias: AudioSessionInterruptionEvent
type AudioSessionInterruptionEvent =
| {
begin: true;
permanent: boolean;
type: AudioInterruptionType;
}
| {
begin: false;
shouldResume: boolean;
};
Defined in: packages/audio-session/src/types.ts:15
An interruption, as the JS layer sees it.
This is the discriminated union from the spec doc. The bridge carries a flat
struct instead (NativeInterruptionEvent) because nitrogen cannot express a
string-literal discriminator; narrowInterruptionEvent is the single
place that converts one into the other.
Union Members
Type Literal
{
begin: true;
permanent: boolean;
type: AudioInterruptionType;
}
begin
readonly begin: true;
permanent
readonly permanent: boolean;
true when the session is gone for good — Android AUDIOFOCUS_LOSS,
or an iOS media-services failure. A begin: false event with
shouldResume: true will never follow.
An ordinary iOS interruption (a call, Siri, another app) is always
false: AVAudioSession carries no permanence information on
.began. See NativeInterruptionEvent.permanent.
type
readonly type: AudioInterruptionType;
What the OS is asking us to do while the interruption lasts.
Type Literal
{
begin: false;
shouldResume: boolean;
}
begin
readonly begin: false;
shouldResume
readonly shouldResume: boolean;
true when the OS recommends resuming playback.