添加video预览

This commit is contained in:
赵鑫 2022-08-27 11:42:33 +08:00
parent dc449886bf
commit 35b84697cd
2 changed files with 10 additions and 7 deletions

View File

@ -6,7 +6,7 @@
body {
user-select: none;
max-width: 360px;
max-width: 480px;
margin: 0 auto;
}
@ -33,12 +33,13 @@ form button {
font-size: xx-small;
}
audio {
width: 360px;
audio,
video {
width: 480px;
}
img {
width: 360px;
width: 480px;
object-fit: cover;
}

View File

@ -28,12 +28,14 @@ html(lang='zh')
input(id='password_input' name='password' type='password' autocomplete='off' required)
button(id='download_button' type='submit') 下载
if !file.password
- var mimetype = file.mimetype.split('/')[0]
- var src = '/file/' + file.md5
- const mimetype = file.mimetype.split('/')[0]
- const src = '/file/' + file.md5
if mimetype == 'image'
p 预览
img(src=src)
if mimetype == 'audio'
p 预览
audio(controls src=src)
script(src='/client.js')
if mimetype == 'video'
p 预览
video(controls src=src)