Bladeren bron

Adds suspend overlay.

j8
damencho 8 jaren geleden
bovenliggende
commit
96b280668d
4 gewijzigde bestanden met toevoegingen van 83 en 2 verwijderingen
  1. 5
    1
      css/_inlay.scss
  2. 4
    0
      lang/main.json
  3. 11
    1
      modules/UI/UI.js
  4. 63
    0
      modules/UI/suspended_overlay/SuspendedOverlay.js

+ 5
- 1
css/_inlay.scss Bestand weergeven

@@ -7,7 +7,7 @@
7 7
     text-align: center;
8 8
 
9 9
     &__title {
10
-        margin: 12px 0;
10
+        margin: 17px 0;
11 11
         padding-bottom: 17px;
12 12
         color: $popoverFontColor;
13 13
         font-size: 21px;
@@ -26,4 +26,8 @@
26 26
         margin: 0 10px;
27 27
         font-size: 50px;
28 28
     }
29
+
30
+    &__button {
31
+        float: none !important;
32
+    }
29 33
 }

+ 4
- 0
lang/main.json Bestand weergeven

@@ -79,6 +79,10 @@
79 79
         "policyText": " ",
80 80
         "title": "__app__ needs to use your microphone and camera."
81 81
     },
82
+    "suspendedoverlay": {
83
+        "title": "Your video call was interrupted, because this computer went to sleep.",
84
+        "rejoinKeyTitle": "Rejoin"
85
+    },
82 86
     "toolbar": {
83 87
         "mute": "Mute / Unmute",
84 88
         "videomute": "Start / Stop camera",

+ 11
- 1
modules/UI/UI.js Bestand weergeven

@@ -16,6 +16,7 @@ import GumPermissionsOverlay
16 16
     from './gum_overlay/UserMediaPermissionsGuidanceOverlay';
17 17
 
18 18
 import PageReloadOverlay from './reload_overlay/PageReloadOverlay';
19
+import SuspendedOverlay from './suspended_overlay/SuspendedOverlay';
19 20
 import VideoLayout from "./videolayout/VideoLayout";
20 21
 import FilmStrip from "./videolayout/FilmStrip";
21 22
 import SettingsMenu from "./side_pannels/settings/SettingsMenu";
@@ -1399,12 +1400,14 @@ UI.hideRingOverLay = function () {
1399 1400
 
1400 1401
 /**
1401 1402
  * Indicates if any the "top" overlays are currently visible. The check includes
1402
- * the call overlay, GUM permissions overlay and a page reload overlay.
1403
+ * the call overlay, suspended overlay, GUM permissions overlay
1404
+ * and a page reload overlay.
1403 1405
  *
1404 1406
  * @returns {*|boolean} {true} if the overlay is visible, {false} otherwise
1405 1407
  */
1406 1408
 UI.isOverlayVisible = function () {
1407 1409
     return RingOverlay.isVisible()
1410
+        || SuspendedOverlay.isVisible()
1408 1411
         || PageReloadOverlay.isVisible()
1409 1412
         || GumPermissionsOverlay.isVisible();
1410 1413
 };
@@ -1427,6 +1430,13 @@ UI.showUserMediaPermissionsGuidanceOverlay = function (browser) {
1427 1430
     GumPermissionsOverlay.show(browser);
1428 1431
 };
1429 1432
 
1433
+/**
1434
+ * Shows suspended overlay with a button to rejoin conference.
1435
+ */
1436
+UI.showSuspendedOverlay = function () {
1437
+    SuspendedOverlay.show();
1438
+};
1439
+
1430 1440
 /**
1431 1441
  * Hides browser-specific overlay with guidance how to proceed with gUM prompt.
1432 1442
  */

+ 63
- 0
modules/UI/suspended_overlay/SuspendedOverlay.js Bestand weergeven

@@ -0,0 +1,63 @@
1
+/* global $, APP */
2
+
3
+import Overlay from '../overlay/Overlay';
4
+
5
+/**
6
+ * An overlay dialog which is shown when a suspended event is detected.
7
+ */
8
+class SuspendedOverlayImpl extends Overlay{
9
+    /**
10
+     * Creates new <tt>SuspendedOverlayImpl</tt>
11
+     */
12
+    constructor() {
13
+        super();
14
+
15
+        $(document).on('click', '#rejoin', () => {
16
+            APP.ConferenceUrl.reload();
17
+        });
18
+    }
19
+    /**
20
+     * Constructs overlay body with the message and a button to rejoin.
21
+     * @override
22
+     */
23
+    _buildOverlayContent() {
24
+        return (
25
+        `<div class="inlay">
26
+            <span class="inlay__icon icon-microphone"></span>
27
+            <span class="inlay__icon icon-camera"></span>
28
+            <h3 class="inlay__title" data-i18n="suspendedoverlay.title"></h3>
29
+            <button id="rejoin" 
30
+                 data-i18n="suspendedoverlay.rejoinKeyTitle" 
31
+                 class="inlay__button button-control button-control_primary">
32
+            </button>
33
+        </div>`);
34
+    }
35
+}
36
+
37
+/**
38
+ * Holds the page suspended overlay instance.
39
+ *
40
+ * {@type SuspendedOverlayImpl}
41
+ */
42
+let overlay;
43
+
44
+export default {
45
+    /**
46
+     * Checks whether the page suspended overlay has been displayed.
47
+     * @return {boolean} <tt>true</tt> if the page suspended overlay is
48
+     * currently visible or <tt>false</tt> otherwise.
49
+     */
50
+    isVisible() {
51
+        return overlay && overlay.isVisible();
52
+    },
53
+    /**
54
+     * Shows the page suspended overlay.
55
+     */
56
+    show() {
57
+
58
+        if (!overlay) {
59
+            overlay = new SuspendedOverlayImpl();
60
+        }
61
+        overlay.show();
62
+    }
63
+};

Laden…
Annuleren
Opslaan