bluefireteam / audioplayers

A Flutter package to play multiple audio files simultaneously (Android/iOS/web/Linux/Windows/macOS)
https://pub.dartlang.org/packages/audioplayers
MIT License
2.01k stars 845 forks source link

Add callback for audio focus loss in audioplayer #1808

Open wjlotus1992 opened 5 months ago

wjlotus1992 commented 5 months ago

Checklist

Use case / Problem

I'm using the audioplayer plugin for audio playback in my Flutter application. I need a way to notify the application or the current page when the audio focus is lost so that I can call other callbacks or perform additional actions.

Proposal / Solution

Add a callback or a stream to the audioplayer plugin that gets triggered when the audio focus is lost. This would allow developers to handle audio focus changes more effectively within their Flutter applications.

Example Code

Example Code ```dart void main() { } ```

Affected platforms

Android

Platform details

No response

Audio Files/URLs/Sources

No response

Mockups

No response

Related issues / more information

No response

Working on PR

no way