WIP: router-close-connections #2
@ -208,24 +208,6 @@ const getRtpCapabilities = () => {
|
|||||||
|
|
||||||
const createSendTransport = () => {
|
const createSendTransport = () => {
|
||||||
|
|
||||||
setTimeout(() => {
|
|
||||||
const answer = {
|
|
||||||
origin_asset_id: ASSET_ID,
|
|
||||||
dest_asset_id: originAssetId || parseInt(urlParams.get('dest_asset_id')),
|
|
||||||
type: 'notify-answer',
|
|
||||||
origin_asset_priority: 1,
|
|
||||||
origin_asset_type_name: ASSET_TYPE,
|
|
||||||
origin_asset_name: ASSET_NAME,
|
|
||||||
video_call_id: callId,
|
|
||||||
answer: 'accepted', // answer: 'rejected'
|
|
||||||
};
|
|
||||||
console.log('SEND answer', answer);
|
|
||||||
hub.emit(
|
|
||||||
'video',
|
|
||||||
JSON.stringify(answer)
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
// see server's socket.on('createWebRtcTransport', sender?, ...)
|
// see server's socket.on('createWebRtcTransport', sender?, ...)
|
||||||
// this is a call from Producer, so sender = true
|
// this is a call from Producer, so sender = true
|
||||||
socket.emit('createWebRtcTransport', { sender: true, callId }, ({ params }) => {
|
socket.emit('createWebRtcTransport', { sender: true, callId }, ({ params }) => {
|
||||||
@ -287,13 +269,10 @@ const createSendTransport = () => {
|
|||||||
})
|
})
|
||||||
connectSendTransport()
|
connectSendTransport()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}, 7000);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const connectSendTransport = async () => {
|
const connectSendTransport = async () => {
|
||||||
|
setTimeout(() => {
|
||||||
console.log('[connectSendTransport]');
|
console.log('[connectSendTransport]');
|
||||||
// we now call produce() to instruct the producer transport
|
// we now call produce() to instruct the producer transport
|
||||||
// to send media to the Router
|
// to send media to the Router
|
||||||
@ -311,6 +290,10 @@ const connectSendTransport = async () => {
|
|||||||
// close video track
|
// close video track
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// Enable Close call button
|
||||||
|
const closeCallBtn = document.getElementById('btnCloseCall');
|
||||||
|
closeCallBtn.removeAttribute('disabled');
|
||||||
|
|
||||||
const answer = {
|
const answer = {
|
||||||
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')),
|
||||||
@ -322,17 +305,11 @@ const connectSendTransport = async () => {
|
|||||||
answer: 'accepted', // answer: 'rejected'
|
answer: 'accepted', // answer: 'rejected'
|
||||||
};
|
};
|
||||||
console.log('SEND answer', answer);
|
console.log('SEND answer', answer);
|
||||||
|
hub.emit(
|
||||||
// setTimeout(() => {
|
'video',
|
||||||
// hub.emit(
|
JSON.stringify(answer)
|
||||||
// 'video',
|
);
|
||||||
// JSON.stringify(answer)
|
}, 7000);
|
||||||
// );
|
|
||||||
// }, 7000);
|
|
||||||
|
|
||||||
// Enable Close call button
|
|
||||||
const closeCallBtn = document.getElementById('btnCloseCall');
|
|
||||||
closeCallBtn.removeAttribute('disabled');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const createRecvTransport = async () => {
|
const createRecvTransport = async () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user