personal web client for Bluesky
typescript solidjs bluesky atcute
4
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: add exception for playlist url

mary.my.id d356d7d5 b7296097

verified
+14 -2
+14 -2
src/components/embeds/players/video-player.tsx
··· 27 27 capLevelToPlayerSize: true, 28 28 startLevel: 1, 29 29 xhrSetup(xhr, urlString) { 30 + // We want to replace the URL here so it points directly to the CDN, 31 + // and not the middleware service. 32 + // 33 + // The problem here is that the original playlist.m3u8 file doesn't 34 + // contain definitions for the captions, they're added in by the 35 + // middleware service. 36 + // 37 + // Hence this exception. 38 + if (!urlString.endsWith('/playlist.m3u8')) { 39 + urlString = replaceVideoCdnUrl(urlString); 40 + } 41 + 30 42 const url = new URL(urlString); 31 43 32 - // Just in case it fails, we'll remove `session_id` everywhere 44 + // Remove `session_id` everywhere 33 45 url.searchParams.delete('session_id'); 34 46 35 47 xhr.open('get', url.toString()); ··· 38 50 39 51 onCleanup(() => hls.destroy()); 40 52 41 - hls.loadSource(replaceVideoCdnUrl(embed.playlist)); 53 + hls.loadSource(embed.playlist); 42 54 43 55 return ( 44 56 <div class="contents">