···2727 capLevelToPlayerSize: true,
2828 startLevel: 1,
2929 xhrSetup(xhr, urlString) {
3030+ // We want to replace the URL here so it points directly to the CDN,
3131+ // and not the middleware service.
3232+ //
3333+ // The problem here is that the original playlist.m3u8 file doesn't
3434+ // contain definitions for the captions, they're added in by the
3535+ // middleware service.
3636+ //
3737+ // Hence this exception.
3838+ if (!urlString.endsWith('/playlist.m3u8')) {
3939+ urlString = replaceVideoCdnUrl(urlString);
4040+ }
4141+3042 const url = new URL(urlString);
31433232- // Just in case it fails, we'll remove `session_id` everywhere
4444+ // Remove `session_id` everywhere
3345 url.searchParams.delete('session_id');
34463547 xhr.open('get', url.toString());
···38503951 onCleanup(() => hls.destroy());
40524141- hls.loadSource(replaceVideoCdnUrl(embed.playlist));
5353+ hls.loadSource(embed.playlist);
42544355 return (
4456 <div class="contents">