This commit is contained in:
@@ -48,6 +48,13 @@ createWorker();
|
||||
io.on("connection", (socket) => {
|
||||
console.log("Client connected:", socket.id);
|
||||
|
||||
socket.emit('producers', producers.values().map(producer => {
|
||||
return {
|
||||
producerId: producer.id,
|
||||
kind: producer.kind,
|
||||
}
|
||||
}))
|
||||
|
||||
socket.on("getRtpCapabilities", (cb) => {
|
||||
cb(router.rtpCapabilities);
|
||||
});
|
||||
@@ -103,7 +110,7 @@ io.on("connection", (socket) => {
|
||||
producers.set(socket.id, [...(producers.get(socket.id) || []), producer]);
|
||||
|
||||
cb({ id: producer.id });
|
||||
socket.broadcast.emit("newProducer", { producerId: producer.id });
|
||||
socket.broadcast.emit("newProducer", { producerId: producer.id, kind: producer.kind });
|
||||
|
||||
producer.observer.on("close", () => {
|
||||
console.log("producer closed", producer.id);
|
||||
|
||||
Reference in New Issue
Block a user