Close broadcast on 'streamEnd'

This commit is contained in:
Ilshat Safiullin 2018-06-21 13:30:11 +05:00
parent 580ef5a652
commit d3f3668eb5
2 changed files with 8 additions and 0 deletions

View File

@ -172,6 +172,10 @@ io.on('connection', function(socket) {
} }
}); });
socket.on('closeBroadcast', function() {
socket.broadcast.emit('streamEnded');
});
socket.on('joinRoom', function (data) { socket.on('joinRoom', function (data) {
joinRoom(socket, data ? data.slice(0, 6) : data) joinRoom(socket, data ? data.slice(0, 6) : data)
}); });

View File

@ -74,6 +74,10 @@ $(function() {
viewer(); viewer();
} }
}); });
socket.on('streamEnded', function(data) {
dispose();
});
}); });
function presenterResponse(message) { function presenterResponse(message) {