Refactor transportclose 8
This commit is contained in:
parent
ac5d5d7fd0
commit
3f3048e54f
@ -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
|
// 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', '')
|
||||||
|
|
||||||
|
// Reset settings
|
||||||
resetCallSettings()
|
resetCallSettings()
|
||||||
|
|
||||||
// // 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', '')
|
|
||||||
}
|
}
|
||||||
|
|
||||||
btnLocalVideo.addEventListener('click', getLocalStream)
|
btnLocalVideo.addEventListener('click', getLocalStream)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user