From 297c79425a58422bceb9ebd4a96eab593f6d2127 Mon Sep 17 00:00:00 2001 From: Ayes Date: Mon, 10 Oct 2022 18:05:01 +0300 Subject: [PATCH] Added Youtube shorts support --- src/app/molecules/media/Media.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app/molecules/media/Media.jsx b/src/app/molecules/media/Media.jsx index 1177c0ca..9490e6c7 100644 --- a/src/app/molecules/media/Media.jsx +++ b/src/app/molecules/media/Media.jsx @@ -412,7 +412,7 @@ IframePlayer.propTypes = { function Embed({ link }) { const url = new URL(link); - if (settings.showYoutubeEmbedPlayer && (((url.host === 'www.youtube.com' || url.host === 'youtube.com') && url.pathname === '/watch') || url.host === 'youtu.be' || url.host === 'www.youtu.be')) { + if (settings.showYoutubeEmbedPlayer && (((url.host === 'www.youtube.com' || url.host === 'youtube.com') && (url.pathname === '/watch' || url.pathname.startsWith('/shorts/'))) || url.host === 'youtu.be' || url.host === 'www.youtu.be')) { return ; } @@ -478,6 +478,8 @@ function YoutubeEmbed({ link }) { let videoID; if (url.host === 'youtu.be' || url.host === 'www.youtu.be') { videoID = url.pathname.slice(1); + } else if (url.pathname.startsWith('/shorts/')) { + videoID = url.pathname.slice(8); } else { videoID = url.searchParams.get('v'); }