Przeglądaj źródła

feat(notification): Add suboptimal browser exp notification.

master
hristoterezov 7 lat temu
rodzic
commit
a357b0cf14

+ 3
- 1
lang/main.json Wyświetl plik

@@ -223,7 +223,9 @@
223 223
         "grantedToUnknown": "Moderator rights granted to $t(notify.somebody)!",
224 224
         "muted": "You have started the conversation muted.",
225 225
         "mutedTitle": "You're muted!",
226
-        "raisedHand": "Would like to speak."
226
+        "raisedHand": "Would like to speak.",
227
+        "suboptimalExperienceTitle": "Browser Warning",
228
+        "suboptimalExperienceDescription": "Eer... we are afraid your experience with __appName__ isn't going to be that great here. We are looking for ways to improve this but, until then, please try using one of the <a href='/static/recommendedBrowsers.html' target='_blank'>fully supported browsers</a>."
227 229
     },
228 230
     "dialog": {
229 231
         "add": "Add",

+ 3035
- 2526
package-lock.json
Plik diff jest za duży
Wyświetl plik


+ 1
- 1
package.json Wyświetl plik

@@ -44,7 +44,7 @@
44 44
     "jquery-i18next": "1.2.0",
45 45
     "js-md5": "0.6.1",
46 46
     "jwt-decode": "2.2.0",
47
-    "lib-jitsi-meet": "github:jitsi/lib-jitsi-meet#2aa85ad1719f81541ac1a3582f1369e2f4d1f5c2",
47
+    "lib-jitsi-meet": "github:jitsi/lib-jitsi-meet#8f7a604653584f24b73894466049baf699904745",
48 48
     "lodash": "4.17.4",
49 49
     "moment": "2.19.4",
50 50
     "nuclear-js": "1.4.0",

+ 5
- 5
react/features/base/lib-jitsi-meet/index.js Wyświetl plik

@@ -3,9 +3,11 @@
3 3
 import JitsiMeetJS from './_';
4 4
 export { JitsiMeetJS as default };
5 5
 
6
-// XXX Re-export the types exported by JitsiMeetJS in order to prevent undefined
7
-// imported JitsiMeetJS. It may be caused by import cycles but I have not
8
-// confirmed the theory.
6
+// XXX Re-export the properties exported by JitsiMeetJS in order to prevent
7
+// undefined imported JitsiMeetJS. It may be caused by import cycles but I have
8
+// not confirmed the theory.
9
+export const analytics = JitsiMeetJS.analytics;
10
+export const RTCBrowserType = JitsiMeetJS.util.RTCBrowserType;
9 11
 export const JitsiConferenceErrors = JitsiMeetJS.errors.conference;
10 12
 export const JitsiConferenceEvents = JitsiMeetJS.events.conference;
11 13
 export const JitsiConnectionErrors = JitsiMeetJS.errors.connection;
@@ -20,8 +22,6 @@ export const JitsiSIPVideoGWStatus = JitsiMeetJS.constants.sipVideoGW;
20 22
 export const JitsiTrackErrors = JitsiMeetJS.errors.track;
21 23
 export const JitsiTrackEvents = JitsiMeetJS.events.track;
22 24
 
23
-export const analytics = JitsiMeetJS.analytics;
24
-
25 25
 export * from './actions';
26 26
 export * from './actionTypes';
27 27
 export * from './constants';

+ 10
- 3
react/features/conference/components/Conference.web.js Wyświetl plik

@@ -6,6 +6,7 @@ import { connect as reactReduxConnect } from 'react-redux';
6 6
 
7 7
 import { connect, disconnect } from '../../base/connection';
8 8
 import { DialogContainer } from '../../base/dialog';
9
+import { translate } from '../../base/i18n';
9 10
 import { CalleeInfoContainer } from '../../base/jwt';
10 11
 import { Filmstrip } from '../../filmstrip';
11 12
 import { LargeVideo } from '../../large-video';
@@ -13,6 +14,8 @@ import { NotificationsContainer } from '../../notifications';
13 14
 import { showToolbox, Toolbox } from '../../toolbox';
14 15
 import { HideNotificationBarStyle } from '../../unsupported-browser';
15 16
 
17
+import { maybeShowSuboptimalExperienceNotification } from '../functions';
18
+
16 19
 declare var APP: Object;
17 20
 declare var interfaceConfig: Object;
18 21
 
@@ -26,7 +29,8 @@ type Props = {
26 29
      */
27 30
     _isRecording: boolean,
28 31
 
29
-    dispatch: Function
32
+    dispatch: Function,
33
+    t: Function
30 34
 }
31 35
 
32 36
 /**
@@ -70,7 +74,10 @@ class Conference extends Component<Props> {
70 74
         APP.UI.registerListeners();
71 75
         APP.UI.bindEvents();
72 76
 
73
-        this.props.dispatch(connect());
77
+        const { dispatch, t } = this.props;
78
+
79
+        dispatch(connect());
80
+        maybeShowSuboptimalExperienceNotification(dispatch, t);
74 81
     }
75 82
 
76 83
     /**
@@ -161,4 +168,4 @@ function _mapStateToProps(state) {
161 168
     };
162 169
 }
163 170
 
164
-export default reactReduxConnect(_mapStateToProps)(Conference);
171
+export default reactReduxConnect(_mapStateToProps)(translate(Conference));

+ 38
- 0
react/features/conference/functions.js Wyświetl plik

@@ -0,0 +1,38 @@
1
+import { getName } from '../app';
2
+import { translateToHTML } from '../base/i18n';
3
+import { RTCBrowserType } from '../base/lib-jitsi-meet';
4
+import { showWarningNotification } from '../notifications';
5
+
6
+/**
7
+ * Shows the suboptimal experience notification if needed.
8
+ *
9
+ * @param {Function} dispatch - The dispatch method.
10
+ * @param {Function} t - The translation function.
11
+ * @returns {void}
12
+ */
13
+export function maybeShowSuboptimalExperienceNotification(dispatch, t) {
14
+    if (!RTCBrowserType.isChrome()
15
+            && !RTCBrowserType.isFirefox()
16
+            && !RTCBrowserType.isNWJS()
17
+            && !RTCBrowserType.isElectron()
18
+
19
+            // Adding react native to the list of recommended browsers is not
20
+            // necessary for now because the function won't be executed at all
21
+            // in this case but I'm adding it for completeness.
22
+            && !RTCBrowserType.isReactNative()
23
+    ) {
24
+        dispatch(
25
+            showWarningNotification(
26
+                {
27
+                    titleKey: 'notify.suboptimalExperienceTitle',
28
+                    description: translateToHTML(
29
+                        t,
30
+                        'notify.suboptimalExperienceDescription',
31
+                        {
32
+                            appName: getName()
33
+                        })
34
+                }
35
+            )
36
+        );
37
+    }
38
+}

+ 1
- 3
react/features/notifications/components/NotificationsContainer.web.js Wyświetl plik

@@ -71,9 +71,7 @@ class NotificationsContainer extends Component {
71 71
         if (_notifications.length) {
72 72
             const notification = _notifications[0];
73 73
 
74
-            if (!_showNotifications) {
75
-                this._onDismissed(notification.uid);
76
-            } else if (this._notificationDismissTimeout) {
74
+            if (!_showNotifications || this._notificationDismissTimeout) {
77 75
 
78 76
                 // No-op because there should already be a notification that
79 77
                 // is waiting for dismissal.

+ 25
- 0
static/recommendedBrowsers.html Wyświetl plik

@@ -0,0 +1,25 @@
1
+<html>
2
+<head>
3
+    <link rel="stylesheet" href="../css/all.css"/>
4
+    <!--#include virtual="/title.html" -->
5
+</head>
6
+<body>
7
+    <div class = 'unsupported-desktop-browser'>
8
+        <h2 class = 'unsupported-desktop-browser__title'>
9
+            It looks like you're using a browser we don't fully support.
10
+        </h2>
11
+        <p class ='unsupported-desktop-browser__description'>
12
+            We recommend to try with the latest version of&nbsp;
13
+            <a
14
+                className = 'unsupported-desktop-browser__link'
15
+                href = 'http://google.com/chrome' >Chrome</a>,&nbsp;
16
+            <a
17
+                class = 'unsupported-desktop-browser__link'
18
+                href = 'http://www.getfirefox.com/'>Firefox</a>&nbsp;or&nbsp;
19
+            <a
20
+                class = 'unsupported-desktop-browser__link'
21
+                href = 'http://www.chromium.org/'>Chromium</a>
22
+        </p>
23
+    </div>
24
+</body>
25
+</html>

Ładowanie…
Anuluj
Zapisz