Browse Source

Add notification popup for shared video auto mute

j8
yanas 9 years ago
parent
commit
a1cef0f181
4 changed files with 72 additions and 25 deletions
  1. 2
    5
      css/login_menu.css
  2. 11
    3
      index.html
  3. 3
    1
      lang/main.json
  4. 56
    16
      modules/UI/shared_video/SharedVideo.js

+ 2
- 5
css/login_menu.css View File

@@ -1,5 +1,6 @@
1 1
 /*Initialize*/
2 2
 ul.loginmenu {
3
+    font-family:'Helvetica Neue', Helvetica, sans-serif;
3 4
     display:none;
4 5
     position: absolute;
5 6
     margin: 0;
@@ -15,12 +16,10 @@ ul.loginmenu {
15 16
 ul.loginmenu li {
16 17
     list-style-type: none;
17 18
     padding: 7px;
18
-}
19
-
20
-ul.loginmenu li.identity {
21 19
     color: #fff;
22 20
     font-size: 11pt;
23 21
     cursor: default;
22
+    white-space: pre;
24 23
 }
25 24
 
26 25
 ul.loginmenu:after {
@@ -38,8 +37,6 @@ li a.authButton{
38 37
     padding-left: 29px;
39 38
     padding-right: 29px;
40 39
     border-radius: 4px;
41
-    color: #fff;
42
-    font-size: 11pt;
43 40
     cursor: pointer;
44 41
 }
45 42
 

+ 11
- 3
index.html View File

@@ -111,7 +111,7 @@
111 111
                         <a class="button icon-avatar" id="toolbar_button_authentication" data-i18n="[content]toolbar.authenticate"></a>
112 112
                         <ul class="loginmenu">
113 113
                             <span class="loginmenuPadding"></span>
114
-                            <li id="toolbar_auth_identity" class="identity"></li>
114
+                            <li id="toolbar_auth_identity"></li>
115 115
                             <li id="toolbar_button_login">
116 116
                                 <a class="authButton" data-i18n="toolbar.login"></a>
117 117
                             </li>
@@ -120,7 +120,11 @@
120 120
                             </li>
121 121
                         </ul>
122 122
                     </span>
123
-                    <a class="button icon-microphone" id="toolbar_button_mute" data-container="body" data-toggle="popover" data-placement="bottom" shortcut="mutePopover" data-i18n="[content]toolbar.mute" content="Mute / Unmute"></a>
123
+                    <a class="button icon-microphone" id="toolbar_button_mute" data-container="body" data-toggle="popover" data-placement="bottom" shortcut="mutePopover" data-i18n="[content]toolbar.mute" content="Mute / Unmute">
124
+                        <ul id="micMutedPopup" class="loginmenu">
125
+                            <li data-i18n="[html]toolbar.micMutedPopup"></li>
126
+                        </ul>
127
+                    </a>
124 128
                     <a class="button icon-camera" id="toolbar_button_camera" data-container="body" data-toggle="popover" data-placement="bottom" shortcut="toggleVideoPopover" data-i18n="[content]toolbar.videomute" content="Start / stop camera"></a>
125 129
                     <a class="button" id="toolbar_button_record" data-container="body" data-toggle="popover" data-placement="bottom" style="display: none"></a>
126 130
                     <a class="button icon-security" id="toolbar_button_security" data-container="body" data-toggle="popover" data-placement="bottom" data-i18n="[content]toolbar.lock" content="Lock / unlock room"></a>
@@ -129,7 +133,11 @@
129 133
                         <span id="unreadMessages"></span>
130 134
                     </a>
131 135
                     <a class="button icon-share-doc" id="toolbar_button_etherpad" data-container="body" data-toggle="popover" data-placement="bottom" content="Shared document" data-i18n="[content]toolbar.etherpad"></a>
132
-                    <a class="button fa fa-share-alt-square" id="toolbar_button_sharedvideo" data-container="body" data-toggle="popover" data-placement="bottom" content="Share a YouTube video" data-i18n="[content]toolbar.sharedvideo" style="display: none"></a>
136
+                    <a class="button fa fa-share-alt-square" id="toolbar_button_sharedvideo" data-container="body" data-toggle="popover" data-placement="bottom" content="Share a YouTube video" data-i18n="[content]toolbar.sharedvideo" style="display: none">
137
+                        <ul id="sharedVideoMutedPopup" class="loginmenu">
138
+                            <li data-i18n="[html]toolbar.sharedVideoMutedPopup"></li>
139
+                        </ul>
140
+                    </a>
133 141
                     <a class="button icon-share-desktop" id="toolbar_button_desktopsharing" data-container="body" data-toggle="popover" data-placement="bottom" shortcut="toggleDesktopSharingPopover" content="Share screen" data-i18n="[content]toolbar.sharescreen" style="display: none"></a>
134 142
                     <a class="button icon-full-screen" id="toolbar_button_fullScreen" data-container="body" data-toggle="popover" data-placement="bottom" content="Enter / Exit Full Screen" data-i18n="[content]toolbar.fullscreen"></a>
135 143
                     <a class="button icon-telephone" id="toolbar_button_sip" data-container="body" data-toggle="popover" data-placement="bottom" content="Call SIP number" data-i18n="[content]toolbar.sip" style="display: none"></a>

+ 3
- 1
lang/main.json View File

@@ -63,7 +63,9 @@
63 63
         "hangup": "Hang Up",
64 64
         "login": "Login",
65 65
         "logout": "Logout",
66
-        "dialpad": "Show dialpad"
66
+        "dialpad": "Show dialpad",
67
+        "sharedVideoMutedPopup": "Your shared video has been muted so<br/>that you can talk to the other participants.",
68
+        "micMutedPopup": "Your microphone has been muted so that you<br/>would fully enjoy your shared video."
67 69
     },
68 70
     "bottomtoolbar": {
69 71
         "chat": "Open / close chat",

+ 56
- 16
modules/UI/shared_video/SharedVideo.js View File

@@ -171,7 +171,7 @@ export default class SharedVideoManager {
171 171
             if(event.data.volume > 0 && !event.data.muted
172 172
                 && !APP.conference.isLocalAudioMuted()){
173 173
                 self.emitter.emit(UIEvents.AUDIO_MUTED, true);
174
-                self.notifyUserComfortableMicMute(true);
174
+                self.showMicMutedPopup(true);
175 175
             }
176 176
         };
177 177
 
@@ -236,7 +236,7 @@ export default class SharedVideoManager {
236 236
                 && APP.conference.isLocalAudioMuted()) {
237 237
                 player.setVolume(attributes.volume);
238 238
                 console.info("Player change of volume:" + attributes.volume);
239
-                this.notifyUserComfortableVideoMute(false);
239
+                this.showSharedVideoMutedPopup(false);
240 240
             }
241 241
 
242 242
             if(playerPaused)
@@ -363,6 +363,8 @@ export default class SharedVideoManager {
363 363
             this.localAudioMutedListener);
364 364
         this.localAudioMutedListener = null;
365 365
 
366
+        this.showSharedVideoMutedPopup(false);
367
+
366 368
         VideoLayout.removeParticipantContainer(this.url);
367 369
 
368 370
         VideoLayout.showLargeVideoContainer(SHARED_VIDEO_CONTAINER_TYPE, false)
@@ -403,35 +405,73 @@ export default class SharedVideoManager {
403 405
         // to not pollute the conference
404 406
         if(this.player.getVolume() > 0 || !this.player.isMuted()){
405 407
             this.player.setVolume(0);
406
-            this.notifyUserComfortableVideoMute(true);
408
+            this.showSharedVideoMutedPopup(true);
407 409
         }
408 410
     }
409 411
 
410 412
     /**
411
-     * Notifies user for muting its audio due to video is unmuted.
413
+     * Shows a popup under the microphone toolbar icon that notifies the user
414
+     * of automatic mute after a shared video has started.
412 415
      * @param show boolean, show or hide the notification
413 416
      */
414
-    notifyUserComfortableMicMute (show) {
417
+    showMicMutedPopup (show) {
418
+        var micMutedPopupSelector = $("#micMutedPopup");
415 419
         if(show) {
416
-            this.notifyUserComfortableVideoMute(false);
417
-            console.log("Your audio was muted to enjoy the video");
420
+            this.showSharedVideoMutedPopup(false);
421
+
422
+            if (!micMutedPopupSelector.is(":visible"))
423
+                micMutedPopupSelector.css("display", "inline-block");
424
+
425
+            // FIXME: we need an utility method for that.
426
+            micMutedPopupSelector.fadeIn(300,
427
+                () => {micMutedPopupSelector.css({opacity: 1});}
428
+            );
429
+
430
+            setTimeout(
431
+                function () {
432
+                    micMutedPopupSelector.fadeOut(300,
433
+                        () => {micMutedPopupSelector.css({opacity: 0});}
434
+                    );
435
+                }, 5000);
436
+        }
437
+        else {
438
+            micMutedPopupSelector.fadeOut(300,
439
+                () => {micMutedPopupSelector.css({opacity: 0});}
440
+            );
418 441
         }
419
-        else
420
-            console.log("Hide notification local audio muted");
421 442
     }
422 443
 
423 444
     /**
424
-     * Notifies user for muting the video due to audio is unmuted.
445
+     * Shows a popup under the shared video toolbar icon that notifies the user
446
+     * of automatic mute of the shared video after the user has unmuted their
447
+     * mic.
425 448
      * @param show boolean, show or hide the notification
426 449
      */
427
-    notifyUserComfortableVideoMute (show) {
450
+    showSharedVideoMutedPopup (show) {
451
+        var sharedVideoMutedPopupSelector = $("#sharedVideoMutedPopup");
428 452
         if(show) {
429
-            this.notifyUserComfortableMicMute(false);
430
-            console.log(
431
-                "Your shared video was muted in order to speak freely!");
453
+            this.showMicMutedPopup(false);
454
+
455
+            if (!sharedVideoMutedPopupSelector.is(":visible"))
456
+                sharedVideoMutedPopupSelector.css("display", "inline-block");
457
+
458
+            // FIXME: we need an utility method for that.
459
+            sharedVideoMutedPopupSelector.fadeIn(300,
460
+                () => {sharedVideoMutedPopupSelector.css({opacity: 1});}
461
+            );
462
+
463
+            setTimeout(
464
+                function () {
465
+                    sharedVideoMutedPopupSelector.fadeOut(300,
466
+                        () => {sharedVideoMutedPopupSelector.css({opacity: 0});}
467
+                    );
468
+                }, 5000);
469
+        }
470
+        else {
471
+            sharedVideoMutedPopupSelector.fadeOut(300,
472
+                () => {sharedVideoMutedPopupSelector.css({opacity: 0});}
473
+            );
432 474
         }
433
-        else
434
-            console.log("Hide notification share video muted");
435 475
     }
436 476
 }
437 477
 

Loading…
Cancel
Save