audio.watch
Calls listener when the system interrupts the app's audio, and when the
interruption ends. In a component it stops when the component unmounts.
Verwendung
Show when a phone call interrupts audio.
// Show when a phone call interrupts audio.
import { Text, audio, signal, type AudioInterruption } from 'kuito';
export function AudioStatus() {
const interruption = signal<AudioInterruption | null>(null);
audio.watch('interruption', (event) => {
interruption.value = event;
});
return <Text>{interruption.value ? JSON.stringify(interruption.value) : 'No interruption'}</Text>;
}Signaturen
(event: "interruption", listener: (interruption: AudioInterruption) => void): EventSubscriptionParameter
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
event | "interruption" | Ja | — |
listener | (interruption: AudioInterruption) => void | Ja | — |
Rückgabe
Generiert aus den öffentlichen TypeScript-Deklarationen: Signaturen, Props und Standardwerte stammen aus der geprüften Quelle, Beschreibungen aus deren JSDoc. Kein Standardwert ist erfunden.