mirror of
https://github.com/plebbit/seedit.git
synced 2026-02-15 08:21:19 -05:00
fix(media utils): add m.youtube
This commit is contained in:
@@ -43,7 +43,7 @@ interface EmbedComponentProps {
|
||||
parsedUrl: URL;
|
||||
}
|
||||
|
||||
const youtubeHosts = new Set<string>(['youtube.com', 'www.youtube.com', 'youtu.be', 'www.youtu.be']);
|
||||
const youtubeHosts = new Set<string>(['youtube.com', 'www.youtube.com', 'youtu.be', 'www.youtu.be', 'm.youtube.com']);
|
||||
|
||||
const YoutubeEmbed = ({ parsedUrl }: EmbedComponentProps) => {
|
||||
let youtubeId;
|
||||
|
||||
@@ -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')) {
|
||||
|
||||
Reference in New Issue
Block a user