A self-hosted media server and file management system
Vue ffmpegfile-serverjellyfinlaravelmediamedia-playermedia-servermediabrowsermediaservermusicmusic-librarymusic-playermusicplayerself-hostedvuejs
video loading cls
aminnausin003c2ecf93ec
diff --git a/resources/js/components/cards/CategoryCard.vue b/resources/js/components/cards/CategoryCard.vueindex b9f3a356..eaed0efd 100644--- a/resources/js/components/cards/CategoryCard.vue+++ b/resources/js/components/cards/CategoryCard.vue@@ -89,7 +89,6 @@ watch('https://m.media-amazon.com/images/M/MV5BMjVjZGU5ZTktYTZiNC00N2Q1LThiZjMtMDVmZDljN2I3ZWIwXkEyXkFqcGdeQXVyMTUzMTg2ODkz._V1_.jpg'"alt="Folder Cover Art"- loading="lazy"/></RouterLink><section class="flex flex-1 h-full flex-col p-3 gap-2">diff --git a/resources/js/components/video/VideoAmbientPlayer.vue b/resources/js/components/video/VideoAmbientPlayer.vueindex 0faab542..9d43ed65 100755--- a/resources/js/components/video/VideoAmbientPlayer.vue+++ b/resources/js/components/video/VideoAmbientPlayer.vue@@ -60,6 +60,7 @@ onMounted(() => {onUnmounted(() => {drawPause();window.removeEventListener('resize', adjustOverlayDiv);+ if (player.value) player.value.removeEventListener('loadedmetadata', adjustOverlayDiv);});watch(diff --git a/resources/js/components/video/VideoPlayer.vue b/resources/js/components/video/VideoPlayer.vueindex e4e14e98..c5adbbc7 100755--- a/resources/js/components/video/VideoPlayer.vue+++ b/resources/js/components/video/VideoPlayer.vue@@ -28,6 +28,7 @@ const appStore = useAppStore();const progressCache = ref<{ metadata_id: number; progress: number }[]>([]);const metadata_id = ref<number>(NaN);const currentID = ref(-1);+const isLoading = ref(true);const isAudio = computed(() => {return stateVideo.value.metadata?.mime_type?.startsWith('audio') ?? false;});@@ -219,9 +220,14 @@ const onPlayerEnded = (event: any) => {// if (player.value?.loop) handlePlayVideo(true);};+const onPlayerLoadStart = (event: any) => {+ isLoading.value = true;+};+const onPlayerLoadeddata = (event: any) => {// console.log(event.type);emit('loadedData');+ if (stateVideo.value) isLoading.value = false;};const onPlayerWaiting = (event: any) => {@@ -312,11 +318,12 @@ defineExpose({ref="player"style="z-index: 3":src="stateVideo?.path ? `../${stateVideo?.path}` : ''"- :class="`relative focus:outline-none flex object-contain ${stateVideo?.path ? (isAudio ? 'max-h-[60vh]' : '') : 'aspect-video'}`"+ :class="`relative focus:outline-none flex object-contain ${isLoading || !stateVideo?.path ? 'aspect-video' : isAudio ? 'max-h-[60vh]' : ''}`":poster="isAudio ? audioPoster : ''"@play="onPlayerPlay"@pause="onPlayerPause"@ended="onPlayerEnded"+ @loadstart="onPlayerLoadStart"@loadeddata="onPlayerLoadeddata"@waiting="onPlayerWaiting"@playing="onPlayerPlaying"