audioplayers
audioplayers copied to clipboard
iOS audio gets muted when Notification Center is opened and phone is on silent mode.
I've noticed when I have my iPhone on silent mode and drag down the Notification Center the audio is muted but the audio player is still running.
Platforms iOS
- OS: iOS
- OS version: 15.5
- Device: iPhone 7 (Physical device)
- flutter version: 3.0.1
- audioplayers version: 0.20.1
- release or not release: debug
Has anyone else been able to recreate this?
Add this to your code
final AudioContext audioContext = AudioContext(
iOS: AudioContextIOS(
defaultToSpeaker: true,
category: AVAudioSessionCategory.ambient,
options: [],
),
android: AudioContextAndroid(
isSpeakerphoneOn: true,
stayAwake: true,
contentType: AndroidContentType.sonification,
usageType: AndroidUsageType.assistanceSonification,
audioFocus: AndroidAudioFocus.gain,
),
);