瀏覽代碼

feat(toolbar): add beta tag to live streaming button (#3007)

* feat(toolbar): add beta tag to live streaming button

* tweak colors and border radius
master
virtuacoplenny 7 年之前
父節點
當前提交
f608ad4e5e
沒有連結到貢獻者的電子郵件帳戶。

+ 11
- 0
css/_toolbars.scss 查看文件

@@ -133,6 +133,17 @@
133 133
             }
134 134
         }
135 135
 
136
+        .beta-tag {
137
+            background: #B8C7E0;
138
+            border-radius: 2px;
139
+            color: $newToolbarBackgroundColor;
140
+            font-family: -apple-system, BlinkMacSystemFont, $baseFontFamily;
141
+            font-size: 11px;
142
+            font-weight: bold;
143
+            margin-left: 8px;
144
+            padding: 0 6px;
145
+        }
146
+
136 147
         .overflow-menu-item-icon {
137 148
             margin-right: 10px;
138 149
 

+ 3
- 2
lang/main.json 查看文件

@@ -290,11 +290,11 @@
290 290
         "sorryFeedback": "We're sorry to hear that. Would you like to tell us more?",
291 291
         "liveStreaming": "Live Streaming",
292 292
         "streamKey": "Live stream key",
293
-        "startLiveStreaming": "Go live now",
293
+        "startLiveStreaming": "Start live stream",
294 294
         "startRecording": "Start recording",
295 295
         "stopStreamingWarning": "Are you sure you would like to stop the live streaming?",
296 296
         "stopRecordingWarning": "Are you sure you would like to stop the recording?",
297
-        "stopLiveStreaming": "Stop live streaming",
297
+        "stopLiveStreaming": "Stop live stream",
298 298
         "stopRecording": "Stop recording",
299 299
         "doNotShowMessageAgain": "Don't show this message again",
300 300
         "permissionDenied": "Permission Denied",
@@ -386,6 +386,7 @@
386 386
     },
387 387
     "recording":
388 388
     {
389
+        "beta": "BETA",
389 390
         "busy": "We're working on freeing recording resources. Please try again in a few minutes.",
390 391
         "busyTitle": "All recorders are currently busy",
391 392
         "buttonTooltip": "Start / Stop recording",

+ 69
- 0
react/features/toolbox/components/web/OverflowMenuLiveStreamingItem.js 查看文件

@@ -0,0 +1,69 @@
1
+// @flow
2
+
3
+import React, { Component } from 'react';
4
+
5
+import { translate } from '../../../base/i18n';
6
+
7
+/**
8
+ * The type of the React {@code Component} props of
9
+ * {@link OverflowMenuLiveStreamingItem}.
10
+ */
11
+type Props = {
12
+
13
+    /**
14
+     * The callback to invoke when {@code OverflowMenuLiveStreamingItem} is
15
+     * clicked.
16
+     */
17
+    onClick: Function,
18
+
19
+    /**
20
+     * The current live streaming session, if any.
21
+     */
22
+    session: ?Object,
23
+
24
+    /**
25
+     * Invoked to obtain translated strings.
26
+     */
27
+    t: Function
28
+};
29
+
30
+/**
31
+ * React {@code Component} for starting or stopping a live streaming of the
32
+ * current conference and displaying the current state of live streaming.
33
+ *
34
+ * @extends Component
35
+ */
36
+class OverflowMenuLiveStreamingItem extends Component<Props> {
37
+    /**
38
+     * Implements React's {@link Component#render()}.
39
+     *
40
+     * @inheritdoc
41
+     * @returns {ReactElement}
42
+     */
43
+    render() {
44
+        const { onClick, session, t } = this.props;
45
+
46
+        const translationKey = session
47
+            ? 'dialog.stopLiveStreaming'
48
+            : 'dialog.startLiveStreaming';
49
+
50
+        return (
51
+            <li
52
+                aria-label = 'Live stream'
53
+                className = 'overflow-menu-item'
54
+                onClick = { onClick }>
55
+                <span className = 'overflow-menu-item-icon'>
56
+                    <i className = 'icon-public' />
57
+                </span>
58
+                <span className = 'profile-text'>
59
+                    { t(translationKey) }
60
+                </span>
61
+                <span className = 'beta-tag'>
62
+                    { t('recording.beta') }
63
+                </span>
64
+            </li>
65
+        );
66
+    }
67
+}
68
+
69
+export default translate(OverflowMenuLiveStreamingItem);

+ 6
- 25
react/features/toolbox/components/web/Toolbox.js 查看文件

@@ -53,6 +53,7 @@ import AudioMuteButton from '../AudioMuteButton';
53 53
 import HangupButton from '../HangupButton';
54 54
 import OverflowMenuButton from './OverflowMenuButton';
55 55
 import OverflowMenuItem from './OverflowMenuItem';
56
+import OverflowMenuLiveStreamingItem from './OverflowMenuLiveStreamingItem';
56 57
 import OverflowMenuProfileItem from './OverflowMenuProfileItem';
57 58
 import ToolbarButton from './ToolbarButton';
58 59
 import VideoMuteButton from '../VideoMuteButton';
@@ -941,30 +942,6 @@ class Toolbox extends Component<Props> {
941 942
         );
942 943
     }
943 944
 
944
-    /**
945
-     * Renders an {@code OverflowMenuItem} for starting or stopping a live
946
-     * streaming of the current conference.
947
-     *
948
-     * @private
949
-     * @returns {ReactElement}
950
-     */
951
-    _renderLiveStreamingButton() {
952
-        const { _liveStreamingSession, t } = this.props;
953
-
954
-        const translationKey = _liveStreamingSession
955
-            ? 'dialog.stopLiveStreaming'
956
-            : 'dialog.startLiveStreaming';
957
-
958
-        return (
959
-            <OverflowMenuItem
960
-                accessibilityLabel = 'Live stream'
961
-                icon = 'icon-public'
962
-                key = 'liveStreaming'
963
-                onClick = { this._onToolbarToggleLiveStreaming }
964
-                text = { t(translationKey) } />
965
-        );
966
-    }
967
-
968 945
     /**
969 946
      * Renders the list elements of the overflow menu.
970 947
      *
@@ -978,6 +955,7 @@ class Toolbox extends Component<Props> {
978 955
             _feedbackConfigured,
979 956
             _fullScreen,
980 957
             _isGuest,
958
+            _liveStreamingSession,
981 959
             _recordingEnabled,
982 960
             _sharingVideo,
983 961
             t
@@ -1006,7 +984,10 @@ class Toolbox extends Component<Props> {
1006 984
                         : t('toolbar.enterFullScreen') } />,
1007 985
             _recordingEnabled
1008 986
                 && this._shouldShowButton('livestreaming')
1009
-                && this._renderLiveStreamingButton(),
987
+                && <OverflowMenuLiveStreamingItem
988
+                    key = 'livestreaming'
989
+                    onClick = { this._onToolbarToggleLiveStreaming }
990
+                    session = { _liveStreamingSession } />,
1010 991
             _recordingEnabled
1011 992
                 && this._shouldShowButton('recording')
1012 993
                 && this._renderRecordingButton(),

Loading…
取消
儲存