feat: add audio displaying
This commit is contained in:
parent
9262f436b6
commit
ae81ead712
@ -17,6 +17,8 @@ var extensions = map[string]string{
|
||||
|
||||
".png": "image", ".jpg": "image", ".jpeg": "image", ".webp": "image",
|
||||
|
||||
".mp3": "audio", ".aac": "audio", ".wav": "audio", ".flac": "audio", ".ogg": "audio",
|
||||
|
||||
".sh": "text", ".bash": "text", ".zsh": "text",
|
||||
".bat": "text", ".cmd": "text", ".ps1": "text",
|
||||
".ini": "text", ".cfg": "text", ".conf": "text",
|
||||
|
@ -213,12 +213,14 @@
|
||||
<source src="{{.Name}}" type="video/mp4" />
|
||||
Your browser does not support the video tag.
|
||||
</video>
|
||||
{{else}}
|
||||
<p>
|
||||
Couldn't detect file from extension, visit
|
||||
<a href="http://{{.Path}}">this link</a> to see/download your file.
|
||||
</p>
|
||||
{{end}}
|
||||
{{else if eq .Type "audio"}}
|
||||
<audio controls src="{{.Name}}"><audio />
|
||||
{{else}}
|
||||
<p>
|
||||
Couldn't detect file from extension, visit
|
||||
<a href="http://{{.Path}}">this link</a> to see/download your file.
|
||||
</p>
|
||||
{{end}}
|
||||
</div>
|
||||
<footer>file uploaded in {{.TimeUploaded}}</footer>
|
||||
</body>
|
||||
|
Loading…
Reference in New Issue
Block a user