File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,12 @@ class TimerPageState extends State<TimerPage>
4444 Timer ? _notificationUpdateTimer;
4545 late String sessionKey;
4646 static final AudioPlayer _audioPlayer = AudioPlayer ();
47+ static final AudioContext _audioContext = AudioContext (
48+ android: AudioContextAndroid (
49+ usageType: AndroidUsageType .media,
50+ audioFocus: AndroidAudioFocus .gainTransient,
51+ ),
52+ );
4753 static FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin =
4854 FlutterLocalNotificationsPlugin ();
4955
@@ -65,7 +71,7 @@ class TimerPageState extends State<TimerPage>
6571
6672 @pragma ('vm:entry-point' )
6773 static _ring () async {
68- await _audioPlayer.play (AssetSource (audioResourceName));
74+ await _audioPlayer.play (AssetSource (audioResourceName), ctx : _audioContext );
6975 }
7076
7177 _updateProgressNotification () async {
You can’t perform that action at this time.
0 commit comments