diff --git a/lib/Vroom/I18N/en.pm b/lib/Vroom/I18N/en.pm index 732d652..f7d5a13 100644 --- a/lib/Vroom/I18N/en.pm +++ b/lib/Vroom/I18N/en.pm @@ -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", diff --git a/lib/Vroom/I18N/fr.pm b/lib/Vroom/I18N/fr.pm index a1d4325..6cf9cbc 100644 --- a/lib/Vroom/I18N/fr.pm +++ b/lib/Vroom/I18N/fr.pm @@ -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 " . diff --git a/public/js/vroom.js b/public/js/vroom.js index 12bd3f8..14634ff 100644 --- a/public/js/vroom.js +++ b/public/js/vroom.js @@ -603,34 +603,42 @@ function initVroom(room) { } // Mute a peer - function mutePeer(id){ + function mutePeer(id,globalAction){ if (peers[id] && peers[id].role != 'owner'){ - var msg = locale.YOU_HAVE_MUTED_s; - var who = (peers[id].hasName) ? peers[id].displayName : locale.A_PARTICIPANT; - if (peers[id].micMuted){ - msg = locale.YOU_HAVE_UNMUTED_s + 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){ + msg = locale.YOU_HAVE_UNMUTED_s + } + // notify everyone that we have muted this peer + webrtc.sendToAll('owner_toggle_mute', {peer: id}); + $.notify(sprintf(msg, who), 'info'); } - // notify everyone that we have muted this peer - 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'){ - var msg = locale.YOU_HAVE_SUSPENDED_s; - var who = (peers[id].hasName) ? peers[id].displayName : locale.A_PARTICIPANT; - if (peers[id].videoPaused){ - msg = locale.YOU_HAVE_RESUMED_s; + 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){ + msg = locale.YOU_HAVE_RESUMED_s; + } + webrtc.sendToAll('owner_toggle_pause', {peer: id}); + $.notify(sprintf(msg, who), 'info'); } - 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() == ''){ diff --git a/templates/default/join.html.ep b/templates/default/join.html.ep index a9ddc3f..d5e78ee 100644 --- a/templates/default/join.html.ep +++ b/templates/default/join.html.ep @@ -97,6 +97,38 @@ +