Fix video variable conflict

And also properly disable the suspend cam button if peer has no video
master
Daniel Berteaud 9 years ago
parent 5b0fc34888
commit c653ba4bc9
  1. 8
      public/js/vroom.js
  2. 2
      templates/default/join.html.ep

@ -993,7 +993,7 @@ function init_webrtc(room){
room: room, room: room,
}, },
function(data){ function(data){
if (!video){ if (!has_video){
data.config.media.video = false; data.config.media.video = false;
} }
data.config.localVideoEl = 'webRTCVideoLocal'; data.config.localVideoEl = 'webRTCVideoLocal';
@ -1250,7 +1250,7 @@ function initVroom(room) {
// color can be sent through the signaling channel // color can be sent through the signaling channel
peer.send('peer_color', {color: peers.local.color}); peer.send('peer_color', {color: peers.local.color});
// if we don't have a video, just signal it to this peer // 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 // We don't have chat history yet ? Lets ask to this new peer
if(!peers.local.hasHistory && chatIndex == 0){ if(!peers.local.hasHistory && chatIndex == 0){
peer.sendDirectly('vroom', 'chat_history_request', ''); peer.sendDirectly('vroom', 'chat_history_request', '');
@ -1570,7 +1570,7 @@ function initVroom(room) {
// This peer indicates he has no webcam // This peer indicates he has no webcam
if (!data.payload.video){ if (!data.payload.video){
$('#overlay_' + data.id).append($('<div>').attr('id', 'noWebcam_' + data.id).addClass('noWebcam')); $('#overlay_' + data.id).append($('<div>').attr('id', 'noWebcam_' + data.id).addClass('noWebcam'));
$('#actionPause_' + data.id).addClass('disabled'); $('#actionPause_' + data.id).prop('disabled', true);
peers[data.id].hasVideo = false; peers[data.id].hasVideo = false;
} }
}); });
@ -2037,7 +2037,7 @@ function initVroom(room) {
}); });
// Disable suspend webcam button if no webcam // Disable suspend webcam button if no webcam
if (!video){ if (!has_video){
$('.btn-suspend-cam').prop('disabled', true); $('.btn-suspend-cam').prop('disabled', true);
} }

@ -549,7 +549,7 @@
path: "<%= $ethuri->path . '/p/' %>", path: "<%= $ethuri->path . '/p/' %>",
group: "<%= $etherpadGroup %>" group: "<%= $etherpadGroup %>"
}; };
video = <%= ($video eq 'false') ? 'false' : 'true' %>; has_video = <%= ($video eq 'false') ? 'false' : 'true' %>;
initJoin(roomName); initJoin(roomName);
$('#connecting').modal('show'); $('#connecting').modal('show');
}); });

Loading…
Cancel
Save