Skip to content

Speakr is a personal, self-hosted web application designed for transcribing audio recordings

Python

Desktop: add toggleable docked video panel for video recordings

Murtaza Nasirdebb31236abd
diff --git a/static/css/styles.css b/static/css/styles.css
index 8365fcd6..2f65ecf3 100644
--- a/static/css/styles.css
+++ b/static/css/styles.css
@@ -4399,6 +4399,53 @@ select:disabled {
}
/* ===== Video Fullscreen Overlay ===== */
+/* Docked video panel (desktop). A flex-shrink-0 strip at the bottom of
+ the transcript column; the flex-1 transcript scroller above shrinks to
+ make room (content is pushed up, not overlaid). The single <video>
+ element is teleported into .video-dock__slot. */
+.video-dock {
+ flex-shrink: 0;
+ display: flex;
+ flex-direction: column;
+ height: clamp(160px, 32vh, 380px);
+ border-top: var(--border-hairline) solid var(--border-primary);
+ background: var(--bg-secondary);
+}
+.video-dock__bar {
+ display: flex;
+ align-items: center;
+ gap: var(--sp-2);
+ padding: var(--sp-1) var(--sp-2) var(--sp-1) var(--sp-3);
+ border-bottom: var(--border-hairline) solid var(--border-primary);
+ flex-shrink: 0;
+}
+.video-dock__title {
+ font-size: var(--fs-label);
+ font-weight: 600;
+ color: var(--text-secondary);
+}
+.video-dock__slot {
+ flex: 1;
+ min-height: 0;
+ display: flex;
+ background: #000;
+}
+/* The teleported wrapper (non-fullscreen, docked state) fills the slot
+ and centres the video letterboxed. */
+.video-dock-wrapper {
+ flex: 1;
+ min-width: 0;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ background: #000;
+}
+.video-dock-video {
+ max-width: 100%;
+ max-height: 100%;
+ display: block;
+}
+
.video-fullscreen-overlay {
position: fixed;
inset: 0;
diff --git a/static/js/app.modular.js b/static/js/app.modular.js
index dbb3f9b4..9e4ac499 100644
--- a/static/js/app.modular.js
+++ b/static/js/app.modular.js
@@ -1128,6 +1128,19 @@ document.addEventListener('DOMContentLoaded', async () => {
const showModalVolumeSlider = ref(false);
const showDuplicatesModal = ref(false);
const videoCollapsed = ref(false);
+ // Desktop docked-video panel (strip across the bottom of the
+ // transcript column). Off by default; an in-memory ref so it
+ // stays on as the user moves between video recordings during
+ // the session but resets to off on a fresh page load, per the
+ // chosen behaviour. Audio recordings simply never show it
+ // (isVideoRecording gates visibility).
+ const videoDockEnabled = ref(false);
+ const isVideoRecording = computed(() =>
+ !!(selectedRecording.value
+ && selectedRecording.value.mime_type
+ && selectedRecording.value.mime_type.startsWith('video/'))
+ );
+ const toggleVideoDock = () => { videoDockEnabled.value = !videoDockEnabled.value; };
const videoFullscreen = ref(false);
const fullscreenControlsVisible = ref(true);
const fullscreenControlsTimer = ref(null);
@@ -1582,6 +1595,7 @@ document.addEventListener('DOMContentLoaded', async () => {
modalAudioCurrentTime, modalAudioDuration, modalAudioIsPlaying, modalPlaybackRate,
playbackRate, showSpeedMenu, playbackSpeeds, speedMenuPosition, showVolumeSlider, showModalVolumeSlider,
videoFullscreen, fullscreenControlsVisible, fullscreenControlsTimer, videoCollapsed,
+ videoDockEnabled, isVideoRecording, toggleVideoDock,
// Column Resizing
leftColumnWidth, rightColumnWidth, isResizing,
diff --git a/static/locales/de.json b/static/locales/de.json
index 9fe6ae3a..11493874 100644
--- a/static/locales/de.json
+++ b/static/locales/de.json
@@ -1515,6 +1515,8 @@
"discardIncognito": "Inkognito-Aufnahme verwerfen",
"editTranscript": "Transkript bearbeiten",
"exitFullscreen": "Vollbild beenden",
+ "video": "Video",
+ "enterFullscreen": "Vollbild",
"expand": "Erweitern",
"followPlayerDisabled": "Automatisches Scrollen aktivieren - Transkript folgt der Audiowiedergabe",
"followPlayerEnabled": "Automatisches Scrollen deaktivieren - Transkript bleibt an Ort und Stelle",
diff --git a/static/locales/en.json b/static/locales/en.json
index 645e9d8f..d1cd0ca6 100644
--- a/static/locales/en.json
+++ b/static/locales/en.json
@@ -1524,6 +1524,8 @@
"discardIncognito": "Discard incognito recording",
"editTranscript": "Edit transcript",
"exitFullscreen": "Exit fullscreen",
+ "video": "Video",
+ "enterFullscreen": "Fullscreen",
"expand": "Expand",
"followPlayerDisabled": "Enable auto-scroll - transcript follows audio playback",
"followPlayerEnabled": "Disable auto-scroll - transcript stays in place",
diff --git a/static/locales/es.json b/static/locales/es.json
index d5b067fa..49181de6 100644
--- a/static/locales/es.json
+++ b/static/locales/es.json
@@ -1515,6 +1515,8 @@
"discardIncognito": "Descartar grabación incógnita",
"editTranscript": "Editar transcripción",
"exitFullscreen": "Salir de pantalla completa",
+ "video": "Vídeo",
+ "enterFullscreen": "Pantalla completa",
"expand": "Expandir",
"followPlayerDisabled": "Activar desplazamiento automático - la transcripción sigue la reproducción de audio",
"followPlayerEnabled": "Desactivar desplazamiento automático - la transcripción permanece en su lugar",
diff --git a/static/locales/fr.json b/static/locales/fr.json
index 39e7bfd4..363ccfeb 100644
--- a/static/locales/fr.json
+++ b/static/locales/fr.json
@@ -1515,6 +1515,8 @@
"discardIncognito": "Supprimer l'enregistrement incognito",
"editTranscript": "Modifier la transcription",
"exitFullscreen": "Quitter le plein écran",
+ "video": "Vidéo",
+ "enterFullscreen": "Plein écran",
"expand": "Développer",
"followPlayerDisabled": "Activer le défilement automatique - la transcription suit la lecture audio",
"followPlayerEnabled": "Désactiver le défilement automatique - la transcription reste en place",
diff --git a/static/locales/pt-BR.json b/static/locales/pt-BR.json
index 226437f6..5e3c8d0d 100644
--- a/static/locales/pt-BR.json
+++ b/static/locales/pt-BR.json
@@ -1515,6 +1515,8 @@
"discardIncognito": "Descartar gravação de incógnito",
"editTranscript": "Editar transcrição",
"exitFullscreen": "Sair da tela cheia",
+ "video": "Vídeo",
+ "enterFullscreen": "Tela cheia",
"expand": "Expandir",
"followPlayerDisabled": "Ativar deslocamento automático - transcrição acompanha reproducão de áudio",
"followPlayerEnabled": "Desativar deslocamento automático - transcrição fica no lugar",
diff --git a/static/locales/ru.json b/static/locales/ru.json
index 6977a70f..059f5541 100644
--- a/static/locales/ru.json
+++ b/static/locales/ru.json
@@ -1515,6 +1515,8 @@
"discardIncognito": "Удалить запись инкогнито",
"editTranscript": "Редактировать транскрипт",
"exitFullscreen": "Выйти из полноэкранного режима",
+ "video": "Видео",
+ "enterFullscreen": "Полный экран",
"expand": "Развернуть",
"followPlayerDisabled": "Включить автопрокрутку - транскрипт следует за воспроизведением аудио",
"followPlayerEnabled": "Отключить автопрокрутку - транскрипт остаётся на месте",
diff --git a/static/locales/zh.json b/static/locales/zh.json
index e2aaf16a..9a47367d 100644
--- a/static/locales/zh.json
+++ b/static/locales/zh.json
@@ -1515,6 +1515,8 @@
"discardIncognito": "丢弃隐身录音",
"editTranscript": "编辑转录",
"exitFullscreen": "退出全屏",
+ "video": "视频",
+ "enterFullscreen": "全屏",
"expand": "展开",
"followPlayerDisabled": "启用自动滚动 - 文字记录跟随音频播放",
"followPlayerEnabled": "禁用自动滚动 - 文字记录保持位置",
diff --git a/templates/components/detail/desktop-bottom-player.html b/templates/components/detail/desktop-bottom-player.html
index 969783bf..edc11544 100644
--- a/templates/components/detail/desktop-bottom-player.html
+++ b/templates/components/detail/desktop-bottom-player.html
@@ -21,9 +21,17 @@
<!-- Audio Player -->
<div v-else>
- <!-- Video/Audio element wrapped in Teleport for fullscreen -->
- <Teleport to="body" :disabled="!videoFullscreen">
- <div :class="videoFullscreen ? 'video-fullscreen-overlay' : ''"
+ <!-- Video/Audio element. A SINGLE element teleported between three
+ homes so playback never restarts:
+ - fullscreen -> body (fullscreen overlay)
+ - docked (desktop) -> #videoDockSlot in the transcript column
+ - otherwise -> in place here, hidden (audio-only)
+ Teleport is disabled (element stays here) only when neither
+ fullscreen nor docked. #videoDockSlot is kept mounted via
+ v-show on the dock so the target always exists when enabled. -->
+ <Teleport :to="videoFullscreen ? 'body' : '#videoDockSlot'"
+ :disabled="!videoFullscreen && !(isVideoRecording && videoDockEnabled)">
+ <div :class="videoFullscreen ? 'video-fullscreen-overlay' : (isVideoRecording && videoDockEnabled ? 'video-dock-wrapper' : '')"
@mousemove="videoFullscreen && handleFullscreenMouseMove()"
@click.self="videoFullscreen && toggleAudioPlayback()">
@@ -39,10 +47,10 @@
@ended="handleAudioEnded"
@waiting="handleAudioWaiting"
@canplay="handleAudioCanPlay"
- @click="selectedRecording.mime_type && selectedRecording.mime_type.startsWith('video/') && toggleAudioPlayback()"
+ @click="selectedRecording.mime_type && selectedRecording.mime_type.startsWith('video/') && !videoFullscreen && 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' : 'hidden')
+ :class="isVideoRecording
+ ? (videoFullscreen ? 'video-fullscreen-video' : (videoDockEnabled ? 'video-dock-video' : 'hidden'))
: 'hidden'">
</component>
@@ -139,6 +147,17 @@
style="box-shadow: 0 2px 6px rgba(0,0,0,0.3);"></div>
</div>
+ <!-- Video toggle (video files only): shows/hides the docked
+ video strip at the bottom of the transcript column.
+ Accent colour when on. -->
+ <button v-if="isVideoRecording"
+ @click="toggleVideoDock"
+ class="btn btn--icon flex-shrink-0"
+ :style="videoDockEnabled ? 'color: var(--text-accent);' : ''"
+ :title="videoDockEnabled ? t('tooltips.hideVideo') : t('tooltips.showVideo')">
+ <i :class="videoDockEnabled ? 'fas fa-video' : 'fas fa-video-slash'" class="text-sm"></i>
+ </button>
+
<!-- Playback speed -->
<div class="relative flex-shrink-0">
<button ref="speedButtonDesktop"
diff --git a/templates/components/detail/desktop-transcription-panel.html b/templates/components/detail/desktop-transcription-panel.html
index fc6febcd..8d32217b 100644
--- a/templates/components/detail/desktop-transcription-panel.html
+++ b/templates/components/detail/desktop-transcription-panel.html
@@ -277,4 +277,27 @@
</div>
</div>
</div>
+
+ <!-- Docked video panel (desktop). Shows the video feed in a strip
+ across the bottom of the transcript column when the user enables
+ it from the player bar. The single <video> element is teleported
+ in here (#videoDockSlot) from the bottom player so playback is
+ continuous; going fullscreen teleports the same element to the
+ fullscreen overlay instead. As a flex-shrink-0 child after the
+ flex-1 transcript scroller it pushes the transcript up rather
+ than overlaying it. -->
+ <div v-show="isVideoRecording && videoDockEnabled && !videoFullscreen" class="video-dock">
+ <div class="video-dock__bar">
+ <i class="fas fa-video text-[var(--text-muted)]" style="font-size: 11px;"></i>
+ <span class="video-dock__title" v-text="t('tooltips.video')"></span>
+ <div class="flex-1"></div>
+ <button @click="enterVideoFullscreen" class="btn btn--icon btn--sm" :title="t('tooltips.enterFullscreen')">
+ <i class="fas fa-expand" style="font-size: 11px;"></i>
+ </button>
+ <button @click="toggleVideoDock" class="btn btn--icon btn--sm" :title="t('tooltips.hideVideo')">
+ <i class="fas fa-times text-xs"></i>
+ </button>
+ </div>
+ <div id="videoDockSlot" class="video-dock__slot"></div>
+ </div>
</div>