Compare commits
3 Commits
004c0f66a7
...
d67debc70b
Author | SHA1 | Date | |
---|---|---|---|
d67debc70b | |||
b64c49c1cd | |||
383e34bf22 |
21
app.js
21
app.js
@ -109,6 +109,7 @@ peers.on('connection', async socket => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
socket.on('createRoom', async ({ callId }, callback) => {
|
socket.on('createRoom', async ({ callId }, callback) => {
|
||||||
|
console.log('[createRoom] callId', callId);
|
||||||
console.log('Router length:', Object.keys(router).length);
|
console.log('Router length:', Object.keys(router).length);
|
||||||
if (router[callId] === undefined) {
|
if (router[callId] === undefined) {
|
||||||
// worker.createRouter(options)
|
// worker.createRouter(options)
|
||||||
@ -252,8 +253,8 @@ const createWebRtcTransportLayer = async (callId, callback) => {
|
|||||||
preferUdp: true,
|
preferUdp: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('webRtcTransport_options', webRtcTransport_options);
|
// console.log('webRtcTransport_options', webRtcTransport_options);
|
||||||
console.log('router', router, '| router[callId]', router[callId]);
|
// console.log('router', router, '| router[callId]', router[callId]);
|
||||||
|
|
||||||
// https://mediasoup.org/documentation/v3/mediasoup/api/#router-createWebRtcTransport
|
// https://mediasoup.org/documentation/v3/mediasoup/api/#router-createWebRtcTransport
|
||||||
let transport = await router[callId].createWebRtcTransport(webRtcTransport_options)
|
let transport = await router[callId].createWebRtcTransport(webRtcTransport_options)
|
||||||
@ -269,15 +270,19 @@ const createWebRtcTransportLayer = async (callId, callback) => {
|
|||||||
console.log('transport closed')
|
console.log('transport closed')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const params = {
|
||||||
|
id: transport.id,
|
||||||
|
iceParameters: transport.iceParameters,
|
||||||
|
iceCandidates: transport.iceCandidates,
|
||||||
|
dtlsParameters: transport.dtlsParameters,
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log('params', params);
|
||||||
|
|
||||||
// send back to the client the following prameters
|
// send back to the client the following prameters
|
||||||
callback({
|
callback({
|
||||||
// https://mediasoup.org/documentation/v3/mediasoup-client/api/#TransportOptions
|
// https://mediasoup.org/documentation/v3/mediasoup-client/api/#TransportOptions
|
||||||
params: {
|
params
|
||||||
id: transport.id,
|
|
||||||
iceParameters: transport.iceParameters,
|
|
||||||
iceCandidates: transport.iceCandidates,
|
|
||||||
dtlsParameters: transport.dtlsParameters,
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
return transport
|
return transport
|
||||||
|
Loading…
x
Reference in New Issue
Block a user