|
|
@ -269,6 +269,18 @@ function initVroom(room) { |
|
|
|
$('#noWebrtcSupport').modal('show'); |
|
|
|
$('#noWebrtcSupport').modal('show'); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Return the number of peers in the room
|
|
|
|
|
|
|
|
function countPeers(){ |
|
|
|
|
|
|
|
var count = Object.keys(peers).length; |
|
|
|
|
|
|
|
// Do not count ourself
|
|
|
|
|
|
|
|
count--; |
|
|
|
|
|
|
|
// and do not count our local screen
|
|
|
|
|
|
|
|
if (peers.local.screenShared){ |
|
|
|
|
|
|
|
count--; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return count; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Get our role and other room settings from the server
|
|
|
|
// Get our role and other room settings from the server
|
|
|
|
function getRoomInfo(){ |
|
|
|
function getRoomInfo(){ |
|
|
|
$.ajax({ |
|
|
|
$.ajax({ |
|
|
@ -291,7 +303,10 @@ function initVroom(room) { |
|
|
|
// Enable owner reserved menu
|
|
|
|
// Enable owner reserved menu
|
|
|
|
if (data.role == 'owner'){ |
|
|
|
if (data.role == 'owner'){ |
|
|
|
$('.unauthEl').hide(500); |
|
|
|
$('.unauthEl').hide(500); |
|
|
|
$('.ownerEl').show(500); |
|
|
|
$('.ownerEl').not('.threePeersEl').show(500); |
|
|
|
|
|
|
|
if (countPeers() > 1){ |
|
|
|
|
|
|
|
('.threePeersEl').show(500); |
|
|
|
|
|
|
|
} |
|
|
|
var notif = JSON.parse(data.notif); |
|
|
|
var notif = JSON.parse(data.notif); |
|
|
|
$.each(notif.email, function(index, val){ |
|
|
|
$.each(notif.email, function(index, val){ |
|
|
|
addNotifiedEmail(val); |
|
|
|
addNotifiedEmail(val); |
|
|
@ -517,6 +532,14 @@ function initVroom(room) { |
|
|
|
// Stop moh, we're not alone anymore
|
|
|
|
// Stop moh, we're not alone anymore
|
|
|
|
$('#mohPlayer')[0].pause(); |
|
|
|
$('#mohPlayer')[0].pause(); |
|
|
|
$('.aloneEl').hide(300); |
|
|
|
$('.aloneEl').hide(300); |
|
|
|
|
|
|
|
if (countPeers() > 1){ |
|
|
|
|
|
|
|
if (peers.local.role == 'owner'){ |
|
|
|
|
|
|
|
$('.threePeersEl').show(500); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else{ |
|
|
|
|
|
|
|
$('.threePeersEl').not('.ownerEl').show(500); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
$(div).attr('id', 'peer_' + id); |
|
|
|
$(div).attr('id', 'peer_' + id); |
|
|
|
// Disable context menu on the video
|
|
|
|
// Disable context menu on the video
|
|
|
@ -686,7 +709,7 @@ function initVroom(room) { |
|
|
|
// Check if MoH is needed
|
|
|
|
// Check if MoH is needed
|
|
|
|
function checkMoh(){ |
|
|
|
function checkMoh(){ |
|
|
|
setTimeout(function(){ |
|
|
|
setTimeout(function(){ |
|
|
|
if (Object.keys(peers).length < 2){ |
|
|
|
if (countPeers() < 1){ |
|
|
|
if ($('#pauseMohButton').is(':checked')){ |
|
|
|
if ($('#pauseMohButton').is(':checked')){ |
|
|
|
$('#mohPlayer').get(0).volume = .25; |
|
|
|
$('#mohPlayer').get(0).volume = .25; |
|
|
|
$('#mohPlayer').get(0).play(); |
|
|
|
$('#mohPlayer').get(0).play(); |
|
|
|