diff --git a/__tests__/lib/string.test.ts b/__tests__/lib/string.test.ts index b3aa48f4..f003e5ac 100644 --- a/__tests__/lib/string.test.ts +++ b/__tests__/lib/string.test.ts @@ -462,45 +462,38 @@ describe('parseEmbedPlayerFromUrl', () => { { type: 'youtube_video', source: 'youtube', - playerUri: - 'https://www.youtube.com/embed/videoId?autoplay=1&playsinline=1&start=0', + playerUri: 'https://bsky.app/iframe/youtube.html?videoId=videoId&start=0', }, { type: 'youtube_video', source: 'youtube', - playerUri: - 'https://www.youtube.com/embed/videoId?autoplay=1&playsinline=1&start=0', + playerUri: 'https://bsky.app/iframe/youtube.html?videoId=videoId&start=0', }, { type: 'youtube_video', source: 'youtube', - playerUri: - 'https://www.youtube.com/embed/videoId?autoplay=1&playsinline=1&start=0', + playerUri: 'https://bsky.app/iframe/youtube.html?videoId=videoId&start=0', }, { type: 'youtube_video', source: 'youtube', - playerUri: - 'https://www.youtube.com/embed/videoId?autoplay=1&playsinline=1&start=0', + playerUri: 'https://bsky.app/iframe/youtube.html?videoId=videoId&start=0', }, { type: 'youtube_video', source: 'youtube', - playerUri: - 'https://www.youtube.com/embed/videoId?autoplay=1&playsinline=1&start=0', + playerUri: 'https://bsky.app/iframe/youtube.html?videoId=videoId&start=0', }, { type: 'youtube_short', source: 'youtubeShorts', hideDetails: true, - playerUri: - 'https://www.youtube.com/embed/videoId?autoplay=1&playsinline=1&start=0', + playerUri: 'https://bsky.app/iframe/youtube.html?videoId=videoId&start=0', }, { type: 'youtube_video', source: 'youtube', - playerUri: - 'https://www.youtube.com/embed/videoId?autoplay=1&playsinline=1&start=0', + playerUri: 'https://bsky.app/iframe/youtube.html?videoId=videoId&start=0', }, undefined, @@ -759,8 +752,6 @@ describe('parseEmbedPlayerFromUrl', () => { const res = parseEmbedPlayerFromUrl(input) - console.log(input) - expect(res).toEqual(output) } }) diff --git a/bskyweb/cmd/bskyweb/server.go b/bskyweb/cmd/bskyweb/server.go index c4a12a2f..76b7bcc0 100644 --- a/bskyweb/cmd/bskyweb/server.go +++ b/bskyweb/cmd/bskyweb/server.go @@ -159,6 +159,7 @@ func serve(cctx *cli.Context) error { e.GET("/security.txt", func(c echo.Context) error { return c.Redirect(http.StatusMovedPermanently, "/.well-known/security.txt") }) + e.GET("/iframe/youtube.html", echo.WrapHandler(staticHandler)) e.GET("/static/*", echo.WrapHandler(http.StripPrefix("/static/", staticHandler)), func(next echo.HandlerFunc) echo.HandlerFunc { return func(c echo.Context) error { path := c.Request().URL.Path diff --git a/bskyweb/static/iframe/youtube.html b/bskyweb/static/iframe/youtube.html new file mode 100644 index 00000000..f2ada2ec --- /dev/null +++ b/bskyweb/static/iframe/youtube.html @@ -0,0 +1,49 @@ + + +