MM-46999 - Calls: Start call in speaker mode (#6979)

This commit is contained in:
Christopher Poile
2023-01-23 09:39:09 -05:00
committed by GitHub
parent 6c9c025d25
commit e140a12b6c
3 changed files with 5 additions and 3 deletions

View File

@@ -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;

View File

@@ -307,7 +307,7 @@ export const sendReaction = (emoji: CallReactionEmoji) => {
};
export const setSpeakerphoneOn = (speakerphoneOn: boolean) => {
InCallManager.setSpeakerphoneOn(speakerphoneOn);
InCallManager.setForceSpeakerphoneOn(speakerphoneOn);
setSpeakerPhone(speakerphoneOn);
};

View File

@@ -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) => {