@cometchat/calls-sdk-react-native 5.0.1 → 5.0.2-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/src/main/java/com/callingv5/AudioModeModule.java +3 -0
- package/dist/index.d.mts +545 -21
- package/dist/index.d.ts +536 -12
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/ios/Audio/CometChatAudioSession.h +28 -0
- package/ios/Audio/CometChatAudioSession.m +27 -2
- package/ios/Modules/AudioMode.m +13 -2
- package/package.json +1 -1
|
@@ -364,6 +364,7 @@ class AudioModeModule extends ReactContextBaseJavaModule {
|
|
|
364
364
|
|
|
365
365
|
boolean bluetoothAvailable = availableDevices.contains(DEVICE_BLUETOOTH);
|
|
366
366
|
boolean headsetAvailable = availableDevices.contains(DEVICE_HEADPHONES);
|
|
367
|
+
boolean earpieceAvailable = availableDevices.contains(DEVICE_EARPIECE);
|
|
367
368
|
|
|
368
369
|
// Pick the desired device based on what's available and the mode.
|
|
369
370
|
String audioDevice;
|
|
@@ -371,6 +372,8 @@ class AudioModeModule extends ReactContextBaseJavaModule {
|
|
|
371
372
|
audioDevice = DEVICE_BLUETOOTH;
|
|
372
373
|
} else if (headsetAvailable) {
|
|
373
374
|
audioDevice = DEVICE_HEADPHONES;
|
|
375
|
+
} else if (mode == AUDIO_CALL && earpieceAvailable) {
|
|
376
|
+
audioDevice = DEVICE_EARPIECE;
|
|
374
377
|
} else {
|
|
375
378
|
audioDevice = DEVICE_SPEAKER;
|
|
376
379
|
}
|