From b3826dc596926a5582897f1fadb428f8f0b34f20 Mon Sep 17 00:00:00 2001 From: Yoo Dongryul Date: Thu, 9 May 2024 17:37:45 +0900 Subject: [PATCH 1/9] Fix YouTube preview shows Video Unavailable --- .../src/components/youtube_video/youtube_video.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/webapp/channels/src/components/youtube_video/youtube_video.tsx b/webapp/channels/src/components/youtube_video/youtube_video.tsx index 80a69dbe6c4d8..9cc7621bc6eb7 100644 --- a/webapp/channels/src/components/youtube_video/youtube_video.tsx +++ b/webapp/channels/src/components/youtube_video/youtube_video.tsx @@ -49,6 +49,7 @@ export default class YoutubeVideo extends React.PureComponent { const {metadata, link} = this.props; const videoId = getVideoId(link); + const videoTitle = metadata?.title || 'unknown'; const time = handleYoutubeTime(link); const header = ( @@ -59,7 +60,7 @@ export default class YoutubeVideo extends React.PureComponent { href={this.props.link} location='youtube_video' > - {metadata?.title || 'unknown'} + {videoTitle} @@ -75,6 +76,12 @@ export default class YoutubeVideo extends React.PureComponent { height='360px' frameBorder='0' allowFullScreen={true} + allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" + referrerpolicy="strict-origin-when-cross-origin" + allowfullscreen="" + title={videoTitle} + sandbox="allow-scripts allow-same-origin allow-popups allow-presentation" + credentialless="true" /> ); } else { From 156264a9d19b69deaabb15b28b73649be8133a44 Mon Sep 17 00:00:00 2001 From: Yoo Dongryul Date: Thu, 9 May 2024 17:58:31 +0900 Subject: [PATCH 2/9] Fix typo on iframe property --- webapp/channels/src/components/youtube_video/youtube_video.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/channels/src/components/youtube_video/youtube_video.tsx b/webapp/channels/src/components/youtube_video/youtube_video.tsx index 9cc7621bc6eb7..428395443d170 100644 --- a/webapp/channels/src/components/youtube_video/youtube_video.tsx +++ b/webapp/channels/src/components/youtube_video/youtube_video.tsx @@ -77,7 +77,7 @@ export default class YoutubeVideo extends React.PureComponent { frameBorder='0' allowFullScreen={true} allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" - referrerpolicy="strict-origin-when-cross-origin" + referrerPolicy="strict-origin-when-cross-origin" allowfullscreen="" title={videoTitle} sandbox="allow-scripts allow-same-origin allow-popups allow-presentation" From 88e5376dec80ff16ddcdb4cee8650aa44e87bb6a Mon Sep 17 00:00:00 2001 From: Yoo Dongryul Date: Thu, 9 May 2024 17:58:57 +0900 Subject: [PATCH 3/9] Remove duplicated property --- webapp/channels/src/components/youtube_video/youtube_video.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/webapp/channels/src/components/youtube_video/youtube_video.tsx b/webapp/channels/src/components/youtube_video/youtube_video.tsx index 428395443d170..018126782b215 100644 --- a/webapp/channels/src/components/youtube_video/youtube_video.tsx +++ b/webapp/channels/src/components/youtube_video/youtube_video.tsx @@ -78,7 +78,6 @@ export default class YoutubeVideo extends React.PureComponent { allowFullScreen={true} allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerPolicy="strict-origin-when-cross-origin" - allowfullscreen="" title={videoTitle} sandbox="allow-scripts allow-same-origin allow-popups allow-presentation" credentialless="true" From 0f24353ccd3440fcd6a4ff363c06e780562ed6c0 Mon Sep 17 00:00:00 2001 From: Sn-Kinos Date: Sun, 9 Jun 2024 21:03:45 +0900 Subject: [PATCH 4/9] fix lint error (double-quotes, unknown property) --- .../src/components/youtube_video/youtube_video.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/webapp/channels/src/components/youtube_video/youtube_video.tsx b/webapp/channels/src/components/youtube_video/youtube_video.tsx index 018126782b215..8108544e13ace 100644 --- a/webapp/channels/src/components/youtube_video/youtube_video.tsx +++ b/webapp/channels/src/components/youtube_video/youtube_video.tsx @@ -76,11 +76,10 @@ export default class YoutubeVideo extends React.PureComponent { height='360px' frameBorder='0' allowFullScreen={true} - allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" - referrerPolicy="strict-origin-when-cross-origin" + allow='accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share' + referrerPolicy='strict-origin-when-cross-origin' title={videoTitle} - sandbox="allow-scripts allow-same-origin allow-popups allow-presentation" - credentialless="true" + sandbox='allow-scripts allow-same-origin allow-popups allow-presentation' /> ); } else { From 59ea2e1c07816208f40d46dafa4cfa915fabfa30 Mon Sep 17 00:00:00 2001 From: Sn-Kinos Date: Sun, 9 Jun 2024 21:23:41 +0900 Subject: [PATCH 5/9] renew snapshot for youtube_video.tsx --- .../__snapshots__/youtube_video.test.tsx.snap | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/webapp/channels/src/components/youtube_video/__snapshots__/youtube_video.test.tsx.snap b/webapp/channels/src/components/youtube_video/__snapshots__/youtube_video.test.tsx.snap index 7d836faf7adf9..b1f448020de08 100644 --- a/webapp/channels/src/components/youtube_video/__snapshots__/youtube_video.test.tsx.snap +++ b/webapp/channels/src/components/youtube_video/__snapshots__/youtube_video.test.tsx.snap @@ -39,7 +39,7 @@ exports[`YoutubeVideo should match init snapshot 1`] = ` - YouTube - + YouTube - - YouTube - + YouTube -