Skip to content

Commit

Permalink
feat: audio preview (#397)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jannchie committed Aug 19, 2023
1 parent 15340c2 commit cb5ddc6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/devtools/client/components/AssetDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ const supportsPreview = computed(() => {
'image',
'text',
'video',
'audio',
'font',
].includes(asset.value.type)
})
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 @@ -25,6 +25,10 @@ defineProps<{
<div v-else-if="asset.type === 'video'">
<video :src="asset.publicPath" :autoplay="detail" :controls="detail" />
</div>
<div v-else-if="asset.type === 'audio'">
<div v-if="!detail" i-carbon-volume-up text-3xl op20 />
<audio v-else :src="asset.publicPath" controls />
</div>
<div v-else i-carbon-help text-3xl op20 />
</div>
</template>

0 comments on commit cb5ddc6

Please sign in to comment.