fix: .avi previews as video
This commit is contained in:
parent
86b36d6619
commit
423ec7b03a
3 changed files with 14 additions and 14 deletions
|
@ -12,12 +12,12 @@
|
|||
|
||||
$: mimeType = String($entity?.get("FILE_MIME"));
|
||||
|
||||
$: audio = ["audio", "application/x-riff"].some((p) =>
|
||||
mimeType.startsWith(p)
|
||||
);
|
||||
$: video = ["video", "application/x-matroska"].some((p) =>
|
||||
mimeType.startsWith(p)
|
||||
);
|
||||
$: audio =
|
||||
["audio", "application/x-riff"].some((p) => mimeType.startsWith(p)) &&
|
||||
!video;
|
||||
$: video =
|
||||
["video", "application/x-matroska"].some((p) => mimeType.startsWith(p)) ||
|
||||
$entity?.identify().some((l) => l.endsWith(".avi"));
|
||||
$: image = mimeType.startsWith("image");
|
||||
$: text = mimeType.startsWith("text");
|
||||
$: pdf = mimeType.startsWith("application/pdf");
|
||||
|
|
|
@ -19,12 +19,12 @@
|
|||
|
||||
$: mimeType = String($entity?.get("FILE_MIME"));
|
||||
|
||||
$: audio = ["audio", "application/x-riff"].some((p) =>
|
||||
mimeType.startsWith(p)
|
||||
);
|
||||
$: video = ["video", "application/x-matroska"].some((p) =>
|
||||
mimeType.startsWith(p)
|
||||
);
|
||||
$: audio =
|
||||
["audio", "application/x-riff"].some((p) => mimeType.startsWith(p)) &&
|
||||
!video;
|
||||
$: video =
|
||||
["video", "application/x-matroska"].some((p) => mimeType.startsWith(p)) ||
|
||||
$entity?.identify().some((l) => l.endsWith(".avi"));
|
||||
$: image = mimeType.startsWith("image");
|
||||
$: text = mimeType.startsWith("text");
|
||||
$: pdf = mimeType.startsWith("application/pdf");
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
<Spinner />
|
||||
<img
|
||||
class="thumb"
|
||||
src="api/thumb/{address}"
|
||||
src="api/thumb/{address}?mime=video"
|
||||
alt="Preview for {address}"
|
||||
on:load={() => (state = State.PREVIEW)}
|
||||
on:error={() => (state = State.ERRORED)}
|
||||
|
@ -63,7 +63,7 @@
|
|||
<video
|
||||
preload={detail ? "auto" : "metadata"}
|
||||
src="api/raw/{address}"
|
||||
poster="api/thumb/{address}"
|
||||
poster="api/thumb/{address}?mime=video"
|
||||
on:mousemove={updatePreviewPosition}
|
||||
on:mouseleave={resetPreview}
|
||||
on:click={startPlaying}
|
||||
|
|
Loading…
Reference in a new issue