feat: finish audiotrack switching

This commit is contained in:
Adrian Castro
2024-03-07 13:12:14 +01:00
parent fd1928c43d
commit 6deb39e8a7
8 changed files with 125 additions and 51 deletions

View File

@@ -142,12 +142,13 @@ export const ScraperProcess = ({ data }: ScraperProcessProps) => {
if (streamResult.stream.type === "hls") {
const tracks = await extractTracksFromHLS(
streamResult.stream.playlist, // multiple audio tracks: 'https://playertest.longtailvideo.com/adaptive/elephants_dream_v4/index.m3u8',
streamResult.stream.playlist,
{
...streamResult.stream.preferredHeaders,
...streamResult.stream.headers,
},
);
if (tracks) setHlsTracks(tracks);
const constructFullUrl = (playlistUrl: string, uri: string) => {