Skip to content

Commit 95bce57

Browse files
author
Shane
committed
Update AudioPlayer.m
Fix mixWithOthers setting for iOS
1 parent 96197e3 commit 95bce57

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ios/ReactNativeAudioToolkit/ReactNativeAudioToolkit/AudioPlayer.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ - (NSURL *)findUrlForPath:(NSString *)path {
139139
}
140140
NSNumber *mixWithOthers = [options objectForKey:@"mixWithOthers"];
141141
NSError *error = nil;
142-
[[AVAudioSession sharedInstance] setCategory: avAudioSessionCategory withOptions: mixWithOthers ? AVAudioSessionCategoryOptionMixWithOthers : 0 error: &error];
142+
[[AVAudioSession sharedInstance] setCategory: avAudioSessionCategory withOptions: mixWithOthers.intValue > 0 ? AVAudioSessionCategoryOptionMixWithOthers : 0 error: &error];
143143
if (error) {
144144
NSDictionary* dict = [Helpers errObjWithCode:@"preparefail"
145145
withMessage:@"Failed to set audio session category."];

0 commit comments

Comments
 (0)