@cometchat/calls-sdk-react-native 5.0.0 → 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.
@@ -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
  }