Add grouped actions

To mute/unmute/suspend/resume everyone in one click
Fix #54
master
Daniel Berteaud 11 years ago
parent eb8d155d82
commit 20d1bf695f
  1. 5
      lib/Vroom/I18N/en.pm
  2. 5
      lib/Vroom/I18N/fr.pm
  3. 49
      public/js/vroom.js
  4. 32
      templates/default/join.html.ep

@ -163,6 +163,11 @@ our %Lexicon = (
"MIC_UNMUTED" => "Your microphone is now unmuted",
"CAM_SUSPENDED" => "Your webcam is now suspended",
"CAM_RESUMED" => "Your webcam is on again",
"GROUP_ACTIONS" => "Grouped actions",
"MUTE_EVERYONE" => "Mute everyone",
"UNMUTE_EVERYONE" => "Unmute everyone",
"SUSPEND_EVERYONE" => "Suspend everyone's webcam",
"RESUME_EVERYONE" => "Resume everyone's webcam",
"SHARE_YOUR_SCREEN" => "Share your screen with the other members of this room",
"CANT_SHARE_SCREEN" => "Sorry, your configuration does not allow screen sharing",
"SCREEN_SHARING_ONLY_FOR_CHROME" => "Sorry, but you can't share your screen. Only Google Chrome supports this feature for now",

@ -173,6 +173,11 @@ our %Lexicon = (
"MIC_UNMUTED" => "Votre micro est à nouveau actif",
"CAM_SUSPENDED" => "Votre webcam est en pause",
"CAM_RESUMED" => "Votre webcam est à nouveau active",
"GROUP_ACTIONS" => "Actions groupées",
"MUTE_EVERYONE" => "Couper le micro de tous les participants",
"UNMUTE_EVERYONE" => "Réactiver le micro de tous les participants",
"SUSPEND_EVERYONE" => "Mettre en pause les webcam de tous les participants",
"RESUME_EVERYONE" => "Réactiver les webcam de tous les participants",
"SHARE_YOUR_SCREEN" => "Partager votre écran",
"CANT_SHARE_SCREEN" => "Désolé, mais votre configuration ne vous permet pas de partager votre écran",
"SCREEN_SHARING_ONLY_FOR_CHROME" => "Désolé, mais vous ne pouvez pas partager votre écran. Seul le navigateur Google Chrome " .

@ -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() == ''){

@ -97,6 +97,38 @@
</ul>
</div>
<div class="btn-group dropdown ownerEl">
<button class="btn btn-default dropdown-toggle help" type="button" id="groupActionsButton" data-toggle="dropdown" data-toggle="tooltip" data-placement="bottom" title="<%=l 'GROUP_ACTIONS' %>">
<span class="glyphicon glyphicon-flag"></span>
<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu" aria-labelledby="groupActionsButton" id="confMenu">
<li>
<center>
<div class="navbar-form">
<div class="btn-group" data-toggle="buttons">
<button type="button" class="btn btn-default help" id="muteEveryoneButton" data-toggle="tooltip" data-placement="bottom" title="<%=l 'MUTE_EVERYONE' %>">
<span class="glyphicon glyphicon-volume-off">
</span>
</button>
<button type="button" class="btn btn-default help" id="unmuteEveryoneButton" data-toggle="tooltip" data-placement="bottom" title="<%=l 'UNMUTE_EVERYONE' %>">
<span class="glyphicon glyphicon-volume-up">
</span>
</buton>
<button type="button" class="btn btn-default help" id="suspendEveryoneButton" data-toggle="tooltip" data-placement="bottom" title="<%=l 'SUSPEND_EVERYONE' %>">
<span class="glyphicon glyphicon-eye-close">
</span>
</button>
<button type="button" class="btn btn-default help" id="resumeEveryoneButton" data-toggle="tooltip" data-placement="bottom" title="<%=l 'RESUME_EVERYONE' %>">
<span class="glyphicon glyphicon-eye-open">
</span>
</button>
</div>
</div>
</center>
</li>
</ul>
</div>
<div class="btn-group dropdown ownerEl">
<button class="btn btn-default dropdown-toggle help" type="button" id="confMenuButton" data-toggle="dropdown" data-toggle="tooltip" data-placement="bottom" title="<%=l 'CONFIGURE' %>">
<span class="glyphicon glyphicon-wrench"></span>
<span class="caret"></span>

Loading…
Cancel
Save