diff --git a/mods/frontoffice/src/components/chat/video/Video.tsx b/mods/frontoffice/src/components/chat/video/Video.tsx index aceb06e..5d28e06 100644 --- a/mods/frontoffice/src/components/chat/video/Video.tsx +++ b/mods/frontoffice/src/components/chat/video/Video.tsx @@ -94,9 +94,6 @@ export const FOVideo = forwardRef((props: FOVideoProps, ref) => { - {props.isLocalCameraMuted && ( @@ -104,7 +101,11 @@ export const FOVideo = forwardRef((props: FOVideoProps, ref) => { )} - + props.onMuteMicrophone()}> diff --git a/mods/frontoffice/src/containers/ChatContainer.tsx b/mods/frontoffice/src/containers/ChatContainer.tsx index c8e1988..a120158 100644 --- a/mods/frontoffice/src/containers/ChatContainer.tsx +++ b/mods/frontoffice/src/containers/ChatContainer.tsx @@ -187,8 +187,6 @@ function ChatContainer() { }; const onCustomerDequeue = async () => { - // TODO: If peer exist and is connected, hangup - const queues = new SDK.Queues(client); queues.updateQueueEntryStatus({ workspaceId, @@ -200,7 +198,12 @@ function ChatContainer() { }; const handleHangup = async () => { - // TODO: If peer exist and is connected, hangup + // Release media resources + if (localStream) { + localStream.getTracks().forEach((track) => track.stop()); + } + + // TODO: remotePeer.close(); }; const handleMuteCamera = async () => { @@ -219,7 +222,7 @@ function ChatContainer() { if (peer) { setIsLocalMicrophoneMuted(!isLocalMicrophoneMuted); localStream!.getAudioTracks().forEach((track) => { - track.enabled = true; + track.enabled = !track.enabled; }); } }; diff --git a/mods/widget/src/GoodtokUA.tsx b/mods/widget/src/GoodtokUA.tsx index 5ec2c1e..edef2b2 100644 --- a/mods/widget/src/GoodtokUA.tsx +++ b/mods/widget/src/GoodtokUA.tsx @@ -91,7 +91,7 @@ const GoodtokUA = () => { }); peer.on("call", (mediaConnection: MediaConnection) => { - mediaConnection.answer(localStream); + mediaConnection.answer(stream); mediaConnection.on("stream", (stream) => { remoteVideo.srcObject = stream; @@ -243,6 +243,8 @@ const GoodtokUA = () => { localStream.getTracks().forEach((track) => track.stop()); } + // TODO: remotePeer.close(); + // TODO: If is connected, unregister, disconnect and hangup break; } diff --git a/mods/widget/src/components/video/MobileVideo.tsx b/mods/widget/src/components/video/MobileVideo.tsx index 198e99e..846745b 100644 --- a/mods/widget/src/components/video/MobileVideo.tsx +++ b/mods/widget/src/components/video/MobileVideo.tsx @@ -99,9 +99,6 @@ export const MobileVideo = forwardRef((props: VideoProps, ref) => { return ( - {isCustomerCameraMuted && ( @@ -109,7 +106,11 @@ export const MobileVideo = forwardRef((props: VideoProps, ref) => { )} - + { - {isCustomerCameraMuted && ( @@ -137,7 +134,11 @@ export const Video = forwardRef((props: VideoProps, ref) => { )} - +