From e140a12b6c1a63e091fa41b8212475ca866e14b2 Mon Sep 17 00:00:00 2001 From: Christopher Poile Date: Mon, 23 Jan 2023 09:39:09 -0500 Subject: [PATCH] MM-46999 - Calls: Start call in speaker mode (#6979) --- app/products/calls/actions/calls.test.ts | 1 + app/products/calls/actions/calls.ts | 2 +- app/products/calls/connection/connection.ts | 5 +++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/products/calls/actions/calls.test.ts b/app/products/calls/actions/calls.test.ts index 672787e82..bf9437d74 100644 --- a/app/products/calls/actions/calls.test.ts +++ b/app/products/calls/actions/calls.test.ts @@ -100,6 +100,7 @@ const addFakeCall = (serverUrl: string, channelId: string) => { describe('Actions.Calls', () => { const {newConnection} = require('@calls/connection/connection'); InCallManager.setSpeakerphoneOn = jest.fn(); + InCallManager.setForceSpeakerphoneOn = jest.fn(); // eslint-disable-next-line // @ts-ignore NetworkManager.getClient = () => mockClient; diff --git a/app/products/calls/actions/calls.ts b/app/products/calls/actions/calls.ts index c363eabef..10b083ce7 100644 --- a/app/products/calls/actions/calls.ts +++ b/app/products/calls/actions/calls.ts @@ -307,7 +307,7 @@ export const sendReaction = (emoji: CallReactionEmoji) => { }; export const setSpeakerphoneOn = (speakerphoneOn: boolean) => { - InCallManager.setSpeakerphoneOn(speakerphoneOn); + InCallManager.setForceSpeakerphoneOn(speakerphoneOn); setSpeakerPhone(speakerphoneOn); }; diff --git a/app/products/calls/connection/connection.ts b/app/products/calls/connection/connection.ts index e6bb5de32..36d308b3e 100644 --- a/app/products/calls/connection/connection.ts +++ b/app/products/calls/connection/connection.ts @@ -12,6 +12,7 @@ import { mediaDevices, } from 'react-native-webrtc'; +import {setSpeakerPhone} from '@calls/state'; import {getICEServersConfigs} from '@calls/utils'; import {WebsocketEvents} from '@constants'; import {getServerCredentials} from '@init/credentials'; @@ -203,8 +204,8 @@ export async function newConnection( } } - InCallManager.start({media: 'audio'}); - InCallManager.stopProximitySensor(); + InCallManager.start({media: 'video'}); + setSpeakerPhone(true); peer = new Peer(null, iceConfigs); peer.on('signal', (data: any) => {