Refactor transportclose 8
This commit is contained in:
parent
ac5d5d7fd0
commit
3f3048e54f
@ -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
|
||||
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))
|
||||
|
||||
// Disable Close call button
|
||||
const closeCallBtn = document.getElementById('btnCloseCall')
|
||||
closeCallBtn.setAttribute('disabled', '')
|
||||
|
||||
// Reset settings
|
||||
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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user