mirror of
https://github.com/balzack/databag.git
synced 2025-04-23 01:55:17 +00:00
forcing speakerphone on video calls
This commit is contained in:
parent
69a19cf8fe
commit
ff3795421d
@ -1672,6 +1672,8 @@ PODS:
|
||||
- React-logger (= 0.75.4)
|
||||
- React-perflogger (= 0.75.4)
|
||||
- React-utils (= 0.75.4)
|
||||
- ReactNativeIncallManager (4.2.0):
|
||||
- React-Core
|
||||
- rn-fetch-blob (0.12.0):
|
||||
- React-Core
|
||||
- RNCClipboard (1.16.1):
|
||||
@ -1937,6 +1939,7 @@ DEPENDENCIES:
|
||||
- React-utils (from `../node_modules/react-native/ReactCommon/react/utils`)
|
||||
- ReactCodegen (from `build/generated/ios`)
|
||||
- ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`)
|
||||
- ReactNativeIncallManager (from `../node_modules/react-native-incall-manager`)
|
||||
- rn-fetch-blob (from `../node_modules/rn-fetch-blob`)
|
||||
- "RNCClipboard (from `../node_modules/@react-native-clipboard/clipboard`)"
|
||||
- RNFastImage (from `../node_modules/react-native-fast-image`)
|
||||
@ -2116,6 +2119,8 @@ EXTERNAL SOURCES:
|
||||
:path: build/generated/ios
|
||||
ReactCommon:
|
||||
:path: "../node_modules/react-native/ReactCommon"
|
||||
ReactNativeIncallManager:
|
||||
:path: "../node_modules/react-native-incall-manager"
|
||||
rn-fetch-blob:
|
||||
:path: "../node_modules/rn-fetch-blob"
|
||||
RNCClipboard:
|
||||
@ -2228,6 +2233,7 @@ SPEC CHECKSUMS:
|
||||
React-utils: d1bae5ac6a5fb94a772ebfc7a7e1aba3a6706a3a
|
||||
ReactCodegen: 99b435b58bd874bb0626b3fb16437d2e8735d370
|
||||
ReactCommon: 1007c09a406a451ddbd874e51511aa541d6034f6
|
||||
ReactNativeIncallManager: bfc9c67358cd524882a7c4116dcb311ac2293d4b
|
||||
rn-fetch-blob: f065bb7ab7fb48dd002629f8bdcb0336602d3cba
|
||||
RNCClipboard: d7a8903d32692b0a1e71738c3825465a9acae10e
|
||||
RNFastImage: 5c9c9fed9c076e521b3f509fe79e790418a544e8
|
||||
@ -2244,7 +2250,7 @@ SPEC CHECKSUMS:
|
||||
SDWebImageWebPCoder: 908b83b6adda48effe7667cd2b7f78c897e5111d
|
||||
SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d
|
||||
TOCropViewController: 80b8985ad794298fb69d3341de183f33d1853654
|
||||
Yoga: a9ef4f5c2cd79ad812110525ef61048be6a582a4
|
||||
Yoga: b05994d1933f507b0a28ceaa4fdb968dc18da178
|
||||
|
||||
PODFILE CHECKSUM: 9cf7373afef7b881c911fda82ff1f94eacee3e98
|
||||
|
||||
|
@ -38,6 +38,7 @@
|
||||
"react-native-fs": "^2.20.0",
|
||||
"react-native-gesture-handler": "^2.19.0",
|
||||
"react-native-image-crop-picker": "^0.41.2",
|
||||
"react-native-incall-manager": "^4.2.0",
|
||||
"react-native-keyboard-aware-scroll-view": "^0.9.5",
|
||||
"react-native-linear-gradient": "^2.8.3",
|
||||
"react-native-paper": "^5.12.5",
|
||||
|
@ -3,6 +3,7 @@ import { DisplayContext } from '../context/DisplayContext';
|
||||
import { AppContext } from '../context/AppContext'
|
||||
import { ContextType } from '../context/ContextType'
|
||||
import { Link, type Card } from 'databag-client-sdk';
|
||||
import InCallManager from 'react-native-incall-manager';
|
||||
|
||||
import {
|
||||
ScreenCapturePickerView,
|
||||
@ -90,6 +91,7 @@ export function useCalling() {
|
||||
if (video) {
|
||||
video.enabled = false;
|
||||
}
|
||||
InCallManager.start({media: 'audio'});
|
||||
updateState({ audio, video, audioAdded: true, audioEnabled: true, videoAdded: false, videoEnabled: false });
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
@ -183,15 +185,20 @@ export function useCalling() {
|
||||
} else if (type === 'remote_track') {
|
||||
remoteStream.current.addTrack(data, remoteStream.current);
|
||||
if (data.kind === 'video') {
|
||||
InCallManager.setForceSpeakerphoneOn(true);
|
||||
updateState({ remote: remoteStream.current });
|
||||
}
|
||||
} else if (type === 'local_track') {
|
||||
await peerTrack(data);
|
||||
if (data.kind === 'video') {
|
||||
InCallManager.setForceSpeakerphoneOn(true);
|
||||
}
|
||||
} else if (type === 'close' && call.current) {
|
||||
peerUpdate.current = [];
|
||||
const { peer, link } = call.current;
|
||||
call.current = null;
|
||||
try {
|
||||
InCallManager.stop();
|
||||
peer.close();
|
||||
link.close();
|
||||
} catch (err) {
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user