Speakr is a personal, self-hosted web application designed for transcribing audio recordings
Python
Add fullscreen video mode with auto-hiding controls, subtitles, and keyboard shortcuts
Murtaza Nasir6be19b1bd3ec
diff --git a/static/css/styles.css b/static/css/styles.cssindex 0ec00fad..50d1951a 100644--- a/static/css/styles.css+++ b/static/css/styles.css@@ -4165,3 +4165,102 @@ select:disabled {.dark label {color: var(--text-secondary);}++/* ===== Video Fullscreen Overlay ===== */+.video-fullscreen-overlay {+ position: fixed;+ inset: 0;+ z-index: 9999;+ background: #000;+ display: flex;+ align-items: center;+ justify-content: center;+ cursor: none;+}+.video-fullscreen-overlay:has(.video-fullscreen-controls.visible) {+ cursor: default;+}+.video-fullscreen-video {+ width: 100%;+ height: 100%;+ object-fit: contain;+ cursor: inherit;+}+.video-fullscreen-subtitle {+ position: absolute;+ bottom: 80px;+ left: 50%;+ transform: translateX(-50%);+ max-width: 80%;+ max-height: 30vh;+ overflow-y: auto;+ text-align: center;+ padding: 8px 16px;+ background: rgba(0, 0, 0, 0.75);+ border-radius: 8px;+ color: #fff;+ font-size: 1.25rem;+ line-height: 1.6;+ pointer-events: auto;+ transition: bottom 0.3s ease;+ overscroll-behavior: contain;+}+.video-fullscreen-subtitle.subtitle-shifted {+ bottom: 100px;+}+.video-fullscreen-subtitle-speaker {+ font-weight: 600;+ margin-right: 6px;+}+.video-fullscreen-controls {+ position: absolute;+ bottom: 0;+ left: 0;+ right: 0;+ background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));+ padding-top: 40px;+ opacity: 0;+ transform: translateY(10px);+ transition: opacity 0.3s, transform 0.3s;+ pointer-events: none;+}+.video-fullscreen-controls.visible {+ opacity: 1;+ transform: translateY(0);+ pointer-events: auto;+}++/* Fullscreen volume slider - white themed */+.fullscreen-volume-slider {+ -webkit-appearance: none;+ appearance: none;+ height: 4px;+ background: rgba(255, 255, 255, 0.3);+ border-radius: 2px;+ outline: none;+ cursor: pointer;+}+.fullscreen-volume-slider::-webkit-slider-thumb {+ -webkit-appearance: none;+ appearance: none;+ width: 12px;+ height: 12px;+ border-radius: 50%;+ background: #fff;+ cursor: pointer;+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);+}+.fullscreen-volume-slider::-moz-range-thumb {+ width: 12px;+ height: 12px;+ border-radius: 50%;+ background: #fff;+ cursor: pointer;+ border: none;+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);+}+.fullscreen-volume-slider::-moz-range-track {+ height: 4px;+ background: rgba(255, 255, 255, 0.3);+ border-radius: 2px;+}diff --git a/static/js/app.modular.js b/static/js/app.modular.jsindex 16c80309..bc65d3e9 100644--- a/static/js/app.modular.js+++ b/static/js/app.modular.js@@ -545,6 +545,9 @@ document.addEventListener('DOMContentLoaded', async () => {const showModalVolumeSlider = ref(false);const showDuplicatesModal = ref(false);const videoCollapsed = ref(false);+ const videoFullscreen = ref(false);+ const fullscreenControlsVisible = ref(true);+ const fullscreenControlsTimer = ref(null);const duplicatesModalData = ref(null);// --- Modal Audio Player State (Independent from main) ---@@ -725,6 +728,7 @@ document.addEventListener('DOMContentLoaded', async () => {playerVolume, audioIsPlaying, audioCurrentTime, audioDuration, audioIsMuted, audioIsLoading, asrEditorAudio,modalAudioCurrentTime, modalAudioDuration, modalAudioIsPlaying, modalPlaybackRate,playbackRate, showSpeedMenu, playbackSpeeds, speedMenuPosition, showVolumeSlider, showModalVolumeSlider,+ videoFullscreen, fullscreenControlsVisible, fullscreenControlsTimer, videoCollapsed,// Column ResizingleftColumnWidth, rightColumnWidth, isResizing,@@ -1250,6 +1254,20 @@ document.addEventListener('DOMContentLoaded', async () => {}});+ // Subtitle computed for fullscreen video overlay+ const currentSubtitle = computed(() => {+ const idx = currentPlayingSegmentIndex.value;+ if (idx === null) return null;+ const t = processedTranscription.value;+ if (!t?.simpleSegments?.[idx]) return null;+ const seg = t.simpleSegments[idx];+ return {+ text: seg.sentence,+ speaker: t.hasDialogue ? seg.speaker : null,+ color: seg.color+ };+ });+// =========================================================================// INITIALIZE COMPOSABLES (after processedTranscription is defined)// =========================================================================@@ -2476,6 +2494,9 @@ document.addEventListener('DOMContentLoaded', async () => {hasSpeakerNames,showDuplicatesModal,videoCollapsed,+ videoFullscreen,+ fullscreenControlsVisible,+ currentSubtitle,duplicatesModalData,openDuplicatesModal,navigateToDuplicate,diff --git a/static/js/modules/composables/ui.js b/static/js/modules/composables/ui.jsindex 341d09d8..47aaafe0 100644--- a/static/js/modules/composables/ui.js+++ b/static/js/modules/composables/ui.js@@ -16,7 +16,8 @@ export function useUI(state, utils, processedTranscription) {notesMarkdownEditor, markdownEditorInstance, autoSaveTimer, csrfToken,summaryMarkdownEditor, recordingNotesEditor, recordingMarkdownEditorInstance,recordingNotes, showDownloadMenu, currentPlayingSegmentIndex, followPlayerMode,- playbackRate, showSpeedMenu, playbackSpeeds, modalPlaybackRate, speedMenuPosition+ playbackRate, showSpeedMenu, playbackSpeeds, modalPlaybackRate, speedMenuPosition,+ videoFullscreen, fullscreenControlsVisible, fullscreenControlsTimer, videoCollapsed} = state;const autoSaveDelay = 2000; // 2 seconds@@ -856,7 +857,10 @@ export function useUI(state, utils, processedTranscription) {// --- Custom Audio Player Controls ---const getAudioElement = () => {- // First check for audio/video in visible modals (z-50 class) - these take priority+ // First check fullscreen overlay (teleported to body)+ const fullscreenMedia = document.querySelector('.video-fullscreen-overlay video');+ if (fullscreenMedia) return fullscreenMedia;+ // Then check for audio/video in visible modals (z-50 class) - these take priorityconst modalMedia = document.querySelector('.fixed.z-50 audio') || document.querySelector('.fixed.z-50 video');if (modalMedia) {return modalMedia;@@ -939,7 +943,7 @@ export function useUI(state, utils, processedTranscription) {// Handle progress bar drag - supports both mouse and touch, only seeks on releaseconst startProgressDrag = (event) => {- const bar = event.currentTarget.querySelector('.h-2') || event.currentTarget;+ const bar = event.currentTarget.querySelector('.progress-track') || event.currentTarget.querySelector('.h-2') || event.currentTarget;const rect = bar.getBoundingClientRect();const isTouch = event.type === 'touchstart';@@ -1251,6 +1255,66 @@ export function useUI(state, utils, processedTranscription) {}};+ // --- Video Fullscreen ---+ const handleFullscreenKeydown = (e) => {+ if (e.key === 'Escape' || e.key === 'f') {+ exitVideoFullscreen();+ } else if (e.key === ' ' || e.key === 'k') {+ e.preventDefault();+ toggleAudioPlayback();+ } else if (e.key === 'ArrowLeft') {+ e.preventDefault();+ seekAudioTo(audioCurrentTime.value - 10);+ } else if (e.key === 'ArrowRight') {+ e.preventDefault();+ seekAudioTo(audioCurrentTime.value + 10);+ } else if (e.key === 'ArrowUp') {+ e.preventDefault();+ const audio = getAudioElement();+ if (audio) setAudioVolume(Math.min(1, audio.volume + 0.1));+ } else if (e.key === 'ArrowDown') {+ e.preventDefault();+ const audio = getAudioElement();+ if (audio) setAudioVolume(Math.max(0, audio.volume - 0.1));+ }+ };++ const resetFullscreenControlsTimer = () => {+ fullscreenControlsVisible.value = true;+ if (fullscreenControlsTimer.value) {+ clearTimeout(fullscreenControlsTimer.value);+ }+ fullscreenControlsTimer.value = setTimeout(() => {+ if (audioIsPlaying.value) {+ fullscreenControlsVisible.value = false;+ }+ }, 3000);+ };++ const handleFullscreenMouseMove = () => {+ resetFullscreenControlsTimer();+ };++ const enterVideoFullscreen = () => {+ videoFullscreen.value = true;+ videoCollapsed.value = false;+ fullscreenControlsVisible.value = true;+ resetFullscreenControlsTimer();+ document.addEventListener('keydown', handleFullscreenKeydown);+ document.body.style.overflow = 'hidden';+ };++ const exitVideoFullscreen = () => {+ videoFullscreen.value = false;+ fullscreenControlsVisible.value = true;+ if (fullscreenControlsTimer.value) {+ clearTimeout(fullscreenControlsTimer.value);+ fullscreenControlsTimer.value = null;+ }+ document.removeEventListener('keydown', handleFullscreenKeydown);+ document.body.style.overflow = '';+ };+// --- Copy Functions ---const animateCopyButton = (button) => {if (!button) return;@@ -1622,6 +1686,7 @@ export function useUI(state, utils, processedTranscription) {// Watch for recording changes to reset active segment and audio player statewatch(selectedRecording, (newRecording) => {+ if (videoFullscreen.value) exitVideoFullscreen();currentPlayingSegmentIndex.value = null;resetAudioPlayerState();// Use server-side duration if available (more reliable than browser metadata)@@ -1966,6 +2031,11 @@ export function useUI(state, utils, processedTranscription) {cyclePlaybackRate,cycleModalPlaybackRate,updateSpeedMenuPosition,+ // Video fullscreen+ enterVideoFullscreen,+ exitVideoFullscreen,+ handleFullscreenMouseMove,+ resetFullscreenControlsTimer,// Copy functionscopyTranscription,copySummary,diff --git a/templates/components/detail/audio-player.html b/templates/components/detail/audio-player.htmlindex 2dc86d08..2db961e1 100644--- a/templates/components/detail/audio-player.html+++ b/templates/components/detail/audio-player.html@@ -14,127 +14,223 @@</div><!-- Custom Audio Player --><div v-else>- <!-- Video/Audio element (video when mime_type starts with video/) -->- <component :is="selectedRecording.mime_type && selectedRecording.mime_type.startsWith('video/') ? 'video' : 'audio'"- ref="audioPlayerElement"- :src="'/audio/' + selectedRecording.id"- :volume="playerVolume"- @play="handleAudioPlayPause"- @pause="handleAudioPlayPause"- @timeupdate="handleCustomAudioTimeUpdate"- @loadedmetadata="handleAudioLoadedMetadata"- @durationchange="handleAudioDurationChange"- @ended="handleAudioEnded"- @waiting="handleAudioWaiting"- @canplay="handleAudioCanPlay"- @click="selectedRecording.mime_type && selectedRecording.mime_type.startsWith('video/') && toggleAudioPlayback()"- :class="selectedRecording.mime_type && selectedRecording.mime_type.startsWith('video/') ? (videoCollapsed ? 'hidden' : 'w-full rounded-lg mb-2 cursor-pointer') : 'hidden'">- </component>-- <!-- Progress Bar (draggable, touch support) -->- <div class="w-full h-4 rounded-full cursor-pointer relative mb-2 group flex items-center"- @mousedown="startProgressDrag"- @touchstart.prevent="startProgressDrag">- <!-- Track background -->- <div class="w-full h-2 rounded-full relative bg-[var(--border-accent)] opacity-40">- <!-- Progress fill -->- <div class="h-full bg-[var(--text-accent)] rounded-full pointer-events-none opacity-100"- :style="{ width: audioProgressPercent + '%' }"></div>- </div>- <!-- Progress dot - stays within track bounds -->- <div class="absolute top-1/2 w-4 h-4 bg-[var(--text-accent)] rounded-full shadow-md transition-transform group-hover:scale-110 pointer-events-none -translate-y-1/2"- :style="{ left: 'clamp(0px, calc(' + audioProgressPercent + '% - 8px), calc(100% - 16px))' }"- style="box-shadow: 0 2px 6px rgba(0,0,0,0.3);"></div>- </div>+ <!-- Video/Audio element wrapped in Teleport for fullscreen -->+ <Teleport to="body" :disabled="!videoFullscreen">+ <div :class="videoFullscreen ? 'video-fullscreen-overlay' : ''"+ @mousemove="videoFullscreen && handleFullscreenMouseMove()"+ @click.self="videoFullscreen && toggleAudioPlayback()">- <!-- Controls Row -->- <div class="flex items-center gap-2">- <!-- Play/Pause Button -->- <button @click="toggleAudioPlayback"- class="w-10 h-10 flex items-center justify-center rounded-full player-play-button transition-all duration-200 flex-shrink-0 shadow-md hover:shadow-lg active:scale-95"- :title="audioIsPlaying ? t('tooltips.pause') : t('tooltips.play')">- <i :class="audioIsPlaying ? 'fas fa-pause' : 'fas fa-play'" class="text-base" :style="!audioIsPlaying ? 'margin-left: 2px' : ''"></i>- </button>-- <!-- Time Display -->- <div class="flex items-baseline gap-1 flex-shrink-0">- <span class="text-sm font-semibold font-mono" :class="isDraggingProgress ? 'text-[var(--text-accent)]' : 'text-[var(--text-primary)]'">${ formatAudioTime(displayCurrentTime) }</span>- <span class="text-xs text-[var(--text-muted)]">/</span>- <span class="text-xs text-[var(--text-muted)] font-mono">${ formatAudioTime(audioDuration) }</span>- </div>+ <component :is="selectedRecording.mime_type && selectedRecording.mime_type.startsWith('video/') ? 'video' : 'audio'"+ ref="audioPlayerElement"+ :src="'/audio/' + selectedRecording.id"+ :volume="playerVolume"+ @play="handleAudioPlayPause"+ @pause="handleAudioPlayPause"+ @timeupdate="handleCustomAudioTimeUpdate"+ @loadedmetadata="handleAudioLoadedMetadata"+ @durationchange="handleAudioDurationChange"+ @ended="handleAudioEnded"+ @waiting="handleAudioWaiting"+ @canplay="handleAudioCanPlay"+ @click="selectedRecording.mime_type && selectedRecording.mime_type.startsWith('video/') && toggleAudioPlayback()"+ @dblclick="selectedRecording.mime_type && selectedRecording.mime_type.startsWith('video/') && !videoFullscreen && enterVideoFullscreen()"+ :class="selectedRecording.mime_type && selectedRecording.mime_type.startsWith('video/')+ ? (videoFullscreen ? 'video-fullscreen-video' : (videoCollapsed ? 'hidden' : 'w-full rounded-lg mb-2 cursor-pointer'))+ : 'hidden'">+ </component>- <!-- Playback Speed Control -->- <div class="relative flex-shrink-0">- <button ref="speedButtonMobile"- @click="showSpeedMenu = !showSpeedMenu; $nextTick(() => updateSpeedMenuPosition($refs.speedButtonMobile))"- data-speed-toggle- class="w-8 h-8 flex items-center justify-center rounded-lg hover:bg-[var(--bg-primary)] text-[var(--text-accent)] hover:opacity-80 transition-all"- :title="t('tooltips.playbackSpeed') || 'Playback speed'">- <span class="text-xs font-semibold font-mono">${ formatPlaybackRate(playbackRate) }</span>- </button>- <!-- Dropdown menu (teleported to body, fixed positioning) -->- <Teleport to="body">- <div v-if="showSpeedMenu" @click.stop- data-speed-dropdown- class="fixed bg-[var(--bg-tertiary)] border border-[var(--border-accent)] rounded-md shadow-xl z-[9999] speed-dropdown overflow-y-auto backdrop-blur-sm"- :style="speedMenuPosition">- <div class="py-0.5">- <button v-for="speed in playbackSpeeds" :key="speed"- @mousedown.prevent="setPlaybackRate(speed); showSpeedMenu = false"- class="w-full px-2 py-0.5 text-[11px] font-mono text-left hover:bg-[var(--bg-accent-light)] transition-colors"- :class="speed === playbackRate ? 'text-[var(--text-accent)] font-semibold bg-[var(--bg-accent-light)]' : 'text-[var(--text-primary)]'">- ${ speed }x+ <!-- Fullscreen Subtitle Overlay -->+ <div v-if="videoFullscreen && currentSubtitle"+ class="video-fullscreen-subtitle"+ :class="{ 'subtitle-shifted': fullscreenControlsVisible }">+ <span v-if="currentSubtitle.speaker"+ class="video-fullscreen-subtitle-speaker"+ :style="{ color: 'var(--' + currentSubtitle.color + ')' }">${ currentSubtitle.speaker }:</span>+ <span>${ currentSubtitle.text }</span>+ </div>++ <!-- Fullscreen Control Bar -->+ <div v-if="videoFullscreen"+ class="video-fullscreen-controls"+ :class="{ visible: fullscreenControlsVisible }"+ @mousemove.stop="handleFullscreenMouseMove()">++ <!-- Progress Bar -->+ <div class="px-4 mb-2">+ <div class="w-full h-5 rounded-full cursor-pointer relative group flex items-center"+ @mousedown="startProgressDrag"+ @touchstart.prevent="startProgressDrag">+ <div class="progress-track w-full h-1 rounded-full relative bg-white/30">+ <div class="h-full bg-white rounded-full pointer-events-none"+ :style="{ width: audioProgressPercent + '%' }"></div>+ </div>+ <div class="absolute top-1/2 w-3 h-3 bg-white rounded-full shadow-md transition-transform group-hover:scale-125 pointer-events-none -translate-y-1/2"+ :style="{ left: 'clamp(0px, calc(' + audioProgressPercent + '% - 6px), calc(100% - 12px))' }"></div>+ </div>+ </div>++ <!-- Controls Row -->+ <div class="flex items-center gap-3 px-4 pb-4">+ <!-- Play/Pause -->+ <button @click.stop="toggleAudioPlayback"+ class="w-10 h-10 flex items-center justify-center rounded-full text-white hover:bg-white/20 transition-all">+ <i :class="audioIsPlaying ? 'fas fa-pause' : 'fas fa-play'" class="text-lg" :style="!audioIsPlaying ? 'margin-left: 2px' : ''"></i>+ </button>++ <!-- Volume -->+ <div class="flex items-center gap-2">+ <button @click.stop="toggleAudioMute"+ class="w-8 h-8 flex items-center justify-center rounded-full text-white hover:bg-white/20 transition-all">+ <i :class="audioIsMuted || playerVolume === 0 ? 'fas fa-volume-mute' : playerVolume < 0.5 ? 'fas fa-volume-down' : 'fas fa-volume-up'" class="text-sm"></i></button>+ <input type="range" min="0" max="1" step="0.05"+ :value="audioIsMuted ? 0 : playerVolume"+ @input="(e) => setAudioVolume(parseFloat(e.target.value))"+ class="fullscreen-volume-slider w-20">+ </div>++ <!-- Time -->+ <div class="flex items-baseline gap-1 text-white">+ <span class="text-sm font-mono">${ formatAudioTime(displayCurrentTime) }</span>+ <span class="text-xs opacity-60">/</span>+ <span class="text-xs opacity-60 font-mono">${ formatAudioTime(audioDuration) }</span></div>++ <div class="flex-1"></div>++ <!-- Speed -->+ <button @click.stop="cyclePlaybackRate"+ class="px-2 h-8 flex items-center justify-center rounded-lg text-white hover:bg-white/20 transition-all"+ title="Playback speed">+ <span class="text-xs font-semibold font-mono">${ formatPlaybackRate(playbackRate) }</span>+ </button>++ <!-- Exit Fullscreen -->+ <button @click.stop="exitVideoFullscreen"+ class="w-8 h-8 flex items-center justify-center rounded-full text-white hover:bg-white/20 transition-all"+ title="Exit fullscreen">+ <i class="fas fa-compress text-sm"></i>+ </button></div>- </Teleport>+ </div></div>+ </Teleport>- <!-- Spacer -->- <div class="flex-1"></div>-- <!-- Volume Control -->- <div class="relative flex items-center flex-shrink-0 group/vol"- @mouseenter="showVolumeSlider = true"- @mouseleave="showVolumeSlider = false">- <button @click="toggleAudioMute"- class="w-8 h-8 flex items-center justify-center rounded-lg hover:bg-[var(--bg-primary)] transition-all"- :class="audioIsMuted || playerVolume === 0 ? 'text-[var(--text-muted)]' : 'text-[var(--text-accent)]'"- :title="audioIsMuted ? t('tooltips.unmute') : t('tooltips.mute')">- <i :class="audioIsMuted || playerVolume === 0 ? 'fas fa-volume-mute' : playerVolume < 0.5 ? 'fas fa-volume-down' : 'fas fa-volume-up'" class="text-sm"></i>+ <!-- Normal Controls (hidden when fullscreen) -->+ <div v-show="!videoFullscreen">+ <!-- Progress Bar (draggable, touch support) -->+ <div class="w-full h-4 rounded-full cursor-pointer relative mb-2 group flex items-center"+ @mousedown="startProgressDrag"+ @touchstart.prevent="startProgressDrag">+ <!-- Track background -->+ <div class="progress-track w-full h-2 rounded-full relative bg-[var(--border-accent)] opacity-40">+ <!-- Progress fill -->+ <div class="h-full bg-[var(--text-accent)] rounded-full pointer-events-none opacity-100"+ :style="{ width: audioProgressPercent + '%' }"></div>+ </div>+ <!-- Progress dot - stays within track bounds -->+ <div class="absolute top-1/2 w-4 h-4 bg-[var(--text-accent)] rounded-full shadow-md transition-transform group-hover:scale-110 pointer-events-none -translate-y-1/2"+ :style="{ left: 'clamp(0px, calc(' + audioProgressPercent + '% - 8px), calc(100% - 16px))' }"+ style="box-shadow: 0 2px 6px rgba(0,0,0,0.3);"></div>+ </div>++ <!-- Controls Row -->+ <div class="flex items-center gap-2">+ <!-- Play/Pause Button -->+ <button @click="toggleAudioPlayback"+ class="w-10 h-10 flex items-center justify-center rounded-full player-play-button transition-all duration-200 flex-shrink-0 shadow-md hover:shadow-lg active:scale-95"+ :title="audioIsPlaying ? t('tooltips.pause') : t('tooltips.play')">+ <i :class="audioIsPlaying ? 'fas fa-pause' : 'fas fa-play'" class="text-base" :style="!audioIsPlaying ? 'margin-left: 2px' : ''"></i></button>- <!-- Volume Slider (expands on hover, outer div is invisible hover bridge) -->- <div class="absolute top-full left-1/2 -translate-x-1/2 pt-2 z-50 transition-all duration-200"- :class="showVolumeSlider ? 'opacity-100 pointer-events-auto scale-100' : 'opacity-0 pointer-events-none scale-95'"++ <!-- Time Display -->+ <div class="flex items-baseline gap-1 flex-shrink-0">+ <span class="text-sm font-semibold font-mono" :class="isDraggingProgress ? 'text-[var(--text-accent)]' : 'text-[var(--text-primary)]'">${ formatAudioTime(displayCurrentTime) }</span>+ <span class="text-xs text-[var(--text-muted)]">/</span>+ <span class="text-xs text-[var(--text-muted)] font-mono">${ formatAudioTime(audioDuration) }</span>+ </div>++ <!-- Playback Speed Control -->+ <div class="relative flex-shrink-0">+ <button ref="speedButtonMobile"+ @click="showSpeedMenu = !showSpeedMenu; $nextTick(() => updateSpeedMenuPosition($refs.speedButtonMobile))"+ data-speed-toggle+ class="w-8 h-8 flex items-center justify-center rounded-lg hover:bg-[var(--bg-primary)] text-[var(--text-accent)] hover:opacity-80 transition-all"+ :title="t('tooltips.playbackSpeed') || 'Playback speed'">+ <span class="text-xs font-semibold font-mono">${ formatPlaybackRate(playbackRate) }</span>+ </button>+ <!-- Dropdown menu (teleported to body, fixed positioning) -->+ <Teleport to="body">+ <div v-if="showSpeedMenu" @click.stop+ data-speed-dropdown+ class="fixed bg-[var(--bg-tertiary)] border border-[var(--border-accent)] rounded-md shadow-xl z-[9999] speed-dropdown overflow-y-auto backdrop-blur-sm"+ :style="speedMenuPosition">+ <div class="py-0.5">+ <button v-for="speed in playbackSpeeds" :key="speed"+ @mousedown.prevent="setPlaybackRate(speed); showSpeedMenu = false"+ class="w-full px-2 py-0.5 text-[11px] font-mono text-left hover:bg-[var(--bg-accent-light)] transition-colors"+ :class="speed === playbackRate ? 'text-[var(--text-accent)] font-semibold bg-[var(--bg-accent-light)]' : 'text-[var(--text-primary)]'">+ ${ speed }x+ </button>+ </div>+ </div>+ </Teleport>+ </div>++ <!-- Spacer -->+ <div class="flex-1"></div>++ <!-- Volume Control -->+ <div class="relative flex items-center flex-shrink-0 group/vol"@mouseenter="showVolumeSlider = true"@mouseleave="showVolumeSlider = false">- <div class="px-3 py-2 bg-[var(--bg-tertiary)] border border-[var(--border-accent)] rounded-lg shadow-xl flex flex-col items-center gap-1">- <span class="text-[10px] font-mono text-[var(--text-muted)]">${ Math.round(playerVolume * 100) }</span>- <input type="range" min="0" max="1" step="0.05"- :value="audioIsMuted ? 0 : playerVolume"- @input="(e) => setAudioVolume(parseFloat(e.target.value))"- class="volume-slider-vertical"- style="height: 80px;">+ <button @click="toggleAudioMute"+ class="w-8 h-8 flex items-center justify-center rounded-lg hover:bg-[var(--bg-primary)] transition-all"+ :class="audioIsMuted || playerVolume === 0 ? 'text-[var(--text-muted)]' : 'text-[var(--text-accent)]'"+ :title="audioIsMuted ? t('tooltips.unmute') : t('tooltips.mute')">+ <i :class="audioIsMuted || playerVolume === 0 ? 'fas fa-volume-mute' : playerVolume < 0.5 ? 'fas fa-volume-down' : 'fas fa-volume-up'" class="text-sm"></i>+ </button>+ <!-- Volume Slider (expands on hover, outer div is invisible hover bridge) -->+ <div class="absolute top-full left-1/2 -translate-x-1/2 pt-2 z-50 transition-all duration-200"+ :class="showVolumeSlider ? 'opacity-100 pointer-events-auto scale-100' : 'opacity-0 pointer-events-none scale-95'"+ @mouseenter="showVolumeSlider = true"+ @mouseleave="showVolumeSlider = false">+ <div class="px-3 py-2 bg-[var(--bg-tertiary)] border border-[var(--border-accent)] rounded-lg shadow-xl flex flex-col items-center gap-1">+ <span class="text-[10px] font-mono text-[var(--text-muted)]">${ Math.round(playerVolume * 100) }</span>+ <input type="range" min="0" max="1" step="0.05"+ :value="audioIsMuted ? 0 : playerVolume"+ @input="(e) => setAudioVolume(parseFloat(e.target.value))"+ class="volume-slider-vertical"+ style="height: 80px;">+ </div></div></div>- </div>- <!-- Download Button -->- <a :href="'/audio/' + selectedRecording.id + '?download=true'"- download- class="w-8 h-8 flex items-center justify-center rounded-lg hover:bg-[var(--bg-primary)] text-[var(--text-accent)] hover:opacity-80 transition-all flex-shrink-0"- :title="t('buttons.downloadAudio') || 'Download audio'">- <i class="fas fa-download text-sm"></i>- </a>-- <!-- Video Toggle Button -->- <button v-if="selectedRecording.mime_type && selectedRecording.mime_type.startsWith('video/')"- @click="videoCollapsed = !videoCollapsed"- class="w-8 h-8 flex items-center justify-center rounded-lg hover:bg-[var(--bg-primary)] transition-all flex-shrink-0"- :class="videoCollapsed ? 'text-[var(--text-muted)]' : 'text-[var(--text-accent)]'"- :title="videoCollapsed ? 'Show video' : 'Hide video'">- <i :class="videoCollapsed ? 'fas fa-eye-slash' : 'fas fa-eye'" class="text-sm"></i>- </button>+ <!-- Download Button -->+ <a :href="'/audio/' + selectedRecording.id + '?download=true'"+ download+ class="w-8 h-8 flex items-center justify-center rounded-lg hover:bg-[var(--bg-primary)] text-[var(--text-accent)] hover:opacity-80 transition-all flex-shrink-0"+ :title="t('buttons.downloadAudio') || 'Download audio'">+ <i class="fas fa-download text-sm"></i>+ </a>++ <!-- Video Fullscreen Button -->+ <button v-if="selectedRecording.mime_type && selectedRecording.mime_type.startsWith('video/') && !videoCollapsed"+ @click="enterVideoFullscreen"+ class="w-8 h-8 flex items-center justify-center rounded-lg hover:bg-[var(--bg-primary)] text-[var(--text-accent)] hover:opacity-80 transition-all flex-shrink-0"+ title="Fullscreen video">+ <i class="fas fa-expand text-sm"></i>+ </button>++ <!-- Video Toggle Button -->+ <button v-if="selectedRecording.mime_type && selectedRecording.mime_type.startsWith('video/')"+ @click="videoCollapsed = !videoCollapsed"+ class="w-8 h-8 flex items-center justify-center rounded-lg hover:bg-[var(--bg-primary)] transition-all flex-shrink-0"+ :class="videoCollapsed ? 'text-[var(--text-muted)]' : 'text-[var(--text-accent)]'"+ :title="videoCollapsed ? 'Show video' : 'Hide video'">+ <i :class="videoCollapsed ? 'fas fa-eye-slash' : 'fas fa-eye'" class="text-sm"></i>+ </button>+ </div></div></div></div>diff --git a/templates/components/detail/desktop-right-panel.html b/templates/components/detail/desktop-right-panel.htmlindex 8c52da14..9bd7b0ec 100644--- a/templates/components/detail/desktop-right-panel.html+++ b/templates/components/detail/desktop-right-panel.html@@ -16,114 +16,210 @@</div><!-- Custom Audio Player Card --><div v-else class="bg-[var(--bg-tertiary)] rounded-xl p-4 shadow-sm border border-[var(--border-primary)] overflow-hidden">- <!-- Video/Audio element (video when mime_type starts with video/) -->- <component :is="selectedRecording.mime_type && selectedRecording.mime_type.startsWith('video/') ? 'video' : 'audio'"- ref="audioPlayerElement"- :src="'/audio/' + selectedRecording.id"- :volume="playerVolume"- @play="handleAudioPlayPause"- @pause="handleAudioPlayPause"- @timeupdate="handleCustomAudioTimeUpdate"- @loadedmetadata="handleAudioLoadedMetadata"- @durationchange="handleAudioDurationChange"- @ended="handleAudioEnded"- @waiting="handleAudioWaiting"- @canplay="handleAudioCanPlay"- @click="selectedRecording.mime_type && selectedRecording.mime_type.startsWith('video/') && toggleAudioPlayback()"- :class="selectedRecording.mime_type && selectedRecording.mime_type.startsWith('video/') ? (videoCollapsed ? 'hidden' : 'w-full rounded-lg mb-3 cursor-pointer') : 'hidden'">- </component>-- <!-- Progress Bar (now on top, full width, draggable) -->- <div class="w-full h-4 rounded-full cursor-pointer relative mb-3 group flex items-center"- @mousedown="startProgressDrag">- <!-- Track background -->- <div class="w-full h-2 rounded-full relative bg-[var(--border-accent)] opacity-40">- <!-- Progress fill -->- <div class="h-full bg-[var(--text-accent)] rounded-full pointer-events-none opacity-100"- :style="{ width: audioProgressPercent + '%' }"></div>- </div>- <!-- Progress dot - stays within track bounds -->- <div class="absolute top-1/2 w-4 h-4 bg-[var(--text-accent)] rounded-full shadow-md transition-transform group-hover:scale-110 pointer-events-none -translate-y-1/2"- :style="{ left: 'clamp(0px, calc(' + audioProgressPercent + '% - 8px), calc(100% - 16px))' }"- style="box-shadow: 0 2px 6px rgba(0,0,0,0.3);"></div>- </div>+ <!-- Video/Audio element wrapped in Teleport for fullscreen -->+ <Teleport to="body" :disabled="!videoFullscreen">+ <div :class="videoFullscreen ? 'video-fullscreen-overlay' : ''"+ @mousemove="videoFullscreen && handleFullscreenMouseMove()"+ @click.self="videoFullscreen && toggleAudioPlayback()">- <!-- Controls Row -->- <div class="flex items-center gap-2 min-w-0">- <!-- Play/Pause Button -->- <button @click="toggleAudioPlayback"- class="w-10 h-10 flex items-center justify-center rounded-full player-play-button transition-all duration-200 flex-shrink-0 shadow-md hover:shadow-lg hover:scale-105"- :title="audioIsPlaying ? t('tooltips.pause') : t('tooltips.play')">- <i :class="audioIsPlaying ? 'fas fa-pause' : 'fas fa-play'" class="text-base" :style="!audioIsPlaying ? 'margin-left: 2px' : ''"></i>- </button>-- <!-- Time Display -->- <div class="flex items-baseline gap-1 flex-shrink-0 min-w-0">- <span class="text-sm font-semibold font-mono" :class="isDraggingProgress ? 'text-[var(--text-accent)]' : 'text-[var(--text-primary)]'">${ formatAudioTime(displayCurrentTime) }</span>- <span class="text-xs text-[var(--text-muted)]">/</span>- <span class="text-xs text-[var(--text-muted)] font-mono">${ formatAudioTime(audioDuration) }</span>- </div>+ <component :is="selectedRecording.mime_type && selectedRecording.mime_type.startsWith('video/') ? 'video' : 'audio'"+ ref="audioPlayerElement"+ :src="'/audio/' + selectedRecording.id"+ :volume="playerVolume"+ @play="handleAudioPlayPause"+ @pause="handleAudioPlayPause"+ @timeupdate="handleCustomAudioTimeUpdate"+ @loadedmetadata="handleAudioLoadedMetadata"+ @durationchange="handleAudioDurationChange"+ @ended="handleAudioEnded"+ @waiting="handleAudioWaiting"+ @canplay="handleAudioCanPlay"+ @click="selectedRecording.mime_type && selectedRecording.mime_type.startsWith('video/') && toggleAudioPlayback()"+ @dblclick="selectedRecording.mime_type && selectedRecording.mime_type.startsWith('video/') && !videoFullscreen && enterVideoFullscreen()"+ :class="selectedRecording.mime_type && selectedRecording.mime_type.startsWith('video/')+ ? (videoFullscreen ? 'video-fullscreen-video' : (videoCollapsed ? 'hidden' : 'w-full rounded-lg mb-3 cursor-pointer'))+ : 'hidden'">+ </component>- <!-- Playback Speed Control -->- <div class="relative flex-shrink-0">- <button ref="speedButtonDesktop"- @click="showSpeedMenu = !showSpeedMenu; $nextTick(() => updateSpeedMenuPosition($refs.speedButtonDesktop))"- data-speed-toggle- class="w-8 h-8 flex items-center justify-center rounded-lg hover:bg-[var(--bg-primary)] text-[var(--text-accent)] hover:opacity-80 transition-all"- :title="t('tooltips.playbackSpeed') || 'Playback speed'">- <span class="text-xs font-semibold font-mono">${ formatPlaybackRate(playbackRate) }</span>- </button>- <!-- Dropdown menu (teleported to body, fixed positioning) -->- <Teleport to="body">- <div v-if="showSpeedMenu" @click.stop- data-speed-dropdown- class="fixed bg-[var(--bg-tertiary)] border border-[var(--border-accent)] rounded-md shadow-xl z-[9999] speed-dropdown overflow-y-auto backdrop-blur-sm"- :style="speedMenuPosition">- <div class="py-0.5">- <button v-for="speed in playbackSpeeds" :key="speed"- @mousedown.prevent="setPlaybackRate(speed); showSpeedMenu = false"- class="w-full px-2 py-0.5 text-[11px] font-mono text-left hover:bg-[var(--bg-accent-light)] transition-colors"- :class="speed === playbackRate ? 'text-[var(--text-accent)] font-semibold bg-[var(--bg-accent-light)]' : 'text-[var(--text-primary)]'">- ${ speed }x+ <!-- Fullscreen Subtitle Overlay -->+ <div v-if="videoFullscreen && currentSubtitle"+ class="video-fullscreen-subtitle"+ :class="{ 'subtitle-shifted': fullscreenControlsVisible }">+ <span v-if="currentSubtitle.speaker"+ class="video-fullscreen-subtitle-speaker"+ :style="{ color: 'var(--' + currentSubtitle.color + ')' }">${ currentSubtitle.speaker }:</span>+ <span>${ currentSubtitle.text }</span>+ </div>++ <!-- Fullscreen Control Bar -->+ <div v-if="videoFullscreen"+ class="video-fullscreen-controls"+ :class="{ visible: fullscreenControlsVisible }"+ @mousemove.stop="handleFullscreenMouseMove()">++ <!-- Progress Bar -->+ <div class="px-4 mb-2">+ <div class="w-full h-5 rounded-full cursor-pointer relative group flex items-center"+ @mousedown="startProgressDrag"+ @touchstart.prevent="startProgressDrag">+ <div class="progress-track w-full h-1 rounded-full relative bg-white/30">+ <div class="h-full bg-white rounded-full pointer-events-none"+ :style="{ width: audioProgressPercent + '%' }"></div>+ </div>+ <div class="absolute top-1/2 w-3 h-3 bg-white rounded-full shadow-md transition-transform group-hover:scale-125 pointer-events-none -translate-y-1/2"+ :style="{ left: 'clamp(0px, calc(' + audioProgressPercent + '% - 6px), calc(100% - 12px))' }"></div>+ </div>+ </div>++ <!-- Controls Row -->+ <div class="flex items-center gap-3 px-4 pb-4">+ <!-- Play/Pause -->+ <button @click.stop="toggleAudioPlayback"+ class="w-10 h-10 flex items-center justify-center rounded-full text-white hover:bg-white/20 transition-all">+ <i :class="audioIsPlaying ? 'fas fa-pause' : 'fas fa-play'" class="text-lg" :style="!audioIsPlaying ? 'margin-left: 2px' : ''"></i>+ </button>++ <!-- Volume -->+ <div class="flex items-center gap-2">+ <button @click.stop="toggleAudioMute"+ class="w-8 h-8 flex items-center justify-center rounded-full text-white hover:bg-white/20 transition-all">+ <i :class="audioIsMuted || playerVolume === 0 ? 'fas fa-volume-mute' : playerVolume < 0.5 ? 'fas fa-volume-down' : 'fas fa-volume-up'" class="text-sm"></i></button>+ <input type="range" min="0" max="1" step="0.05"+ :value="audioIsMuted ? 0 : playerVolume"+ @input="(e) => setAudioVolume(parseFloat(e.target.value))"+ class="fullscreen-volume-slider w-20"></div>++ <!-- Time -->+ <div class="flex items-baseline gap-1 text-white">+ <span class="text-sm font-mono">${ formatAudioTime(displayCurrentTime) }</span>+ <span class="text-xs opacity-60">/</span>+ <span class="text-xs opacity-60 font-mono">${ formatAudioTime(audioDuration) }</span>+ </div>++ <div class="flex-1"></div>++ <!-- Speed -->+ <button @click.stop="cyclePlaybackRate"+ class="px-2 h-8 flex items-center justify-center rounded-lg text-white hover:bg-white/20 transition-all"+ title="Playback speed">+ <span class="text-xs font-semibold font-mono">${ formatPlaybackRate(playbackRate) }</span>+ </button>++ <!-- Exit Fullscreen -->+ <button @click.stop="exitVideoFullscreen"+ class="w-8 h-8 flex items-center justify-center rounded-full text-white hover:bg-white/20 transition-all"+ title="Exit fullscreen">+ <i class="fas fa-compress text-sm"></i>+ </button></div>- </Teleport>+ </div></div>+ </Teleport>- <!-- Spacer -->- <div class="flex-1 min-w-0"></div>+ <!-- Normal Controls (hidden when fullscreen) -->+ <div v-show="!videoFullscreen">+ <!-- Progress Bar (now on top, full width, draggable) -->+ <div class="w-full h-4 rounded-full cursor-pointer relative mb-3 group flex items-center"+ @mousedown="startProgressDrag">+ <!-- Track background -->+ <div class="progress-track w-full h-2 rounded-full relative bg-[var(--border-accent)] opacity-40">+ <!-- Progress fill -->+ <div class="h-full bg-[var(--text-accent)] rounded-full pointer-events-none opacity-100"+ :style="{ width: audioProgressPercent + '%' }"></div>+ </div>+ <!-- Progress dot - stays within track bounds -->+ <div class="absolute top-1/2 w-4 h-4 bg-[var(--text-accent)] rounded-full shadow-md transition-transform group-hover:scale-110 pointer-events-none -translate-y-1/2"+ :style="{ left: 'clamp(0px, calc(' + audioProgressPercent + '% - 8px), calc(100% - 16px))' }"+ style="box-shadow: 0 2px 6px rgba(0,0,0,0.3);"></div>+ </div>- <!-- Volume Control - hidden on very narrow screens -->- <div class="hidden sm:flex items-center gap-1 flex-shrink-0">- <button @click="toggleAudioMute"- class="w-8 h-8 flex items-center justify-center rounded-lg hover:bg-[var(--bg-primary)] hover:opacity-80 transition-all"- :class="audioIsMuted || playerVolume === 0 ? 'text-[var(--text-muted)]' : 'text-[var(--text-accent)]'"- :title="audioIsMuted ? t('tooltips.unmute') : t('tooltips.mute')">- <i :class="audioIsMuted || playerVolume === 0 ? 'fas fa-volume-mute' : playerVolume < 0.5 ? 'fas fa-volume-down' : 'fas fa-volume-up'" class="text-sm"></i>+ <!-- Controls Row -->+ <div class="flex items-center gap-2 min-w-0">+ <!-- Play/Pause Button -->+ <button @click="toggleAudioPlayback"+ class="w-10 h-10 flex items-center justify-center rounded-full player-play-button transition-all duration-200 flex-shrink-0 shadow-md hover:shadow-lg hover:scale-105"+ :title="audioIsPlaying ? t('tooltips.pause') : t('tooltips.play')">+ <i :class="audioIsPlaying ? 'fas fa-pause' : 'fas fa-play'" class="text-base" :style="!audioIsPlaying ? 'margin-left: 2px' : ''"></i></button>- <input type="range" min="0" max="1" step="0.05"- :value="audioIsMuted ? 0 : playerVolume"- @input="(e) => setAudioVolume(parseFloat(e.target.value))"- class="volume-slider w-16">- </div>- <!-- Download Button -->- <a :href="'/audio/' + selectedRecording.id + '?download=true'"- download- class="w-8 h-8 flex items-center justify-center rounded-lg hover:bg-[var(--bg-primary)] text-[var(--text-accent)] hover:opacity-80 transition-all flex-shrink-0"- :title="t('buttons.downloadAudio') || 'Download audio'">- <i class="fas fa-download text-sm"></i>- </a>-- <!-- Video Toggle Button -->- <button v-if="selectedRecording.mime_type && selectedRecording.mime_type.startsWith('video/')"- @click="videoCollapsed = !videoCollapsed"- class="w-8 h-8 flex items-center justify-center rounded-lg hover:bg-[var(--bg-primary)] transition-all flex-shrink-0"- :class="videoCollapsed ? 'text-[var(--text-muted)]' : 'text-[var(--text-accent)]'"- :title="videoCollapsed ? 'Show video' : 'Hide video'">- <i :class="videoCollapsed ? 'fas fa-eye-slash' : 'fas fa-eye'" class="text-sm"></i>- </button>+ <!-- Time Display -->+ <div class="flex items-baseline gap-1 flex-shrink-0 min-w-0">+ <span class="text-sm font-semibold font-mono" :class="isDraggingProgress ? 'text-[var(--text-accent)]' : 'text-[var(--text-primary)]'">${ formatAudioTime(displayCurrentTime) }</span>+ <span class="text-xs text-[var(--text-muted)]">/</span>+ <span class="text-xs text-[var(--text-muted)] font-mono">${ formatAudioTime(audioDuration) }</span>+ </div>++ <!-- Playback Speed Control -->+ <div class="relative flex-shrink-0">+ <button ref="speedButtonDesktop"+ @click="showSpeedMenu = !showSpeedMenu; $nextTick(() => updateSpeedMenuPosition($refs.speedButtonDesktop))"+ data-speed-toggle+ class="w-8 h-8 flex items-center justify-center rounded-lg hover:bg-[var(--bg-primary)] text-[var(--text-accent)] hover:opacity-80 transition-all"+ :title="t('tooltips.playbackSpeed') || 'Playback speed'">+ <span class="text-xs font-semibold font-mono">${ formatPlaybackRate(playbackRate) }</span>+ </button>+ <!-- Dropdown menu (teleported to body, fixed positioning) -->+ <Teleport to="body">+ <div v-if="showSpeedMenu" @click.stop+ data-speed-dropdown+ class="fixed bg-[var(--bg-tertiary)] border border-[var(--border-accent)] rounded-md shadow-xl z-[9999] speed-dropdown overflow-y-auto backdrop-blur-sm"+ :style="speedMenuPosition">+ <div class="py-0.5">+ <button v-for="speed in playbackSpeeds" :key="speed"+ @mousedown.prevent="setPlaybackRate(speed); showSpeedMenu = false"+ class="w-full px-2 py-0.5 text-[11px] font-mono text-left hover:bg-[var(--bg-accent-light)] transition-colors"+ :class="speed === playbackRate ? 'text-[var(--text-accent)] font-semibold bg-[var(--bg-accent-light)]' : 'text-[var(--text-primary)]'">+ ${ speed }x+ </button>+ </div>+ </div>+ </Teleport>+ </div>++ <!-- Spacer -->+ <div class="flex-1 min-w-0"></div>++ <!-- Volume Control - hidden on very narrow screens -->+ <div class="hidden sm:flex items-center gap-1 flex-shrink-0">+ <button @click="toggleAudioMute"+ class="w-8 h-8 flex items-center justify-center rounded-lg hover:bg-[var(--bg-primary)] hover:opacity-80 transition-all"+ :class="audioIsMuted || playerVolume === 0 ? 'text-[var(--text-muted)]' : 'text-[var(--text-accent)]'"+ :title="audioIsMuted ? t('tooltips.unmute') : t('tooltips.mute')">+ <i :class="audioIsMuted || playerVolume === 0 ? 'fas fa-volume-mute' : playerVolume < 0.5 ? 'fas fa-volume-down' : 'fas fa-volume-up'" class="text-sm"></i>+ </button>+ <input type="range" min="0" max="1" step="0.05"+ :value="audioIsMuted ? 0 : playerVolume"+ @input="(e) => setAudioVolume(parseFloat(e.target.value))"+ class="volume-slider w-16">+ </div>++ <!-- Download Button -->+ <a :href="'/audio/' + selectedRecording.id + '?download=true'"+ download+ class="w-8 h-8 flex items-center justify-center rounded-lg hover:bg-[var(--bg-primary)] text-[var(--text-accent)] hover:opacity-80 transition-all flex-shrink-0"+ :title="t('buttons.downloadAudio') || 'Download audio'">+ <i class="fas fa-download text-sm"></i>+ </a>++ <!-- Video Fullscreen Button -->+ <button v-if="selectedRecording.mime_type && selectedRecording.mime_type.startsWith('video/') && !videoCollapsed"+ @click="enterVideoFullscreen"+ class="w-8 h-8 flex items-center justify-center rounded-lg hover:bg-[var(--bg-primary)] text-[var(--text-accent)] hover:opacity-80 transition-all flex-shrink-0"+ title="Fullscreen video">+ <i class="fas fa-expand text-sm"></i>+ </button>++ <!-- Video Toggle Button -->+ <button v-if="selectedRecording.mime_type && selectedRecording.mime_type.startsWith('video/')"+ @click="videoCollapsed = !videoCollapsed"+ class="w-8 h-8 flex items-center justify-center rounded-lg hover:bg-[var(--bg-primary)] transition-all flex-shrink-0"+ :class="videoCollapsed ? 'text-[var(--text-muted)]' : 'text-[var(--text-accent)]'"+ :title="videoCollapsed ? 'Show video' : 'Hide video'">+ <i :class="videoCollapsed ? 'fas fa-eye-slash' : 'fas fa-eye'" class="text-sm"></i>+ </button>+ </div></div></div></div>