2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-06-14 03:05:32 +00:00

Sounds fix (#583)

* Prevent notification sounds from pausing external media

- Closes https://github.com/inventree/inventree-app/issues/582

* Bump release notes

* Bump version number

* Update release notes
This commit is contained in:
Oliver
2024-12-17 17:46:48 +11:00
committed by GitHub
parent 09625c81e2
commit ea3410a3da
3 changed files with 18 additions and 1 deletions

View File

@ -107,6 +107,17 @@ Future<void> playAudioFile(String path) async {
}
final player = AudioPlayer();
// Specify context options for the audio player
// Ref: https://github.com/inventree/inventree-app/issues/582
player.setAudioContext(AudioContext(
android: AudioContextAndroid(
usageType: AndroidUsageType.notification,
audioFocus: AndroidAudioFocus.none,
),
iOS: AudioContextIOS()
));
player.play(AssetSource(path));
}