Fixed multiple things

This commit is contained in:
Mawoka
2023-06-09 13:38:36 +02:00
parent c220e3ae18
commit 09a09cf1cf
13 changed files with 170 additions and 37 deletions
@@ -5,11 +5,17 @@
-->
<script lang="ts">
import { browser } from '$app/environment';
export let src: string;
export let css_classes = 'max-h-64 h-auto w-auto';
export let muted = true;
let type: 'img' | 'video' | undefined = undefined;
const get_media = async () => {
if (!browser) {
return;
}
const res = await fetch(`/api/v1/storage/info/${src}`);
console.log('Headers', res.headers);
const fileType = res.headers.get('Content-Type');
@@ -46,13 +52,11 @@
<video
class={css_classes}
disablepictureinpicture
disableremoteplayback
x-webkit-airplay="deny"
controls
autoplay
loop
controlslist="nofullscreen,noremoteplayback"
muted
{muted}
preload="metadata"
>
<source src="/api/v1/storage/download/{src}" />