feat: Use audio tag instead of download file button (#1749)

This commit is contained in:
Pranav Raj S 2021-02-11 17:26:14 +05:30 committed by GitHub
parent d92a6a3078
commit 9315cb81e8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View file

@ -9,6 +9,8 @@ module FileTypeHelper
'image/bmp' 'image/bmp'
].include?(content_type) ].include?(content_type)
return :audio if content_type.include?('audio/')
:file :file
end end
end end

View file

@ -21,8 +21,11 @@
:url="attachment.data_url" :url="attachment.data_url"
:readable-time="readableTime" :readable-time="readableTime"
/> />
<audio v-else-if="attachment.file_type === 'audio'" controls>
<source :src="attachment.data_url" />
</audio>
<bubble-file <bubble-file
v-if="attachment.file_type !== 'image'" v-else
:url="attachment.data_url" :url="attachment.data_url"
:readable-time="readableTime" :readable-time="readableTime"
/> />