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,12 +213,14 @@
<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}} {{else if eq .Type "audio"}}
<p> <audio controls src="{{.Name}}"><audio />
Couldn't detect file from extension, visit {{else}}
<a href="http://{{.Path}}">this link</a> to see/download your file. <p>
</p> Couldn't detect file from extension, visit
{{end}} <a href="http://{{.Path}}">this link</a> to see/download your file.
</p>
{{end}}
</div> </div>
<footer>file uploaded in {{.TimeUploaded}}</footer> <footer>file uploaded in {{.TimeUploaded}}</footer>
</body> </body>