fix flickering of video stream on mute/unmute

pull/2015/head
Audric Ackermann 3 years ago
parent 8468598b3a
commit dd25d9cb7f
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -97,13 +97,17 @@ export const DraggableCallContainer = () => {
}, [positionX, positionY]); }, [positionX, positionY]);
if (videoRefRemote?.current?.srcObject && remoteStream) { if (videoRefRemote?.current?.srcObject && remoteStream) {
videoRefRemote.current.srcObject = remoteStream; if (videoRefRemote.current.srcObject !== remoteStream) {
videoRefRemote.current.srcObject = remoteStream;
}
videoRefRemote.current.load(); videoRefRemote.current.load();
} }
useEffect(() => { useEffect(() => {
if (videoRefRemote?.current) { if (videoRefRemote?.current) {
videoRefRemote.current.srcObject = remoteStream; if (videoRefRemote?.current?.srcObject && remoteStream) {
videoRefRemote.current.srcObject = remoteStream;
}
videoRefRemote.current.load(); videoRefRemote.current.load();
} }

@ -272,8 +272,12 @@ export const InConversationCallContainer = () => {
} = useVideoCallEventsListener('InConversationCallContainer', true); } = useVideoCallEventsListener('InConversationCallContainer', true);
if (videoRefRemote?.current && videoRefLocal?.current) { if (videoRefRemote?.current && videoRefLocal?.current) {
videoRefRemote.current.srcObject = remoteStream; if (videoRefRemote.current.srcObject !== remoteStream) {
videoRefLocal.current.srcObject = localStream; videoRefRemote.current.srcObject = remoteStream;
}
if (videoRefLocal.current.srcObject !== localStream) {
videoRefLocal.current.srcObject = localStream;
}
} }
if (!ongoingCallWithFocused) { if (!ongoingCallWithFocused) {

@ -10,6 +10,7 @@ import {
callConnected, callConnected,
endCall, endCall,
incomingCall, incomingCall,
openConversationWithMessages,
setFullScreenCall, setFullScreenCall,
startingCallWith, startingCallWith,
} from '../../state/ducks/conversations'; } from '../../state/ducks/conversations';
@ -611,7 +612,7 @@ export async function USER_acceptIncomingCallRequest(fromSender: string) {
return; return;
} }
window.inboxStore?.dispatch(answerCall({ pubkey: fromSender })); window.inboxStore?.dispatch(answerCall({ pubkey: fromSender }));
await openConversationWithMessages({ conversationKey: fromSender });
if (peerConnection) { if (peerConnection) {
throw new Error('USER_acceptIncomingCallRequest: peerConnection is already set.'); throw new Error('USER_acceptIncomingCallRequest: peerConnection is already set.');
} }

Loading…
Cancel
Save