From f8fb6cb9b3aabdc3cfb08675d63e48bdd5e43f61 Mon Sep 17 00:00:00 2001 From: Lars Kappert Date: Tue, 5 Nov 2024 13:43:20 +0100 Subject: Fix start value in youtube embed by removing "s" from url param (#6113) --- __tests__/lib/string.test.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to '__tests__') diff --git a/__tests__/lib/string.test.ts b/__tests__/lib/string.test.ts index f226de992..e212ef5c9 100644 --- a/__tests__/lib/string.test.ts +++ b/__tests__/lib/string.test.ts @@ -335,8 +335,10 @@ describe('shortenLinks', () => { describe('parseEmbedPlayerFromUrl', () => { const inputs = [ 'https://youtu.be/videoId', + 'https://youtu.be/videoId?t=1s', 'https://www.youtube.com/watch?v=videoId', 'https://www.youtube.com/watch?v=videoId&feature=share', + 'https://www.youtube.com/watch?v=videoId&t=1s', 'https://youtube.com/watch?v=videoId', 'https://youtube.com/watch?v=videoId&feature=share', 'https://youtube.com/shorts/videoId', @@ -441,6 +443,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=1', + }, { type: 'youtube_video', source: 'youtube', @@ -451,6 +458,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=1', + }, { type: 'youtube_video', source: 'youtube', -- cgit 1.4.1