A self-hosted media server and file management system
Vue ffmpegfile-serverjellyfinlaravelmediamedia-playermedia-servermediabrowsermediaservermusicmusic-librarymusic-playermusicplayerself-hostedvuejs
<script setup lang="ts">
import type { VideoResource } from '@/contracts/media';
import BlurhashImage from '@/components/lazy/BlurhashImage.vue';
import MediaTag from '@/components/labels/MediaTag.vue';
defineProps<{ media: VideoResource; isPaused: boolean }>();
const emit = defineEmits<{ play: [] }>();
</script>
<template>
<div v-if="media.metadata?.poster_image?.path" class="flex w-full min-w-0 flex-row gap-6 p-8 pt-12 2xl:h-full 2xl:flex-col 2xl:justify-center 2xl:pt-8">
<div
class="pointer-events-auto relative aspect-square max-w-32 cursor-pointer overflow-clip rounded-full 2xl:max-w-96 @min-[2048px]:max-w-lg"
:style="{
animation: 'spin 10s linear infinite',
animationPlayState: isPaused ? 'paused' : 'running',
}"
@click="emit('play')"
>
<BlurhashImage
class="aspect-square size-full rounded-full border-2 border-white/5 object-cover object-center shadow-xs"
alt="Album Art"
:wrapper-class="'aspect-square size-full'"
:blurhash="media.metadata.poster_image.blur_hash"
:src="media.metadata.poster_image.path"
:style="{
maskImage: 'radial-gradient(circle, transparent 0 10%, black 10.5% 100%)',
WebkitMaskImage: 'radial-gradient(circle, transparent 0 10%, black 10.5% 100%)',
}"
/>
<div class="absolute inset-0 z-4 flex items-center justify-center">
<div class="size-[16%] rounded-full ring-2"></div>
</div>
</div>
<div class="media-info space-y-1 p-4 text-left">
<div class="flex items-start gap-2">
<h3 class="line-clamp-2 text-base text-shadow-xs 2xl:text-xl" :title="`Title: ${media.title}`">{{ media.title }}</h3>
<div class="flex h-6 flex-1 items-center gap-1 *:pointer-events-none *:shadow-xs 2xl:h-7">
<MediaTag class="text-foreground-1 dark:text-foreground-4 text-[10px] leading-none 2xl:h-5 2xl:text-xs">{{ media.metadata.codec }}</MediaTag>
<MediaTag
v-if="media.metadata.bitrate && media.metadata.codec === 'mp3'"
class="3xl:block text-foreground-1 dark:text-foreground-4 hidden h-5 text-xs leading-none"
>
{{ media.metadata.bitrate / 1000 }}kbps
</MediaTag>
</div>
</div>
<p class="truncate text-shadow-xs 2xl:text-sm" :title="`Artist: ${media.artist}`">
{{ media.artist }}
</p>
<p class="line-clamp-2 text-wrap opacity-80 text-shadow-xs 2xl:line-clamp-1 2xl:text-sm" :title="`Album: ${media.album}`">
{{ media.album }}
</p>
</div>
</div>
</template>
<style lang="css" scoped>
h3,
.media-info > p {
pointer-events: auto;
}
</style>