setAutoHandleInterruptions method

  1. @override
Future<void> setAutoHandleInterruptions(
  1. bool enabled
)
override

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 {
  // No-op on web: browsers don't expose audio-focus-style interruption
  // events, and the page is typically the only audio source.
}