Skip to content

Commit 187c365

Browse files
committed
Adding javascript constants for AudioSessionCategoryOption and AudioSessionMode.
1 parent 5fda5b0 commit 187c365

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

index.js

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,29 @@ const RNCallKeepModule = NativeModules.RNCallKeep;
66
const isIOS = Platform.OS === 'ios';
77
const supportConnectionService = !isIOS && Platform.Version >= 23;
88

9+
const AudioSessionCategoryOption = {
10+
mixWithOthers: 0x1,
11+
duckOthers: 0x2,
12+
interruptSpokenAudioAndMixWithOthers: 0x11,
13+
allowBluetooth: 0x4,
14+
allowBluetoothA2DP: 0x20,
15+
allowAirPlay: 0x40,
16+
defaultToSpeaker: 0x8,
17+
overrideMutedMicrophoneInterruption: 0x80,
18+
}
19+
20+
const AudioSessionMode = {
21+
default: 'AVAudioSessionModeDefault',
22+
gameChat: 'AVAudioSessionModeGameChat',
23+
measurement: 'AVAudioSessionModeMeasurement',
24+
moviePlayback: 'AVAudioSessionModeMoviePlayback',
25+
spokenAudio: 'AVAudioSessionModeSpokenAudio',
26+
videoChat: 'AVAudioSessionModeVideoChat',
27+
videoRecording: 'AVAudioSessionModeVideoRecording',
28+
voiceChat: 'AVAudioSessionModeVoiceChat',
29+
voicePrompt: 'AVAudioSessionModeVoicePrompt',
30+
}
31+
932
const CONSTANTS = {
1033
END_CALL_REASONS: {
1134
FAILED: 1,
@@ -17,7 +40,7 @@ const CONSTANTS = {
1740
},
1841
};
1942

20-
export { emit, CONSTANTS };
43+
export { emit, CONSTANTS, AudioSessionCategoryOption, AudioSessionMode };
2144

2245
class EventListener {
2346
constructor(type, listener, callkeep) {

0 commit comments

Comments
 (0)