Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support preview video assets #347

Merged
merged 2 commits into from
Jul 30, 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
1 change: 1 addition & 0 deletions packages/devtools/client/components/AssetDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ const supportsPreview = computed(() => {

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

Expand All @@ -21,6 +22,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>
Loading