diff --git a/src/App.svelte b/src/App.svelte index 4a5ef52..58400a5 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -1,5 +1,5 @@ diff --git a/src/Debate.svelte b/src/Debate.svelte index bdcade9..99dfd3a 100644 --- a/src/Debate.svelte +++ b/src/Debate.svelte @@ -16,7 +16,7 @@ // Async function to fetch transcripts async function fetchTranscripts() { - const response = await fetch(`/debates/transcripts/${params.slug}.json`); + const response = await fetch(`/debates/transcriptions/${params.slug}.json`); transcripts = await response.json(); } @@ -28,13 +28,15 @@ if (Hls.isSupported()) { const hls = new Hls({ xhrSetup: function(xhr, url) { - // Apply headers from debateData to the request - Object.keys(debateData.headers).forEach(header => { - xhr.setRequestHeader(header, debateData.headers[header]); - }); + // Apply headers from debateData to the request, only if they exist + if (debateData.headers) { + Object.keys(debateData.headers).forEach(header => { + xhr.setRequestHeader(header, debateData.headers[header]); + }); + } } }); - hls.loadSource(debateData.videoUrl); + hls.loadSource(debateData.m3u8_url); hls.attachMedia(video); } }); @@ -70,3 +72,5 @@ {/each} + +Voltar à página inicial