diff --git a/__tests__/lib/string.test.ts b/__tests__/lib/string.test.ts index 03d68524..2f603a52 100644 --- a/__tests__/lib/string.test.ts +++ b/__tests__/lib/string.test.ts @@ -396,6 +396,7 @@ describe('parseEmbedPlayerFromUrl', () => { 'https://youtube.com/watch?v=videoId&feature=share', 'https://youtube.com/shorts/videoId', 'https://m.youtube.com/watch?v=videoId', + 'https://music.youtube.com/watch?v=videoId', 'https://youtube.com/shorts/', 'https://youtube.com/', @@ -504,6 +505,11 @@ describe('parseEmbedPlayerFromUrl', () => { source: 'youtube', playerUri: 'https://bsky.app/iframe/youtube.html?videoId=videoId&start=0', }, + { + type: 'youtube_video', + source: 'youtube', + playerUri: 'https://bsky.app/iframe/youtube.html?videoId=videoId&start=0', + }, undefined, undefined, diff --git a/src/lib/strings/embed-player.ts b/src/lib/strings/embed-player.ts index 5848f2af..d84ccc72 100644 --- a/src/lib/strings/embed-player.ts +++ b/src/lib/strings/embed-player.ts @@ -95,7 +95,8 @@ export function parseEmbedPlayerFromUrl( if ( urlp.hostname === 'www.youtube.com' || urlp.hostname === 'youtube.com' || - urlp.hostname === 'm.youtube.com' + urlp.hostname === 'm.youtube.com' || + urlp.hostname === 'music.youtube.com' ) { const [_, page, shortVideoId] = urlp.pathname.split('/') const videoId =