From 83c7097bfcbdcbe38204eccd124ad2802d1641b4 Mon Sep 17 00:00:00 2001 From: Guilherme Pires Date: Tue, 6 Feb 2024 20:09:17 -0700 Subject: [PATCH] barebones --- src/App.svelte | 2 +- src/Debate.svelte | 16 ++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) 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