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

Commit c941ff4

Browse files
authored
feat: video assets preview (#179)
1 parent 0c95e86 commit c941ff4

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

packages/client/components/AssetDetails.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ const client = useDevToolsClient()
7070

7171
<div flex="~" items-center justify-center>
7272
<AssetPreview
73-
max-h-80 min-h-20 min-w-20 w-auto rounded border="~ base"
73+
border="~ base"
74+
detail max-h-80 min-h-20 min-w-20 w-auto rounded
7475
:asset="asset"
7576
:text-content="textContent"
7677
/>

packages/client/components/AssetPreview.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
defineProps<{
33
asset: AssetInfo
44
textContent?: string
5+
detail?: boolean
56
}>()
67
</script>
78

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

0 commit comments

Comments
 (0)