mirror of
https://github.com/HendrikRauh/inventree-app.git
synced 2026-01-13 03:26:24 +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:
parent
09625c81e2
commit
ea3410a3da
3 changed files with 18 additions and 1 deletions
|
|
@ -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));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue