feat: add audio displaying

This commit is contained in:
jabuxas 2024-10-29 19:28:14 -03:00
parent 9262f436b6
commit ae81ead712
2 changed files with 10 additions and 6 deletions

View File

@ -17,6 +17,8 @@ var extensions = map[string]string{
".png": "image", ".jpg": "image", ".jpeg": "image", ".webp": "image", ".png": "image", ".jpg": "image", ".jpeg": "image", ".webp": "image",
".mp3": "audio", ".aac": "audio", ".wav": "audio", ".flac": "audio", ".ogg": "audio",
".sh": "text", ".bash": "text", ".zsh": "text", ".sh": "text", ".bash": "text", ".zsh": "text",
".bat": "text", ".cmd": "text", ".ps1": "text", ".bat": "text", ".cmd": "text", ".ps1": "text",
".ini": "text", ".cfg": "text", ".conf": "text", ".ini": "text", ".cfg": "text", ".conf": "text",

View File

@ -213,6 +213,8 @@
<source src="{{.Name}}" type="video/mp4" /> <source src="{{.Name}}" type="video/mp4" />
Your browser does not support the video tag. Your browser does not support the video tag.
</video> </video>
{{else if eq .Type "audio"}}
<audio controls src="{{.Name}}"><audio />
{{else}} {{else}}
<p> <p>
Couldn't detect file from extension, visit Couldn't detect file from extension, visit