diff --git a/server.js b/server.js index ab655ab..25741cf 100755 --- a/server.js +++ b/server.js @@ -172,6 +172,10 @@ io.on('connection', function(socket) { } }); + socket.on('closeBroadcast', function() { + socket.broadcast.emit('streamEnded'); + }); + socket.on('joinRoom', function (data) { joinRoom(socket, data ? data.slice(0, 6) : data) }); diff --git a/static/js/index.js b/static/js/index.js index 991c45e..b0cc687 100755 --- a/static/js/index.js +++ b/static/js/index.js @@ -74,6 +74,10 @@ $(function() { viewer(); } }); + + socket.on('streamEnded', function(data) { + dispose(); + }); }); function presenterResponse(message) {