From dbbdcb0b003094e01f9d09899d3a2ef196e0b663 Mon Sep 17 00:00:00 2001 From: Hristo Terezov Date: Fri, 3 Apr 2020 16:04:28 -0500 Subject: [PATCH] feat(live-streaming): Add T&C. --- lang/main.json | 4 +- .../components/LiveStream/constants.js | 13 ++++- .../LiveStream/native/StreamKeyForm.js | 56 +++++++++++++++++++ .../components/LiveStream/native/styles.js | 7 +++ .../LiveStream/web/StreamKeyForm.js | 45 ++++++++++----- 5 files changed, 108 insertions(+), 17 deletions(-) diff --git a/lang/main.json b/lang/main.json index d9a0aff9f..015c10c76 100644 --- a/lang/main.json +++ b/lang/main.json @@ -395,7 +395,9 @@ "signOut": "Sign out", "start": "Start a live stream", "streamIdHelp": "What's this?", - "unavailableTitle": "Live Streaming unavailable" + "unavailableTitle": "Live Streaming unavailable", + "youtubeTerms": "YouTube terms of services", + "googlePrivacyPolicy": "Google Privacy Policy" }, "localRecording": { "clientState": { diff --git a/react/features/recording/components/LiveStream/constants.js b/react/features/recording/components/LiveStream/constants.js index fec5b3d47..2c7ef8b47 100644 --- a/react/features/recording/components/LiveStream/constants.js +++ b/react/features/recording/components/LiveStream/constants.js @@ -1,6 +1,15 @@ +/** + * The URL for Google Privacy Policy. + */ +export const GOOGLE_PRIVACY_POLICY = 'https://policies.google.com/privacy'; + /** * The URL that is the main landing page for YouTube live streaming and should * have a user's live stream key. */ -export const YOUTUBE_LIVE_DASHBOARD_URL - = 'https://www.youtube.com/live_dashboard'; +export const YOUTUBE_LIVE_DASHBOARD_URL = 'https://www.youtube.com/live_dashboard'; + +/** + * The URL for YouTube terms and conditions. + */ +export const YOUTUBE_TERMS_URL = 'https://www.youtube.com/t/terms'; diff --git a/react/features/recording/components/LiveStream/native/StreamKeyForm.js b/react/features/recording/components/LiveStream/native/StreamKeyForm.js index bd2ab45e7..35004e81f 100644 --- a/react/features/recording/components/LiveStream/native/StreamKeyForm.js +++ b/react/features/recording/components/LiveStream/native/StreamKeyForm.js @@ -11,6 +11,7 @@ import { StyleType } from '../../../../base/styles'; import AbstractStreamKeyForm, { type Props as AbstractProps } from '../AbstractStreamKeyForm'; +import { GOOGLE_PRIVACY_POLICY, YOUTUBE_TERMS_URL } from '../constants'; type Props = AbstractProps & { @@ -38,7 +39,10 @@ class StreamKeyForm extends AbstractStreamKeyForm { super(props); // Bind event handlers so they are only bound once per instance. + this._onOpenGooglePrivacyPolicy = this._onOpenGooglePrivacyPolicy.bind(this); this._onOpenHelp = this._onOpenHelp.bind(this); + this._onOpenYoutubeTerms = this._onOpenYoutubeTerms.bind(this); + } /** @@ -101,12 +105,52 @@ class StreamKeyForm extends AbstractStreamKeyForm { + + + + { + t('liveStreaming.youtubeTerms') + } + + + + + + + { + t('liveStreaming.googlePrivacyPolicy') + } + + + ); } _onInputChange: Object => void + _onOpenGooglePrivacyPolicy: () => void; + + /** + * Opens the Google Privacy Policy web page. + * + * @private + * @returns {void} + */ + _onOpenGooglePrivacyPolicy() { + Linking.openURL(GOOGLE_PRIVACY_POLICY); + } + _onOpenHelp: () => void /** @@ -123,6 +167,18 @@ class StreamKeyForm extends AbstractStreamKeyForm { Linking.openURL(helpURL); } } + + _onOpenYoutubeTerms: () => void; + + /** + * Opens the YouTube terms and conditions web page. + * + * @private + * @returns {void} + */ + _onOpenYoutubeTerms() { + Linking.openURL(YOUTUBE_TERMS_URL); + } } export default translate(connect(_abstractMapStateToProps)(StreamKeyForm)); diff --git a/react/features/recording/components/LiveStream/native/styles.js b/react/features/recording/components/LiveStream/native/styles.js index 299714124..58943d0d8 100644 --- a/react/features/recording/components/LiveStream/native/styles.js +++ b/react/features/recording/components/LiveStream/native/styles.js @@ -145,6 +145,13 @@ export default createStyleSheet({ flexDirection: 'column' }, + /** + * Terms and Conditions texts. + */ + tcText: { + textAlign: 'right' + }, + text: { fontSize: 14, textAlign: 'left' diff --git a/react/features/recording/components/LiveStream/web/StreamKeyForm.js b/react/features/recording/components/LiveStream/web/StreamKeyForm.js index a66c12135..5a5a94f08 100644 --- a/react/features/recording/components/LiveStream/web/StreamKeyForm.js +++ b/react/features/recording/components/LiveStream/web/StreamKeyForm.js @@ -8,6 +8,7 @@ import { translate } from '../../../../base/i18n'; import AbstractStreamKeyForm, { type Props } from '../AbstractStreamKeyForm'; +import { GOOGLE_PRIVACY_POLICY, YOUTUBE_TERMS_URL } from '../constants'; /** * A React Component for entering a key for starting a YouTube live stream. @@ -53,21 +54,37 @@ class StreamKeyForm extends AbstractStreamKeyForm { type = 'text' value = { this.props.value } />
- { - this.state.showValidationError - ? - { t('liveStreaming.invalidStreamKey') } - +
+ { + this.state.showValidationError + ? + { t('liveStreaming.invalidStreamKey') } + + : null + } + { this.helpURL + ? + { t('liveStreaming.streamIdHelp') } + : null - } - { this.helpURL - ? - { t('liveStreaming.streamIdHelp') } - - : null - } + } +
+ + { t('liveStreaming.youtubeTerms') } + + + { t('liveStreaming.googlePrivacyPolicy') } +
);