diff --git a/src/components/post/embed/embed.tsx b/src/components/post/embed/embed.tsx index dceed497..7d7d3a8e 100644 --- a/src/components/post/embed/embed.tsx +++ b/src/components/post/embed/embed.tsx @@ -43,7 +43,7 @@ interface EmbedComponentProps { parsedUrl: URL; } -const youtubeHosts = new Set(['youtube.com', 'www.youtube.com', 'youtu.be', 'www.youtu.be']); +const youtubeHosts = new Set(['youtube.com', 'www.youtube.com', 'youtu.be', 'www.youtu.be', 'm.youtube.com']); const YoutubeEmbed = ({ parsedUrl }: EmbedComponentProps) => { let youtubeId; diff --git a/src/lib/utils/media-utils.ts b/src/lib/utils/media-utils.ts index bb0ad11c..7d8e0159 100644 --- a/src/lib/utils/media-utils.ts +++ b/src/lib/utils/media-utils.ts @@ -39,7 +39,7 @@ const getCommentMediaInfo = (comment: Comment) => { const host = url.hostname; let patternThumbnailUrl; - if (['youtube.com', 'www.youtube.com', 'youtu.be'].includes(host)) { + if (['youtube.com', 'www.youtube.com', 'youtu.be', 'www.youtu.be', 'm.youtube.com'].includes(host)) { const videoId = host === 'youtu.be' ? url.pathname.slice(1) : url.searchParams.get('v'); patternThumbnailUrl = `https://img.youtube.com/vi/${videoId}/0.jpg`; } else if (host.includes('streamable.com')) {