Skip to content

Commit

Permalink
optimized media check video format
Browse files Browse the repository at this point in the history
  • Loading branch information
lao9s committed Nov 10, 2023
1 parent dac665d commit c772110
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions resources/js/Components/Media/MediaFile.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<script setup>
import {startsWith} from "lodash";
import {computed} from "vue";
import ExclamationCircleIcon from "@/Icons/ExclamationCircle.vue"
import VideoSolidIcon from "@/Icons/VideoSolid.vue"
Expand All @@ -21,10 +20,6 @@ const imgHeightClass = computed(() => {
'sm': 'h-20'
}[props.imgHeight]
})
const isVideo = computed(() => {
return startsWith(props.media.mime_type, 'video');
})
</script>
<template>
<figure class="relative">
Expand All @@ -33,7 +28,7 @@ const isVideo = computed(() => {
class="relative flex rounded"
:class="{'border border-red-500 p-5': media.hasOwnProperty('error')}"
>
<span v-if="isVideo" class="absolute top-0 right-0 mt-1 mr-1">
<span v-if="media.is_video" class="absolute top-0 right-0 mt-1 mr-1">
<VideoSolidIcon class="!w-4 !h-4 text-white"/>
</span>

Expand Down

0 comments on commit c772110

Please sign in to comment.