Skip to content

Commit

Permalink
barebones
Browse files Browse the repository at this point in the history
  • Loading branch information
colobas committed Feb 7, 2024
1 parent 835a4b4 commit 83c7097
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/App.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script>
import './app.css'
//import './app.css'
import Router from 'svelte-spa-router';
import { routes } from './routes.js'
</script>
Expand Down
16 changes: 10 additions & 6 deletions src/Debate.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand All @@ -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);
}
});
Expand Down Expand Up @@ -70,3 +72,5 @@
</div>
{/each}
</div>

<a href="/">Voltar à página inicial</a>

0 comments on commit 83c7097

Please sign in to comment.