Skip to content
This repository was archived by the owner on Jan 6, 2024. It is now read-only.

feat: video assets preview #179

Merged
merged 1 commit into from
Jul 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/client/components/AssetDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ const client = useDevToolsClient()

<div flex="~" items-center justify-center>
<AssetPreview
max-h-80 min-h-20 min-w-20 w-auto rounded border="~ base"
border="~ base"
detail max-h-80 min-h-20 min-w-20 w-auto rounded
:asset="asset"
:text-content="textContent"
/>
Expand Down
4 changes: 4 additions & 0 deletions packages/client/components/AssetPreview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
defineProps<{
asset: AssetInfo
textContent?: string
detail?: boolean
}>()
</script>

Expand All @@ -19,6 +20,9 @@ defineProps<{
<div v-else-if="asset.type === 'text' && textContent" w-full self-start p4>
<pre max-h-10rem of-hidden text-xs font-mono v-text="textContent" />
</div>
<div v-else-if="asset.type === 'video'">
<video :src="asset.publicPath" :autoplay="detail" :controls="detail" />
</div>
<div v-else i-carbon-help text-3xl op20 />
</div>
</template>