Fix video variable conflict

And also properly disable the suspend cam button if peer has no video
This commit is contained in:
Daniel Berteaud 2015-08-07 09:23:47 +02:00
parent 5b0fc34888
commit c653ba4bc9
2 changed files with 5 additions and 5 deletions

View File

@ -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($('<div>').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);
}

View File

@ -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');
});