@ -26,6 +26,15 @@ const CallInFullScreenVisible = styled.div`
opacity : 1 ;
opacity : 1 ;
` ;
` ;
const StyledLocalVideoElement = styled . video < { isVideoMuted : boolean } > `
height : 20 % ;
width : 20 % ;
bottom : 0 ;
right : 0 ;
position : absolute ;
opacity : $ { props = > ( props . isVideoMuted ? 0 : 1 ) } ;
` ;
export const CallInFullScreenContainer = ( ) = > {
export const CallInFullScreenContainer = ( ) = > {
const dispatch = useDispatch ( ) ;
const dispatch = useDispatch ( ) ;
const ongoingCallWithFocused = useSelector ( getHasOngoingCallWithFocusedConvo ) ;
const ongoingCallWithFocused = useSelector ( getHasOngoingCallWithFocusedConvo ) ;
@ -34,6 +43,7 @@ export const CallInFullScreenContainer = () => {
const {
const {
remoteStream ,
remoteStream ,
remoteStreamVideoIsMuted ,
remoteStreamVideoIsMuted ,
localStream ,
currentConnectedAudioInputs ,
currentConnectedAudioInputs ,
currentConnectedAudioOutputs ,
currentConnectedAudioOutputs ,
currentConnectedCameras ,
currentConnectedCameras ,
@ -43,6 +53,7 @@ export const CallInFullScreenContainer = () => {
} = useVideoCallEventsListener ( 'CallInFullScreenContainer' , true ) ;
} = useVideoCallEventsListener ( 'CallInFullScreenContainer' , true ) ;
const videoRefRemote = React . useRef < HTMLVideoElement > ( null ) ;
const videoRefRemote = React . useRef < HTMLVideoElement > ( null ) ;
const videoRefLocal = React . useRef < HTMLVideoElement > ( null ) ;
function toggleFullScreenOFF() {
function toggleFullScreenOFF() {
dispatch ( setFullScreenCall ( false ) ) ;
dispatch ( setFullScreenCall ( false ) ) ;
@ -69,6 +80,12 @@ export const CallInFullScreenContainer = () => {
}
}
}
}
if ( videoRefLocal ? . current ) {
if ( videoRefLocal . current . srcObject !== localStream ) {
videoRefLocal . current . srcObject = localStream ;
}
}
return (
return (
< CallInFullScreenVisible onClick = { toggleFullScreenOFF } >
< CallInFullScreenVisible onClick = { toggleFullScreenOFF } >
< StyledVideoElement
< StyledVideoElement
@ -76,6 +93,11 @@ export const CallInFullScreenContainer = () => {
autoPlay = { true }
autoPlay = { true }
isVideoMuted = { remoteStreamVideoIsMuted }
isVideoMuted = { remoteStreamVideoIsMuted }
/ >
/ >
< StyledLocalVideoElement
ref = { videoRefLocal }
autoPlay = { true }
isVideoMuted = { localStreamVideoIsMuted }
/ >
< CallWindowControls
< CallWindowControls
currentConnectedAudioInputs = { currentConnectedAudioInputs }
currentConnectedAudioInputs = { currentConnectedAudioInputs }
currentConnectedAudioOutputs = { currentConnectedAudioOutputs }
currentConnectedAudioOutputs = { currentConnectedAudioOutputs }