setAutoHandleInterruptions method
Opts the plugin into handling system audio interruptions (calls, navigation prompts, other apps grabbing audio).
When enabled, the plugin requests audio focus on Android while
playback is playing, and forwards focus events to your app via
the existing onMediaAction stream (pause on focus loss, play
when transient focus returns). Defaults to false.
Leave this off if your audio player already manages focus
(such as audioplayers or just_audio). Turn it on for players
that do not manage focus themselves (such as fvp or video_player).
Implementation
@override
Future<void> setAutoHandleInterruptions(bool enabled) async {
await methodChannel.invokeMethod('setAutoHandleInterruptions', enabled);
}