fix: fallback to image for media
This commit is contained in:
parent
4f133aabc0
commit
842102cea4
@ -16,7 +16,7 @@ defineEmits<{
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div relative group>
|
<div relative group>
|
||||||
<status-attachment :attachment="attachment" w-full />
|
<StatusAttachment :attachment="attachment" w-full />
|
||||||
<div absolute right-2 top-2>
|
<div absolute right-2 top-2>
|
||||||
<div
|
<div
|
||||||
v-if="removable"
|
v-if="removable"
|
||||||
|
@ -22,20 +22,7 @@ const aspectRatio = computed(() => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<template v-if="attachment.type === 'image' ">
|
<template v-if="attachment.type === 'video'">
|
||||||
<CommonBlurhash
|
|
||||||
:blurhash="attachment.blurhash"
|
|
||||||
class="status-attachment-image"
|
|
||||||
:src="attachment.url || attachment.previewUrl!"
|
|
||||||
:alt="attachment.description!"
|
|
||||||
:style="{
|
|
||||||
aspectRatio,
|
|
||||||
}"
|
|
||||||
border="~ base"
|
|
||||||
object-cover rounded-lg
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
<template v-else-if="attachment.type === 'video'">
|
|
||||||
<video
|
<video
|
||||||
:poster="attachment.previewUrl"
|
:poster="attachment.previewUrl"
|
||||||
controls
|
controls
|
||||||
@ -67,11 +54,18 @@ const aspectRatio = computed(() => {
|
|||||||
<source :src="attachment.url || attachment.previewUrl" type="audio/mp3">
|
<source :src="attachment.url || attachment.previewUrl" type="audio/mp3">
|
||||||
</audio>
|
</audio>
|
||||||
</template>
|
</template>
|
||||||
|
<!-- Image or "unknown" fallback -->
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<div>
|
<CommonBlurhash
|
||||||
TODO:
|
:blurhash="attachment.blurhash"
|
||||||
<pre>{{ attachment }}
|
class="status-attachment-image"
|
||||||
</pre>
|
:src="attachment.url || attachment.previewUrl!"
|
||||||
</div>
|
:alt="attachment.description!"
|
||||||
|
:style="{
|
||||||
|
aspectRatio,
|
||||||
|
}"
|
||||||
|
border="~ base"
|
||||||
|
object-cover rounded-lg
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
|
Loading…
Reference in New Issue
Block a user