forked from mirrors/amputoma-fe
fix videos
This commit is contained in:
parent
c447768ecf
commit
a2e1b6f735
1 changed files with 9 additions and 0 deletions
|
@ -19,6 +19,15 @@
|
|||
},
|
||||
computed: {
|
||||
mediaTag() {
|
||||
if (!this.src) return 'img'
|
||||
const extension = this.src.split('.').pop().toLowerCase()
|
||||
|
||||
if (['mp4', 'webm', 'ogg'].includes(extension)) {
|
||||
return 'video'
|
||||
}
|
||||
if (['mp3', 'wav', 'ogg', 'aac'].includes(extension)) {
|
||||
return 'audio'
|
||||
}
|
||||
return 'img'
|
||||
},
|
||||
proxyUrl() {
|
||||
|
|
Loading…
Add table
Reference in a new issue