This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import type { types } from 'mediasoup'
|
import type { types } from 'mediasoup'
|
||||||
|
import type { Transport } from 'mediasoup/types'
|
||||||
import type { Server as SocketServer } from 'socket.io'
|
import type { Server as SocketServer } from 'socket.io'
|
||||||
import type {
|
import type {
|
||||||
ChadClient,
|
ChadClient,
|
||||||
@@ -196,7 +197,13 @@ export default async function (io: SocketServer, router: types.Router) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const producer = await transport.produce({ kind, rtpParameters, appData: { ...appData, socketId: socket.id } })
|
const producer = await (transport as Transport).produce({ kind, rtpParameters, appData: { ...appData, socketId: socket.id } })
|
||||||
|
|
||||||
|
await producer.enableTraceEvent(['pli', 'keyframe'])
|
||||||
|
|
||||||
|
producer.on('trace', (trace) => {
|
||||||
|
console.log(trace.type, trace.info)
|
||||||
|
})
|
||||||
|
|
||||||
socket.data.producers.set(producer.id, producer)
|
socket.data.producers.set(producer.id, producer)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user