Refactor transportclose 8

This commit is contained in:
Sergiu Toma 2022-08-11 13:17:44 +03:00
parent ac5d5d7fd0
commit 3f3048e54f
1 changed files with 16 additions and 18 deletions

View File

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