2026-09-21 11:08:16 -04:00
|
|
|
<script lang="ts">
|
|
|
|
|
import { session } from '$lib/stores/videoSession.svelte';
|
|
|
|
|
import { markInPoint, markOutPoint } from '$lib/stores/clips.svelte';
|
|
|
|
|
import { formatTime } from '$lib/utils/time';
|
|
|
|
|
import {
|
|
|
|
|
jumpKeyframe,
|
|
|
|
|
runTransportAction,
|
|
|
|
|
seekBy,
|
|
|
|
|
stepFrame,
|
|
|
|
|
togglePlayPause,
|
chore: stage all pending work — caption styling, media server, processing modal, docs, summaries
Includes:
- Extended caption styling (font, shadow, dimmed color, bg toggle)
- Media server, subtitle downloader, VTT parser, processing modal
- Waveform tiers, thumbnail/timeline improvements, transport controls
- Hybrid download model, dependency management, clip export enhancements
- 21 chat summaries, 2 implementation plans, 2 design specs
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-22 10:48:16 -04:00
|
|
|
setVolume,
|
|
|
|
|
setMuted,
|
|
|
|
|
getVolume,
|
|
|
|
|
getMuted,
|
2026-09-21 11:08:16 -04:00
|
|
|
type TransportKeyAction,
|
|
|
|
|
} from '$lib/transport/playback';
|
|
|
|
|
|
|
|
|
|
let hasKeyframes = $derived(session.keyframePositions.length > 0);
|
|
|
|
|
|
chore: stage all pending work — caption styling, media server, processing modal, docs, summaries
Includes:
- Extended caption styling (font, shadow, dimmed color, bg toggle)
- Media server, subtitle downloader, VTT parser, processing modal
- Waveform tiers, thumbnail/timeline improvements, transport controls
- Hybrid download model, dependency management, clip export enhancements
- 21 chat summaries, 2 implementation plans, 2 design specs
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-22 10:48:16 -04:00
|
|
|
let volume = $state(1);
|
|
|
|
|
let isMuted = $state(false);
|
|
|
|
|
|
|
|
|
|
function toggleMute() {
|
|
|
|
|
isMuted = !isMuted;
|
|
|
|
|
setMuted(isMuted);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function handleVolumeChange(e: Event) {
|
|
|
|
|
const val = parseFloat((e.target as HTMLInputElement).value);
|
|
|
|
|
volume = val;
|
|
|
|
|
if (val > 0 && isMuted) {
|
|
|
|
|
isMuted = false;
|
|
|
|
|
}
|
|
|
|
|
setVolume(val);
|
|
|
|
|
if (val > 0) {
|
|
|
|
|
setMuted(false);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-09-21 11:08:16 -04:00
|
|
|
export function handleKeyAction(action: TransportKeyAction) {
|
|
|
|
|
runTransportAction(action, markInPoint, markOutPoint);
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
2026-09-21 10:45:53 -04:00
|
|
|
<div class="transport-controls">
|
2026-09-21 11:08:16 -04:00
|
|
|
<div class="buttons">
|
|
|
|
|
<button
|
|
|
|
|
onclick={() => jumpKeyframe(-1)}
|
|
|
|
|
disabled={!hasKeyframes}
|
|
|
|
|
title="Previous keyframe (Shift+,)"
|
|
|
|
|
type="button"
|
|
|
|
|
>
|
|
|
|
|
◄K
|
|
|
|
|
</button>
|
|
|
|
|
<button onclick={() => seekBy(-5)} title="Seek back 5s (←)" type="button">-5s</button>
|
|
|
|
|
<button onclick={() => seekBy(-1)} title="Seek back 1s (Shift+←)" type="button">-1s</button>
|
|
|
|
|
<button onclick={() => stepFrame(-1)} title="Previous frame (,)" type="button">◄|</button>
|
|
|
|
|
<button onclick={togglePlayPause} title="Play/Pause (Space / K)" type="button">
|
|
|
|
|
{session.isPlaying ? '❚❚' : '▶'}
|
|
|
|
|
</button>
|
|
|
|
|
<button onclick={() => stepFrame(1)} title="Next frame (.)" type="button">|►</button>
|
|
|
|
|
<button onclick={() => seekBy(1)} title="Seek forward 1s (Shift+→)" type="button">+1s</button>
|
|
|
|
|
<button onclick={() => seekBy(5)} title="Seek forward 5s (→)" type="button">+5s</button>
|
|
|
|
|
<button
|
|
|
|
|
onclick={() => jumpKeyframe(1)}
|
|
|
|
|
disabled={!hasKeyframes}
|
|
|
|
|
title="Next keyframe (Shift+.)"
|
|
|
|
|
type="button"
|
|
|
|
|
>
|
|
|
|
|
K►
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="time-display">
|
|
|
|
|
<span class="current">{formatTime(session.currentTime)}</span>
|
|
|
|
|
<span class="separator">/</span>
|
|
|
|
|
<span class="total">{formatTime(session.duration)}</span>
|
|
|
|
|
</div>
|
|
|
|
|
|
chore: stage all pending work — caption styling, media server, processing modal, docs, summaries
Includes:
- Extended caption styling (font, shadow, dimmed color, bg toggle)
- Media server, subtitle downloader, VTT parser, processing modal
- Waveform tiers, thumbnail/timeline improvements, transport controls
- Hybrid download model, dependency management, clip export enhancements
- 21 chat summaries, 2 implementation plans, 2 design specs
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-22 10:48:16 -04:00
|
|
|
<div class="volume-controls">
|
|
|
|
|
<button
|
|
|
|
|
class="vol-btn"
|
|
|
|
|
onclick={toggleMute}
|
|
|
|
|
title={isMuted ? 'Unmute' : 'Mute'}
|
|
|
|
|
type="button"
|
|
|
|
|
>
|
|
|
|
|
{#if isMuted || volume === 0}
|
|
|
|
|
🔇
|
|
|
|
|
{:else if volume < 0.5}
|
|
|
|
|
🔉
|
|
|
|
|
{:else}
|
|
|
|
|
🔊
|
|
|
|
|
{/if}
|
|
|
|
|
</button>
|
|
|
|
|
<input
|
|
|
|
|
type="range"
|
|
|
|
|
class="vol-slider"
|
|
|
|
|
min="0"
|
|
|
|
|
max="1"
|
|
|
|
|
step="0.05"
|
|
|
|
|
value={isMuted ? 0 : volume}
|
|
|
|
|
oninput={handleVolumeChange}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
|
2026-09-21 11:08:16 -04:00
|
|
|
<div class="mark-buttons">
|
|
|
|
|
<button
|
|
|
|
|
class="mark-btn"
|
|
|
|
|
onclick={() => markInPoint(session.currentTime)}
|
|
|
|
|
title="Set in-point (I)"
|
|
|
|
|
type="button"
|
|
|
|
|
>
|
|
|
|
|
I
|
|
|
|
|
</button>
|
|
|
|
|
<button
|
|
|
|
|
class="mark-btn"
|
|
|
|
|
onclick={() => markOutPoint(session.currentTime)}
|
|
|
|
|
title="Set out-point (O)"
|
|
|
|
|
type="button"
|
|
|
|
|
>
|
|
|
|
|
O
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
2026-09-21 10:45:53 -04:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<style>
|
|
|
|
|
.transport-controls {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
padding: 8px 12px;
|
|
|
|
|
background: var(--bg-secondary);
|
|
|
|
|
border-top: 1px solid var(--border);
|
|
|
|
|
border-bottom: 1px solid var(--border);
|
2026-09-21 11:08:16 -04:00
|
|
|
gap: 16px;
|
2026-09-21 10:45:53 -04:00
|
|
|
}
|
2026-09-21 11:08:16 -04:00
|
|
|
|
|
|
|
|
.buttons {
|
|
|
|
|
display: flex;
|
|
|
|
|
gap: 4px;
|
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.buttons button {
|
2026-09-21 10:45:53 -04:00
|
|
|
font-size: 13px;
|
2026-09-21 11:08:16 -04:00
|
|
|
padding: 4px 8px;
|
|
|
|
|
min-width: 32px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.time-display {
|
|
|
|
|
font-family: var(--font-mono);
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.current {
|
|
|
|
|
color: var(--text-primary);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.separator {
|
|
|
|
|
color: var(--text-muted);
|
|
|
|
|
margin: 0 4px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.total {
|
|
|
|
|
color: var(--text-secondary);
|
|
|
|
|
}
|
|
|
|
|
|
chore: stage all pending work — caption styling, media server, processing modal, docs, summaries
Includes:
- Extended caption styling (font, shadow, dimmed color, bg toggle)
- Media server, subtitle downloader, VTT parser, processing modal
- Waveform tiers, thumbnail/timeline improvements, transport controls
- Hybrid download model, dependency management, clip export enhancements
- 21 chat summaries, 2 implementation plans, 2 design specs
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-22 10:48:16 -04:00
|
|
|
.volume-controls {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
gap: 4px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.vol-btn {
|
|
|
|
|
background: var(--bg-tertiary);
|
|
|
|
|
border: 1px solid var(--border);
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
padding: 3px 6px;
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
line-height: 1;
|
|
|
|
|
color: var(--text-secondary);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.vol-btn:hover {
|
|
|
|
|
color: var(--text-primary);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.vol-slider {
|
|
|
|
|
width: 80px;
|
|
|
|
|
height: 4px;
|
|
|
|
|
accent-color: #89b4fa;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
}
|
|
|
|
|
|
2026-09-21 11:08:16 -04:00
|
|
|
.mark-buttons {
|
|
|
|
|
margin-left: auto;
|
|
|
|
|
display: flex;
|
|
|
|
|
gap: 4px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.mark-btn {
|
|
|
|
|
font-weight: 700;
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
padding: 4px 12px;
|
|
|
|
|
background: var(--bg-tertiary);
|
|
|
|
|
border: 1px solid var(--border);
|
2026-09-21 10:45:53 -04:00
|
|
|
}
|
|
|
|
|
</style>
|