Warn if no sound has been detected

Fix #29
master
Daniel Berteaud 11 years ago
parent 94de8f308b
commit 83cafa7536
  1. 1
      lib/Vroom/I18N/en.pm
  2. 1
      lib/Vroom/I18N/fr.pm
  3. 19
      public/js/vroom.js

@ -65,6 +65,7 @@ our %Lexicon = (
"CLICK_TO_CHAT" => "Click to access the chat", "CLICK_TO_CHAT" => "Click to access the chat",
"PREVENT_TO_JOIN" => "Prevent other participants to join this room", "PREVENT_TO_JOIN" => "Prevent other participants to join this room",
"MUTE_MIC" => "Turn off your microphone", "MUTE_MIC" => "Turn off your microphone",
"NO_SOUND_DETECTED" => "No sound detected, please check your microphone (input level might be too low)",
"SUSPEND_CAM" => "Suspend your webcam, other will see a black screen instead, but can still hear you", "SUSPEND_CAM" => "Suspend your webcam, other will see a black screen instead, but can still hear you",
"CONFIGURE" => "Configuration", "CONFIGURE" => "Configuration",
"YOU_CAN_PASSWORD_PROTECT_JOIN" => "You can protect this room with a password", "YOU_CAN_PASSWORD_PROTECT_JOIN" => "You can protect this room with a password",

@ -70,6 +70,7 @@ our %Lexicon = (
"CLICK_TO_CHAT" => "Cliquez ici pour accéder au tchat", "CLICK_TO_CHAT" => "Cliquez ici pour accéder au tchat",
"PREVENT_TO_JOIN" => "Empêchez d'autres participants de rejoindre ce salon", "PREVENT_TO_JOIN" => "Empêchez d'autres participants de rejoindre ce salon",
"MUTE_MIC" => "Coupez votre micro", "MUTE_MIC" => "Coupez votre micro",
"NO_SOUND_DETECTED" => "Aucun son n'a été détecté. Vérifiez votre micro (le volume de votre micro est peut-être trop faible)",
"SUSPEND_CAM" => "Stoppez la webcam, les autres verront un écran noir à la place, " . "SUSPEND_CAM" => "Stoppez la webcam, les autres verront un écran noir à la place, " .
"mais pourront toujours vous entendre", "mais pourront toujours vous entendre",
"CONFIGURE" => "Configuration", "CONFIGURE" => "Configuration",

@ -33,7 +33,8 @@ var locale = {
OWNER_PASSWORD_REMOVED_BY_s: '', OWNER_PASSWORD_REMOVED_BY_s: '',
CANT_SEND_TO_s: '', CANT_SEND_TO_s: '',
SCREEN_s: '', SCREEN_s: '',
TO_INVITE_SHARE_THIS_URL: '' TO_INVITE_SHARE_THIS_URL: '',
NO_SOUND_DETECTED: ''
}; };
// Localize the strings we need // Localize the strings we need
@ -83,7 +84,8 @@ function initVroom(room) {
}; };
var mainVid = false, var mainVid = false,
chatHistory = {}, chatHistory = {},
chatIndex = 0; chatIndex = 0,
maxVol = -100;
$('#name_local').css('background-color', peers.local.color); $('#name_local').css('background-color', peers.local.color);
@ -354,6 +356,9 @@ function initVroom(room) {
// Handle volume changes from our own mic // Handle volume changes from our own mic
webrtc.on('volumeChange', function (volume, treshold) { webrtc.on('volumeChange', function (volume, treshold) {
if (volume > maxVol){
maxVol = volume;
}
if (peers.local.micMuted) { if (peers.local.micMuted) {
return; return;
} }
@ -950,6 +955,16 @@ function initVroom(room) {
}); });
}, 60000); }, 60000);
// Check if sound is detected and warn if it hasn't
setTimeout(function (){
if (maxVol < -40){
$.notify(locale.NO_SOUND_DETECTED, {
className: 'error',
autoHide: false
});
}
}, 10000);
window.onresize = function (){ window.onresize = function (){
$('#webRTCVideo').css('max-height', maxHeight()); $('#webRTCVideo').css('max-height', maxHeight());
$('#mainVideo>video').css('max-height', maxHeight()); $('#mainVideo>video').css('max-height', maxHeight());

Loading…
Cancel
Save