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

Commit

Permalink
feat: video assets preview (#179)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jannchie authored Jul 31, 2023
1 parent 0c95e86 commit c941ff4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
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>

0 comments on commit c941ff4

Please sign in to comment.