implemented remote streames logic
Signed-off-by: heyhiru <hirentimbadiya74@gmail.com>
Este commit está contenido en:
@@ -1,4 +1,4 @@
|
||||
const { Server} = require('socket.io');
|
||||
const { Server } = require('socket.io');
|
||||
|
||||
const io = new Server(8080, {
|
||||
cors: true
|
||||
@@ -22,5 +22,22 @@ io.on("connection", (socket) => {
|
||||
// emits a 'room:joined' event back to the client
|
||||
// that just joined the room.
|
||||
io.to(socket.id).emit("room:join", data);
|
||||
})
|
||||
});
|
||||
|
||||
socket.on("user:call", ({ to, offer }) => {
|
||||
io.to(to).emit("incoming:call", { from: socket.id, offer });
|
||||
});
|
||||
|
||||
socket.on("call:accepted", ({ to, ans }) => {
|
||||
io.to(to).emit("call:accepted", { from: socket.id, ans });
|
||||
});
|
||||
|
||||
socket.on("peer:nego:needed", ({ to, offer }) => {
|
||||
io.to(to).emit("peer:nego:needed", { from: socket.id, offer });
|
||||
});
|
||||
|
||||
socket.on("peer:nego:done", ({ to, ans }) => {
|
||||
io.to(to).emit("peer:nego:final", { from: socket.id, ans });
|
||||
});
|
||||
|
||||
})
|
||||
Referencia en una nueva incidencia
Block a user