From c653ba4bc9b39305b051772a660f089196d439a0 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Fri, 7 Aug 2015 09:23:47 +0200 Subject: [PATCH] Fix video variable conflict And also properly disable the suspend cam button if peer has no video --- public/js/vroom.js | 8 ++++---- templates/default/join.html.ep | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/public/js/vroom.js b/public/js/vroom.js index a1dbf90..ba13a9d 100644 --- a/public/js/vroom.js +++ b/public/js/vroom.js @@ -993,7 +993,7 @@ function init_webrtc(room){ room: room, }, function(data){ - if (!video){ + if (!has_video){ data.config.media.video = false; } data.config.localVideoEl = 'webRTCVideoLocal'; @@ -1250,7 +1250,7 @@ function initVroom(room) { // color can be sent through the signaling channel peer.send('peer_color', {color: peers.local.color}); // if we don't have a video, just signal it to this peer - peer.send('media_info', {video: !!video}); + peer.send('media_info', {video: has_video}); // We don't have chat history yet ? Lets ask to this new peer if(!peers.local.hasHistory && chatIndex == 0){ peer.sendDirectly('vroom', 'chat_history_request', ''); @@ -1570,7 +1570,7 @@ function initVroom(room) { // This peer indicates he has no webcam if (!data.payload.video){ $('#overlay_' + data.id).append($('
').attr('id', 'noWebcam_' + data.id).addClass('noWebcam')); - $('#actionPause_' + data.id).addClass('disabled'); + $('#actionPause_' + data.id).prop('disabled', true); peers[data.id].hasVideo = false; } }); @@ -2037,7 +2037,7 @@ function initVroom(room) { }); // Disable suspend webcam button if no webcam - if (!video){ + if (!has_video){ $('.btn-suspend-cam').prop('disabled', true); } diff --git a/templates/default/join.html.ep b/templates/default/join.html.ep index 9c023b6..36ae25e 100644 --- a/templates/default/join.html.ep +++ b/templates/default/join.html.ep @@ -549,7 +549,7 @@ path: "<%= $ethuri->path . '/p/' %>", group: "<%= $etherpadGroup %>" }; - video = <%= ($video eq 'false') ? 'false' : 'true' %>; + has_video = <%= ($video eq 'false') ? 'false' : 'true' %>; initJoin(roomName); $('#connecting').modal('show'); });