Przeglądaj źródła

Add notification popup for shared video auto mute

master
yanas 9 lat temu
rodzic
commit
a1cef0f181
4 zmienionych plików z 72 dodań i 25 usunięć
  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 Wyświetl plik

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

+ 11
- 3
index.html Wyświetl plik

111
                         <a class="button icon-avatar" id="toolbar_button_authentication" data-i18n="[content]toolbar.authenticate"></a>
111
                         <a class="button icon-avatar" id="toolbar_button_authentication" data-i18n="[content]toolbar.authenticate"></a>
112
                         <ul class="loginmenu">
112
                         <ul class="loginmenu">
113
                             <span class="loginmenuPadding"></span>
113
                             <span class="loginmenuPadding"></span>
114
-                            <li id="toolbar_auth_identity" class="identity"></li>
114
+                            <li id="toolbar_auth_identity"></li>
115
                             <li id="toolbar_button_login">
115
                             <li id="toolbar_button_login">
116
                                 <a class="authButton" data-i18n="toolbar.login"></a>
116
                                 <a class="authButton" data-i18n="toolbar.login"></a>
117
                             </li>
117
                             </li>
120
                             </li>
120
                             </li>
121
                         </ul>
121
                         </ul>
122
                     </span>
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
                     <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>
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
                     <a class="button" id="toolbar_button_record" data-container="body" data-toggle="popover" data-placement="bottom" style="display: none"></a>
129
                     <a class="button" id="toolbar_button_record" data-container="body" data-toggle="popover" data-placement="bottom" style="display: none"></a>
126
                     <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>
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
                         <span id="unreadMessages"></span>
133
                         <span id="unreadMessages"></span>
130
                     </a>
134
                     </a>
131
                     <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>
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
                     <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>
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
                     <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>
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
                     <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>
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 Wyświetl plik

63
         "hangup": "Hang Up",
63
         "hangup": "Hang Up",
64
         "login": "Login",
64
         "login": "Login",
65
         "logout": "Logout",
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
     "bottomtoolbar": {
70
     "bottomtoolbar": {
69
         "chat": "Open / close chat",
71
         "chat": "Open / close chat",

+ 56
- 16
modules/UI/shared_video/SharedVideo.js Wyświetl plik

171
             if(event.data.volume > 0 && !event.data.muted
171
             if(event.data.volume > 0 && !event.data.muted
172
                 && !APP.conference.isLocalAudioMuted()){
172
                 && !APP.conference.isLocalAudioMuted()){
173
                 self.emitter.emit(UIEvents.AUDIO_MUTED, true);
173
                 self.emitter.emit(UIEvents.AUDIO_MUTED, true);
174
-                self.notifyUserComfortableMicMute(true);
174
+                self.showMicMutedPopup(true);
175
             }
175
             }
176
         };
176
         };
177
 
177
 
236
                 && APP.conference.isLocalAudioMuted()) {
236
                 && APP.conference.isLocalAudioMuted()) {
237
                 player.setVolume(attributes.volume);
237
                 player.setVolume(attributes.volume);
238
                 console.info("Player change of volume:" + attributes.volume);
238
                 console.info("Player change of volume:" + attributes.volume);
239
-                this.notifyUserComfortableVideoMute(false);
239
+                this.showSharedVideoMutedPopup(false);
240
             }
240
             }
241
 
241
 
242
             if(playerPaused)
242
             if(playerPaused)
363
             this.localAudioMutedListener);
363
             this.localAudioMutedListener);
364
         this.localAudioMutedListener = null;
364
         this.localAudioMutedListener = null;
365
 
365
 
366
+        this.showSharedVideoMutedPopup(false);
367
+
366
         VideoLayout.removeParticipantContainer(this.url);
368
         VideoLayout.removeParticipantContainer(this.url);
367
 
369
 
368
         VideoLayout.showLargeVideoContainer(SHARED_VIDEO_CONTAINER_TYPE, false)
370
         VideoLayout.showLargeVideoContainer(SHARED_VIDEO_CONTAINER_TYPE, false)
403
         // to not pollute the conference
405
         // to not pollute the conference
404
         if(this.player.getVolume() > 0 || !this.player.isMuted()){
406
         if(this.player.getVolume() > 0 || !this.player.isMuted()){
405
             this.player.setVolume(0);
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
      * @param show boolean, show or hide the notification
415
      * @param show boolean, show or hide the notification
413
      */
416
      */
414
-    notifyUserComfortableMicMute (show) {
417
+    showMicMutedPopup (show) {
418
+        var micMutedPopupSelector = $("#micMutedPopup");
415
         if(show) {
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
      * @param show boolean, show or hide the notification
448
      * @param show boolean, show or hide the notification
426
      */
449
      */
427
-    notifyUserComfortableVideoMute (show) {
450
+    showSharedVideoMutedPopup (show) {
451
+        var sharedVideoMutedPopupSelector = $("#sharedVideoMutedPopup");
428
         if(show) {
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
 

Ładowanie…
Anuluj
Zapisz