Compare commits
2 Commits
65b5b563ff
...
3f3048e54f
Author | SHA1 | Date | |
---|---|---|---|
3f3048e54f | |||
ac5d5d7fd0 |
17
app.js
17
app.js
@ -156,14 +156,9 @@ peers.on('connection', async socket => {
|
|||||||
|
|
||||||
console.log(`[transport-produce] Producer ID: ${producer.id} | kind: ${producer.kind}`)
|
console.log(`[transport-produce] Producer ID: ${producer.id} | kind: ${producer.kind}`)
|
||||||
|
|
||||||
producer.on('transportclose', ({ callId }) => {
|
|
||||||
console.log('transport for this producer closed', callId)
|
|
||||||
closeRoom(callId);
|
|
||||||
})
|
|
||||||
|
|
||||||
producer.on('transportclose', () => {
|
producer.on('transportclose', () => {
|
||||||
console.log('transport2 for this producer closed', callId)
|
console.log('transport for this producer closed ')
|
||||||
closeRoom(callId);
|
producer.close()
|
||||||
})
|
})
|
||||||
|
|
||||||
// Send back to the client the Producer's id
|
// Send back to the client the Producer's id
|
||||||
@ -192,14 +187,8 @@ peers.on('connection', async socket => {
|
|||||||
paused: true,
|
paused: true,
|
||||||
})
|
})
|
||||||
|
|
||||||
consumer.on('transportclose', ({ callId }) => {
|
|
||||||
console.log('transport close from consumer', callId)
|
|
||||||
closeRoom(callId);
|
|
||||||
})
|
|
||||||
|
|
||||||
consumer.on('transportclose', () => {
|
consumer.on('transportclose', () => {
|
||||||
console.log('transport2 close from consumer', callId)
|
console.log('transport close from consumer')
|
||||||
closeRoom(callId);
|
|
||||||
})
|
})
|
||||||
|
|
||||||
consumer.on('producerclose', () => {
|
consumer.on('producerclose', () => {
|
||||||
|
@ -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