|
|
|
@ -603,8 +603,11 @@ function initVroom(room) { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Mute a peer
|
|
|
|
|
function mutePeer(id){ |
|
|
|
|
function mutePeer(id,globalAction){ |
|
|
|
|
if (peers[id] && peers[id].role != 'owner'){ |
|
|
|
|
if (!globalAction || |
|
|
|
|
(!peers[id].micMuted && globalAction == 'mute') || |
|
|
|
|
(peers[id].micMuted && globalAction == 'unmute')){ |
|
|
|
|
var msg = locale.YOU_HAVE_MUTED_s; |
|
|
|
|
var who = (peers[id].hasName) ? peers[id].displayName : locale.A_PARTICIPANT; |
|
|
|
|
if (peers[id].micMuted){ |
|
|
|
@ -614,14 +617,18 @@ function initVroom(room) { |
|
|
|
|
webrtc.sendToAll('owner_toggle_mute', {peer: id}); |
|
|
|
|
$.notify(sprintf(msg, who), 'info'); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// We cannot mute another owner
|
|
|
|
|
else{ |
|
|
|
|
else if (!globalAction){ |
|
|
|
|
$.notify(locale.CANT_MUTE_OWNER, 'error'); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// Pause a peer
|
|
|
|
|
function pausePeer(id){ |
|
|
|
|
function pausePeer(id,globalAction){ |
|
|
|
|
if (peers[id] && peers[id].role != 'owner'){ |
|
|
|
|
if (!globalAction || |
|
|
|
|
(!peers[id].videoPaused && globalAction == 'pause') || |
|
|
|
|
(peers[id].videoPaused && globalAction == 'resume')){ |
|
|
|
|
var msg = locale.YOU_HAVE_SUSPENDED_s; |
|
|
|
|
var who = (peers[id].hasName) ? peers[id].displayName : locale.A_PARTICIPANT; |
|
|
|
|
if (peers[id].videoPaused){ |
|
|
|
@ -630,7 +637,8 @@ function initVroom(room) { |
|
|
|
|
webrtc.sendToAll('owner_toggle_pause', {peer: id}); |
|
|
|
|
$.notify(sprintf(msg, who), 'info'); |
|
|
|
|
} |
|
|
|
|
else{ |
|
|
|
|
} |
|
|
|
|
else if (!globalAction){ |
|
|
|
|
$.notify(locale.CANT_SUSPEND_OWNER, 'error'); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -1337,6 +1345,39 @@ function initVroom(room) { |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
// Mute all the peers
|
|
|
|
|
$('#muteEveryoneButton').click(function(){ |
|
|
|
|
$.each(peers, function(id){ |
|
|
|
|
if (id != 'local'){ |
|
|
|
|
mutePeer(id, 'mute'); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
// Unmute all the peers
|
|
|
|
|
$('#unmuteEveryoneButton').click(function(){ |
|
|
|
|
$.each(peers, function(id){ |
|
|
|
|
if (id != 'local'){ |
|
|
|
|
mutePeer(id, 'unmute'); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
// Suspend all the peers
|
|
|
|
|
$('#suspendEveryoneButton').click(function(){ |
|
|
|
|
$.each(peers, function(id){ |
|
|
|
|
if (id != 'local'){ |
|
|
|
|
pausePeer(id, 'pause'); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
// Resum all the peers
|
|
|
|
|
$('#resumeEveryoneButton').click(function(){ |
|
|
|
|
$.each(peers, function(id){ |
|
|
|
|
if (id != 'local'){ |
|
|
|
|
pausePeer(id, 'resume'); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
// Handle auth to become room owner
|
|
|
|
|
$('#authPass').on('input', function() { |
|
|
|
|
if ($('#authPass').val() == ''){ |
|
|
|
|