Skip to content

A self-hosted media server and file management system

fix: am-lyrics toggle covers ui

aminnausinb1d09750b880
diff --git a/resources/js/components/video/VideoPlayer.vue b/resources/js/components/video/VideoPlayer.vue
index 46eb798c..7d648468 100755
--- a/resources/js/components/video/VideoPlayer.vue
+++ b/resources/js/components/video/VideoPlayer.vue
@@ -133,6 +133,7 @@ const {
isAudioGraphEnabled,
showAutoSubtitles,
showSeekButtons,
+ useAmLyrics,
} = storeToRefs(useAppStore());
const { setContextMenu, closeContextMenu } = useAppStore();
const { updateViewCount } = useContentStore();
@@ -331,6 +332,15 @@ const playerContextMenuItems = computed<ContextMenuItem[]>(() =>
togglePictureInPicture();
},
},
+ {
+ text: 'Use AM-Lyrics',
+ icon: useAmLyrics.value ? ProiconsCheckmark : undefined,
+ selected: useAmLyrics.value,
+ hidden: !FLAGS.USE_AM_LYRICS || !isAudio.value || !isShowingLyrics.value,
+ action: () => {
+ useAmLyrics.value = !useAmLyrics.value;
+ },
+ },
{
text: 'Audio Graph Menu',
icon: isShowingAudioGraphSettings.value ? ProiconsCheckmark : undefined,
diff --git a/resources/js/components/video/plugins/lyrics/AmLyrics.vue b/resources/js/components/video/plugins/lyrics/AmLyrics.vue
index d6df3192..f99d5b27 100644
--- a/resources/js/components/video/plugins/lyrics/AmLyrics.vue
+++ b/resources/js/components/video/plugins/lyrics/AmLyrics.vue
@@ -61,7 +61,7 @@ const applyStyle = () => {
if (!amLyrics.value?.shadowRoot) return;
const style = document.createElement('style');
style.textContent = [
- '.download-controls {margin-right: 110px !important; align-items: start !important; height: 100% !important; margin-top: -4px !important;}',
+ '.download-controls {!important; align-items: start !important; height: 100% !important;}',
'.format-select {min-height: 20px !important;}',
'.download-button {height: 20px !important;}',
].join('');
diff --git a/resources/js/components/video/plugins/lyrics/VideoLyricItem.vue b/resources/js/components/video/plugins/lyrics/VideoLyricItem.vue
index 53861ee4..05adb289 100644
--- a/resources/js/components/video/plugins/lyrics/VideoLyricItem.vue
+++ b/resources/js/components/video/plugins/lyrics/VideoLyricItem.vue
@@ -50,7 +50,11 @@ const distanceClasses = computed(() => {
</script>
<template>
- <div :class="cn('w-full transition-colors duration-300 ease-out', { 'bg-neutral-800/40': isActive })" :id="`lyric-${lyric?.time ?? index}`" :data-lyric-row="index">
+ <div
+ :class="cn('w-full transition-colors duration-300 ease-out', { 'bg-neutral-800/40': isActive })"
+ :id="`lyric-${lyric?.time ?? `-indexed-${index}`}`"
+ :data-lyric-row="index"
+ >
<button
:class="
cn(
diff --git a/resources/js/components/video/plugins/lyrics/VideoLyrics.vue b/resources/js/components/video/plugins/lyrics/VideoLyrics.vue
index 9a658b52..322e4b8d 100644
--- a/resources/js/components/video/plugins/lyrics/VideoLyrics.vue
+++ b/resources/js/components/video/plugins/lyrics/VideoLyrics.vue
@@ -5,6 +5,7 @@ import { computed, onMounted, onUnmounted, ref, useTemplateRef, watch, nextTick,
import { useContentStore } from '@/stores/ContentStore';
import { useModalStore } from '@/stores/ModalStore';
import { useLyricStore } from '@/stores/LyricStore';
+import { useAppStore } from '@/stores/AppStore';
import { storeToRefs } from 'pinia';
import { onSeek } from '@/service/player/seekBus';
import { FLAGS } from '@/config/featureFlags';
@@ -17,6 +18,7 @@ let unsubscribe: () => boolean;
const { stateLyrics, dirtyLyric, isLoadingLyrics } = storeToRefs(useLyricStore());
const { handleGenerateLyrics, handleOpenLyricsModal } = useLyricStore();
+const { useAmLyrics } = storeToRefs(useAppStore());
const { stateVideo } = storeToRefs(useContentStore());
const emit = defineEmits<{ seek: [value: number] }>();
@@ -33,7 +35,6 @@ const isContainerVisible = ref(false);
const isFocusedScroll = ref(false);
const useFocusedScroll = ref(true);
-const useAmLyrics = ref(false);
const lyrics = computed(() => {
const availableLyrics = stateLyrics.value;
@@ -265,7 +266,7 @@ defineExpose({ scrollToCurrent });
<template #fallback> ... </template>
</Suspense>
<section
- class="fade-mask font-klee-one-mono scrollbar-hide flex h-full w-full flex-col overflow-y-scroll text-center text-sm sm:text-xl"
+ class="fade-mask font-klee-one-mono scrollbar-hide flex h-full w-full flex-col overflow-y-scroll text-center text-sm sm:text-lg 2xl:text-xl"
ref="lyrics-container"
v-show="lyrics.length > 0 && !useAmLyrics"
@wheel="handleUserScroll"
@@ -299,10 +300,6 @@ defineExpose({ scrollToCurrent });
<div class="pointer-events-auto absolute right-0 bottom-0 left-0 h-16" style="z-index: 6"></div>
</template>
<Teleport defer to="#player-toolbar" v-if="isShowingLyrics">
- <PlayerToolbarButton v-if="FLAGS.USE_AM_LYRICS" @click="useAmLyrics = FLAGS.USE_AM_LYRICS ? !useAmLyrics : false" title="Use alternate lyrics viewer">
- {{ useAmLyrics ? 'use native lyrics' : 'use am-Lyrics' }}
- </PlayerToolbarButton>
- <PlayerToolbarButton v-if="!useAmLyrics" @click="toggleFocusScroll" title="Focus active lyric"> {{ useFocusedScroll ? 'disable' : 'enable' }} focus </PlayerToolbarButton>
<PlayerToolbarButton v-if="!useAmLyrics" @click="handleOpenLyricsModal" title="Edit lyrics" :is-active="!!dirtyLyric">
{{ dirtyLyric ? 'preview' : 'edit' }}
</PlayerToolbarButton>
diff --git a/resources/js/stores/AppStore.ts b/resources/js/stores/AppStore.ts
index b0332b43..f1e2f0bb 100644
--- a/resources/js/stores/AppStore.ts
+++ b/resources/js/stores/AppStore.ts
@@ -81,6 +81,8 @@ export const useAppStore = defineStore('App', () => {
const isAmbientMode = usePersisted('ambientMode', false);
const showModernUI = usePersisted('showModernUI', true);
+ const useAmLyrics = usePersisted('useAmLyrics', false);
+
const preferredAudioLanguage = usePersistedString('preferredAudioLanguage', '');
//#endregion
@@ -198,6 +200,8 @@ export const useAppStore = defineStore('App', () => {
watch(isAmbientMode.state, isAmbientMode.persist);
watch(isPlaylist.state, isPlaylist.persist);
+ watch(useAmLyrics.state, useAmLyrics.persist);
+
watch(preferredAudioLanguage.state, preferredAudioLanguage.persist);
//#endregion
@@ -213,6 +217,7 @@ export const useAppStore = defineStore('App', () => {
showAutoSubtitles: showAutoSubtitles.state,
showSeekButtons: showSeekButtons.state,
preferredAudioLanguage: preferredAudioLanguage.state,
+ useAmLyrics: useAmLyrics.state,
initBrowserState,
// Local State