diff --git a/public/index.js b/public/index.js index 26d8cc8..affb71b 100644 --- a/public/index.js +++ b/public/index.js @@ -350,8 +350,6 @@ const createRecvTransport = async () => { } const resetCallSettings = () => { - console.log('resetCallSettings', callId, 'socket |', socket); - socket.emit('transportclose') localVideo.srcObject = null remoteVideo.srcObject = null consumer = null @@ -398,24 +396,24 @@ const connectRecvTransport = async () => { } const closeCall = () => { - console.log('closeCall', callId); - // socket.emit('transportclose') - // Reset settings and send closeTransport to video server - resetCallSettings() + console.log('closeCall'); - // // Emit 'notify-end' to Hub so the consumer will know to close the video - // const notifyEnd = { - // origin_asset_id: ASSET_ID, - // dest_asset_id: originAssetId || parseInt(urlParams.get('dest_asset_id')), - // type: 'notify-end', - // video_call_id: callId - // } - // console.log('notifyEnd', notifyEnd) - // hub.emit('video', JSON.stringify(notifyEnd)) + // Emit 'notify-end' to Hub so the consumer will know to close the video + const notifyEnd = { + origin_asset_id: ASSET_ID, + dest_asset_id: originAssetId || parseInt(urlParams.get('dest_asset_id')), + type: 'notify-end', + video_call_id: callId + } + console.log('notifyEnd', notifyEnd) + hub.emit('video', JSON.stringify(notifyEnd)) - // // Disable Close call button - // const closeCallBtn = document.getElementById('btnCloseCall') - // closeCallBtn.setAttribute('disabled', '') + // Disable Close call button + const closeCallBtn = document.getElementById('btnCloseCall') + closeCallBtn.setAttribute('disabled', '') + + // Reset settings + resetCallSettings() } btnLocalVideo.addEventListener('click', getLocalStream)