浏览代码

feat(live-streaming): Add T&C.

master
Hristo Terezov 5 年前
父节点
当前提交
dbbdcb0b00

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

@@ -395,7 +395,9 @@
395 395
         "signOut": "Sign out",
396 396
         "start": "Start a live stream",
397 397
         "streamIdHelp": "What's this?",
398
-        "unavailableTitle": "Live Streaming unavailable"
398
+        "unavailableTitle": "Live Streaming unavailable",
399
+        "youtubeTerms": "YouTube terms of services",
400
+        "googlePrivacyPolicy": "Google Privacy Policy"
399 401
     },
400 402
     "localRecording": {
401 403
         "clientState": {

+ 11
- 2
react/features/recording/components/LiveStream/constants.js 查看文件

@@ -1,6 +1,15 @@
1
+/**
2
+ * The URL for Google Privacy Policy.
3
+ */
4
+export const GOOGLE_PRIVACY_POLICY = 'https://policies.google.com/privacy';
5
+
1 6
 /**
2 7
  * The URL that is the main landing page for YouTube live streaming and should
3 8
  * have a user's live stream key.
4 9
  */
5
-export const YOUTUBE_LIVE_DASHBOARD_URL
6
-    = 'https://www.youtube.com/live_dashboard';
10
+export const YOUTUBE_LIVE_DASHBOARD_URL = 'https://www.youtube.com/live_dashboard';
11
+
12
+/**
13
+ * The URL for YouTube terms and conditions.
14
+ */
15
+export const YOUTUBE_TERMS_URL = 'https://www.youtube.com/t/terms';

+ 56
- 0
react/features/recording/components/LiveStream/native/StreamKeyForm.js 查看文件

@@ -11,6 +11,7 @@ import { StyleType } from '../../../../base/styles';
11 11
 import AbstractStreamKeyForm, {
12 12
     type Props as AbstractProps
13 13
 } from '../AbstractStreamKeyForm';
14
+import { GOOGLE_PRIVACY_POLICY, YOUTUBE_TERMS_URL } from '../constants';
14 15
 
15 16
 type Props = AbstractProps & {
16 17
 
@@ -38,7 +39,10 @@ class StreamKeyForm extends AbstractStreamKeyForm<Props> {
38 39
         super(props);
39 40
 
40 41
         // Bind event handlers so they are only bound once per instance.
42
+        this._onOpenGooglePrivacyPolicy = this._onOpenGooglePrivacyPolicy.bind(this);
41 43
         this._onOpenHelp = this._onOpenHelp.bind(this);
44
+        this._onOpenYoutubeTerms = this._onOpenYoutubeTerms.bind(this);
45
+
42 46
     }
43 47
 
44 48
     /**
@@ -101,12 +105,52 @@ class StreamKeyForm extends AbstractStreamKeyForm<Props> {
101 105
                         </TouchableOpacity>
102 106
                     </View>
103 107
                 </View>
108
+                <View>
109
+                    <TouchableOpacity onPress = { this._onOpenYoutubeTerms }>
110
+                        <Text
111
+                            style = { [
112
+                                _dialogStyles.text,
113
+                                styles.text,
114
+                                styles.tcText
115
+                            ] }>
116
+                            {
117
+                                t('liveStreaming.youtubeTerms')
118
+                            }
119
+                        </Text>
120
+                    </TouchableOpacity>
121
+                </View>
122
+                <View>
123
+                    <TouchableOpacity onPress = { this._onOpenGooglePrivacyPolicy }>
124
+                        <Text
125
+                            style = { [
126
+                                _dialogStyles.text,
127
+                                styles.text,
128
+                                styles.tcText
129
+                            ] }>
130
+                            {
131
+                                t('liveStreaming.googlePrivacyPolicy')
132
+                            }
133
+                        </Text>
134
+                    </TouchableOpacity>
135
+                </View>
104 136
             </View>
105 137
         );
106 138
     }
107 139
 
108 140
     _onInputChange: Object => void
109 141
 
142
+    _onOpenGooglePrivacyPolicy: () => void;
143
+
144
+    /**
145
+     * Opens the Google Privacy Policy web page.
146
+     *
147
+     * @private
148
+     * @returns {void}
149
+     */
150
+    _onOpenGooglePrivacyPolicy() {
151
+        Linking.openURL(GOOGLE_PRIVACY_POLICY);
152
+    }
153
+
110 154
     _onOpenHelp: () => void
111 155
 
112 156
     /**
@@ -123,6 +167,18 @@ class StreamKeyForm extends AbstractStreamKeyForm<Props> {
123 167
             Linking.openURL(helpURL);
124 168
         }
125 169
     }
170
+
171
+    _onOpenYoutubeTerms: () => void;
172
+
173
+    /**
174
+     * Opens the YouTube terms and conditions web page.
175
+     *
176
+     * @private
177
+     * @returns {void}
178
+     */
179
+    _onOpenYoutubeTerms() {
180
+        Linking.openURL(YOUTUBE_TERMS_URL);
181
+    }
126 182
 }
127 183
 
128 184
 export default translate(connect(_abstractMapStateToProps)(StreamKeyForm));

+ 7
- 0
react/features/recording/components/LiveStream/native/styles.js 查看文件

@@ -145,6 +145,13 @@ export default createStyleSheet({
145 145
         flexDirection: 'column'
146 146
     },
147 147
 
148
+    /**
149
+     * Terms and Conditions texts.
150
+     */
151
+    tcText: {
152
+        textAlign: 'right'
153
+    },
154
+
148 155
     text: {
149 156
         fontSize: 14,
150 157
         textAlign: 'left'

+ 31
- 14
react/features/recording/components/LiveStream/web/StreamKeyForm.js 查看文件

@@ -8,6 +8,7 @@ import { translate } from '../../../../base/i18n';
8 8
 import AbstractStreamKeyForm, {
9 9
     type Props
10 10
 } from '../AbstractStreamKeyForm';
11
+import { GOOGLE_PRIVACY_POLICY, YOUTUBE_TERMS_URL } from '../constants';
11 12
 
12 13
 /**
13 14
  * A React Component for entering a key for starting a YouTube live stream.
@@ -53,21 +54,37 @@ class StreamKeyForm extends AbstractStreamKeyForm<Props> {
53 54
                     type = 'text'
54 55
                     value = { this.props.value } />
55 56
                 <div className = 'form-footer'>
56
-                    {
57
-                        this.state.showValidationError
58
-                            ? <span className = 'warning-text'>
59
-                                { t('liveStreaming.invalidStreamKey') }
60
-                            </span>
57
+                    <div className = 'help-container'>
58
+                        {
59
+                            this.state.showValidationError
60
+                                ? <span className = 'warning-text'>
61
+                                    { t('liveStreaming.invalidStreamKey') }
62
+                                </span>
63
+                                : null
64
+                        }
65
+                        { this.helpURL
66
+                            ? <a
67
+                                className = 'helper-link'
68
+                                onClick = { this._onOpenHelp }>
69
+                                { t('liveStreaming.streamIdHelp') }
70
+                            </a>
61 71
                             : null
62
-                    }
63
-                    { this.helpURL
64
-                        ? <a
65
-                            className = 'helper-link'
66
-                            onClick = { this._onOpenHelp }>
67
-                            { t('liveStreaming.streamIdHelp') }
68
-                        </a>
69
-                        : null
70
-                    }
72
+                        }
73
+                    </div>
74
+                    <a
75
+                        className = 'helper-link'
76
+                        href = { YOUTUBE_TERMS_URL }
77
+                        rel = 'noopener noreferrer'
78
+                        target = '_blank'>
79
+                        { t('liveStreaming.youtubeTerms') }
80
+                    </a>
81
+                    <a
82
+                        className = 'helper-link'
83
+                        href = { GOOGLE_PRIVACY_POLICY }
84
+                        rel = 'noopener noreferrer'
85
+                        target = '_blank'>
86
+                        { t('liveStreaming.googlePrivacyPolicy') }
87
+                    </a>
71 88
                 </div>
72 89
             </div>
73 90
         );

正在加载...
取消
保存