remove unused build args, use env variables (#14)
This commit is contained in:
@@ -1,12 +1,11 @@
|
||||
import { transcriptions } from '$lib/stores';
|
||||
import { browser, dev } from '$app/environment';
|
||||
import { PUBLIC_INTERNAL_API_HOST } from '$env/static/public';
|
||||
import { CLIENT_API_HOST } from '$lib/utils';
|
||||
|
||||
/** @type {import('./$types').PageLoad} */
|
||||
export async function load({ fetch }) {
|
||||
// Use different endpoints for server-side and client-side
|
||||
const endpoint = browser ? `${CLIENT_API_HOST}/api/transcriptions` : `${PUBLIC_INTERNAL_API_HOST}/api/transcriptions`;
|
||||
const endpoint = browser ? `${CLIENT_API_HOST}/api/transcriptions` : `${process.env.INTERNAL_API_HOST}/api/transcriptions`;
|
||||
console.log(endpoint);
|
||||
|
||||
const response = await fetch(endpoint);
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
/** @type {import('./$types').PageLoad} */
|
||||
import { currentTranscription } from '$lib/stores';
|
||||
import { PUBLIC_INTERNAL_API_HOST } from '$env/static/public';
|
||||
import { CLIENT_API_HOST } from '$lib/utils';
|
||||
import { browser } from '$app/environment';
|
||||
|
||||
@@ -9,7 +8,7 @@ export async function load({params}) {
|
||||
let id = params.id;
|
||||
// Use different endpoints for server-side and client-side
|
||||
|
||||
const endpoint = browser ? `${CLIENT_API_HOST}/api/transcriptions` : `${PUBLIC_INTERNAL_API_HOST}/api/transcriptions`;
|
||||
const endpoint = browser ? `${CLIENT_API_HOST}/api/transcriptions` : `${process.env.INTERNAL_API_HOST}/api/transcriptions`;
|
||||
const response = await fetch(`${endpoint}/${id}`);
|
||||
const ts = await response.json();
|
||||
// Set currentTranscription to the fetched transcription
|
||||
|
||||
@@ -11,28 +11,29 @@
|
||||
let canPlay = false;
|
||||
$: if(canPlay && video && Math.abs(video.currentTime - $currentVideoPlayerTime) > tolerance) {
|
||||
console.log(video.currentTime, $currentVideoPlayerTime)
|
||||
// When testing in Chrome, it works, just see https://stackoverflow.com/a/67584611
|
||||
video.currentTime = $currentVideoPlayerTime;
|
||||
}
|
||||
</script>
|
||||
|
||||
<Toaster />
|
||||
{#if $currentTranscription}
|
||||
<div class="grid grid-cols-3 h-screen overflow-hidden">
|
||||
<div class="col-span-1 bg-transparent overflow-hidden">
|
||||
<div class="h-full w-full relative">
|
||||
<div class="grid h-screen grid-cols-3 overflow-hidden">
|
||||
<div class="col-span-1 overflow-hidden bg-transparent">
|
||||
<div class="relative w-full h-full">
|
||||
<video id="video"
|
||||
controls
|
||||
bind:this={video}
|
||||
on:timeupdate={(e) => $currentVideoPlayerTime.set(e.target.currentTime)}
|
||||
on:timeupdate={(e) => $currentVideoPlayerTime = e.target.currentTime}
|
||||
on:canplay={() => canPlay = true}
|
||||
on:loadedmetadata={() => canPlay = true}
|
||||
class="absolute top-0 left-0 h-full w-full">
|
||||
class="absolute top-0 left-0 w-full h-full">
|
||||
<source src="{CLIENT_API_HOST}/api/video/{$currentTranscription.fileName}" type="video/mp4" />
|
||||
<track kind="captions" />
|
||||
</video>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-span-2 bg-content overflow-auto">
|
||||
<div class="col-span-2 overflow-auto bg-content">
|
||||
<Editor />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user