Disable video player for mastroska files because no browser actually supports them anymore

This commit is contained in:
2024-06-18 16:47:57 +02:00
parent dfb471063c
commit eef2c3156d
3 changed files with 7 additions and 3 deletions

View File

@@ -43,9 +43,8 @@ export const file_type = file => {
} else if (file.mime_type.startsWith("image")) {
return "image"
} else if (
file.mime_type.startsWith("video") ||
file.mime_type === "application/matroska" ||
file.mime_type === "application/x-matroska"
file.mime_type.startsWith("video") &&
file.mime_type !== "video/x-matroska"
) {
return "video"
} else if (

View File

@@ -3,6 +3,7 @@ import { createEventDispatcher } from "svelte";
import BandwidthUsage from "./BandwidthUsage.svelte";
import IconBlock from "./IconBlock.svelte";
import FileTitle from "./FileTitle.svelte";
import { formatDataVolume } from "../../util/Formatting.svelte";
let dispatch = createEventDispatcher()
export const set_file = f => file = f
@@ -21,6 +22,7 @@ let file = {
<IconBlock icon_href={file.icon_href}>
Type: {file.mime_type}<br/>
Size: {formatDataVolume(file.size, 3)}<br/>
No preview is available for this file type. Download to view it locally.
<br/>
<button class="button_highlight" on:click={() => {dispatch("download")}}>

View File

@@ -170,6 +170,9 @@ const fullscreen = () => {
<button on:click={download}>
<i class="icon">download</i> Download
</button>
<a href="/login" class="button">
<i class="icon">login</i> Log in
</a>
<a href="/register" class="button">
<i class="icon">how_to_reg</i> Sign up
</a>