From d3f3668eb53d369de97ae02b73951832808e1228 Mon Sep 17 00:00:00 2001 From: Ilshat Safiullin Date: Thu, 21 Jun 2018 13:30:11 +0500 Subject: [PATCH] Close broadcast on 'streamEnd' --- server.js | 4 ++++ static/js/index.js | 4 ++++ 2 files changed, 8 insertions(+) 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) {