Skip to content

Commit

Permalink
fix(tvos): category DefaultToSpeaker / AllowBluetooth not available
Browse files Browse the repository at this point in the history
  • Loading branch information
jhen0409 committed Oct 2, 2023
1 parent 4341a08 commit a66e51a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ios/RNWhisperAudioSessionUtils.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#import "RNWhisperAudioSessionUtils.h"

#if defined(TARGET_OS_TV) && TARGET_OS_TV == 1
#define APPLE_TV
#endif

@implementation RNWhisperAudioSessionUtils

static NSDictionary *_categories;
Expand All @@ -19,10 +23,12 @@ + (void)initialize {
@"MixWithOthers": @(AVAudioSessionCategoryOptionMixWithOthers),
@"DuckOthers": @(AVAudioSessionCategoryOptionDuckOthers),
@"InterruptSpokenAudioAndMixWithOthers": @(AVAudioSessionCategoryOptionInterruptSpokenAudioAndMixWithOthers),
@"AllowBluetooth": @(AVAudioSessionCategoryOptionAllowBluetooth),
@"AllowBluetoothA2DP": @(AVAudioSessionCategoryOptionAllowBluetoothA2DP),
@"AllowAirPlay": @(AVAudioSessionCategoryOptionAllowAirPlay),
#if !defined(APPLE_TV)
@"AllowBluetooth": @(AVAudioSessionCategoryOptionAllowBluetooth),
@"DefaultToSpeaker": @(AVAudioSessionCategoryOptionDefaultToSpeaker)
#endif
};
_modes = @{
@"Default": AVAudioSessionModeDefault,
Expand Down

0 comments on commit a66e51a

Please sign in to comment.