Skip to content

Commit 4477d40

Browse files
Hieu Lam - TMAkhangon
andauthored
feature-9005: Provide option of Youtube integration with Privacy Enhanced Mode (#9042)
* feature-9005: Provide option of Youtube integration with Privacy Enhanced Mode * feature-9005: Provide option of Youtube integration with Privacy Enhanced Mode --------- Co-authored-by: Khang On - TMA <[email protected]>
1 parent fae3a2a commit 4477d40

File tree

3 files changed

+41
-6
lines changed

3 files changed

+41
-6
lines changed

app/components/forms/events/view/videoroom-form.hbs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@
5656
@site="youtube"
5757
@value={{this.data.stream.url}}
5858
@onChange={{action (mut this.data.stream.url)}} />
59+
{{else if (eq this.data.stream.videoChannel.provider 'youtube_privacy')}}
60+
<Widgets::Forms::SocialLinkField
61+
@fixed={{true}}
62+
@site="youtube privacy"
63+
@value={{this.data.stream.url}}
64+
@onChange={{action (mut this.data.stream.url)}} />
5965
{{else if (eq this.data.stream.videoChannel.provider 'vimeo')}}
6066
<Widgets::Forms::SocialLinkField
6167
@fixed={{true}}
@@ -92,7 +98,7 @@
9298
<Textarea
9399
@value={{this.data.stream.additionalInformation}} />
94100
</div>
95-
{{#if (or (eq this.data.stream.videoChannel.provider 'youtube') (eq this.data.stream.videoChannel.provider 'vimeo'))}}
101+
{{#if (or (eq this.data.stream.videoChannel.provider 'youtube_privacy') (or (eq this.data.stream.videoChannel.provider 'youtube') (eq this.data.stream.videoChannel.provider 'vimeo')))}}
96102
<div class="field">
97103
<label for="public_name">
98104
{{t 'Autoplay'}}

app/components/forms/events/view/videoroom-form.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,12 @@ export default class VideoroomForm extends Component.extend(FormMixin) {
306306
this.data.stream.set('url', 'watch?v=');
307307
}
308308

309+
@action
310+
async addYoutubePrivacy() {
311+
this.data.stream.set('extra', { autoplay: true, loop: false });
312+
this.data.stream.set('url', 'watch?v=');
313+
}
314+
309315
@action
310316
async addVimeo() {
311317
this.data.stream.set('extra', { autoplay: true, loop: false });
@@ -327,6 +333,9 @@ export default class VideoroomForm extends Component.extend(FormMixin) {
327333
case 'youtube':
328334
this.addYoutube();
329335
break;
336+
case 'youtube_privacy':
337+
this.addYoutubePrivacy();
338+
break;
330339
case 'vimeo':
331340
this.addVimeo();
332341
break;
@@ -573,7 +582,7 @@ export default class VideoroomForm extends Component.extend(FormMixin) {
573582
}
574583
if (
575584
this.data.stream.extra === null
576-
&& ['vimeo', 'youtube'].includes(
585+
&& ['vimeo', 'youtube', 'youtube_privacy'].includes(
577586
this.data.stream.videoChannel.get('provider')
578587
)
579588
) {

app/utils/dictionary/social-media.ts

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,23 @@
1-
export const socialMediaNames = ['Facebook', 'Flickr', 'GitHub', 'GitLab', 'Gitter', 'Google Groups', 'Instagram', 'Linkedin', 'Mastodon', 'Patreon', 'Telegram', 'Twitter', 'Vimeo', 'VK', 'Weibo', 'Xing', 'YouTube'];
1+
export const socialMediaNames = [
2+
'Facebook',
3+
'Flickr',
4+
'GitHub',
5+
'GitLab',
6+
'Gitter',
7+
'Google Groups',
8+
'Instagram',
9+
'Linkedin',
10+
'Mastodon',
11+
'Patreon',
12+
'Telegram',
13+
'Twitter',
14+
'Vimeo',
15+
'VK',
16+
'Weibo',
17+
'Xing',
18+
'YouTube',
19+
'YouTube Privacy'
20+
];
221

322
const identifierOverrides: { [key: string]: string } = {
423
'Google Groups': 'groups.google'
@@ -9,9 +28,10 @@ export const socialMediaIdentifiers = socialMediaNames.map(name => {
928
});
1029

1130
const prefixOverrides: { [key: string]: string } = {
12-
'gitter' : 'https://gitter.im/',
13-
'telegram' : 'https://t.me/',
14-
'mastodon' : 'https://'
31+
'gitter' : 'https://gitter.im/',
32+
'telegram' : 'https://t.me/',
33+
'mastodon' : 'https://',
34+
'youtube privacy' : 'https://youtube-nocookie.com/'
1535
};
1636

1737
export interface SocialMedia {

0 commit comments

Comments
 (0)