Allow Bluetooth headphones for iOS playandrecord mode
This commit is contained in:
1 parent
2d1f7be270
commit
2ae1c0f5d0
2 files changed
+8
No files matched your search
Regular → Executable
File mode changed.
@@ -370,7 +370,15 @@ static BOOL update_audio_session(_THIS, SDL_bool open, SDL_bool allow_playandrec
|
|||||||
if (category == AVAudioSessionCategoryPlayAndRecord) {
|
if (category == AVAudioSessionCategoryPlayAndRecord) {
|
||||||
options |= AVAudioSessionCategoryOptionDefaultToSpeaker;
|
options |= AVAudioSessionCategoryOptionDefaultToSpeaker;
|
||||||
}
|
}
|
||||||
|
if (category == AVAudioSessionCategoryRecord ||
|
||||||
|
category == AVAudioSessionCategoryPlayAndRecord) {
|
||||||
|
options |= AVAudioSessionCategoryOptionAllowBluetooth;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
if (category == AVAudioSessionCategoryPlayAndRecord) {
|
||||||
|
options |= AVAudioSessionCategoryOptionAllowBluetoothA2DP |
|
||||||
|
AVAudioSessionCategoryOptionAllowAirPlay;
|
||||||
|
}
|
||||||
|
|
||||||
if ([session respondsToSelector:@selector(setCategory:mode:options:error:)]) {
|
if ([session respondsToSelector:@selector(setCategory:mode:options:error:)]) {
|
||||||
if (![session.category isEqualToString:category] || session.categoryOptions != options) {
|
if (![session.category isEqualToString:category] || session.categoryOptions != options) {
|
||||||
|
|||||||
Reference in new issue
Block a user