diff --git a/public/app.js b/public/app.js index 1514ec9..97b5203 100644 --- a/public/app.js +++ b/public/app.js @@ -219,13 +219,25 @@ function renderClips(clips) { }); } function playClip(path) { - document.getElementById('pb-player').classList.remove('hidden'); + const player = document.getElementById('pb-player'); + player.classList.remove('hidden'); document.getElementById('pb-video').src = '/recordings/' + path; + // Store path for download button. + player.dataset.path = path; } document.getElementById('pb-close').addEventListener('click', () => { document.getElementById('pb-player').classList.add('hidden'); document.getElementById('pb-video').src = ''; }); +document.getElementById('pb-download').addEventListener('click', () => { + const path = document.getElementById('pb-player').dataset.path; + if (path) { + const a = document.createElement('a'); + a.href = '/recordings/' + path; + a.download = path.split('/').pop(); + a.click(); + } +}); // ── Settings / Onboarding ── async function renderCameraCards() { diff --git a/public/index.html b/public/index.html index a7a9f89..5032a8e 100644 --- a/public/index.html +++ b/public/index.html @@ -50,7 +50,10 @@
diff --git a/public/style.css b/public/style.css index 82141e2..5492637 100644 --- a/public/style.css +++ b/public/style.css @@ -143,6 +143,7 @@ body { .clip-player.hidden { display: none; } .clip-player video { max-width: 90%; max-height: 80%; } .clip-player button { margin-top: 12px; } +.clip-player .btn-primary { background: var(--accent); color: #fff; border: none; padding: 8px 20px; border-radius: var(--radius); cursor: pointer; font-size: 14px; } /* ── Settings ── */ .settings-toolbar {