MedTalks Admin Dashboard · Confidential · May 2026

Recording Feature
Technical Spec
& Delivery Plan

Platform Flask · Firebase · LiveKit
Access Model Hybrid Batch + Admin Control
Estimated Effort ~48 hrs
Version 2.0 · Final Spec
Key backend pipeline already exists — this is frontend, access control & anti-piracy work only
What's Inside This Document
  1. What Already Exists & What Needs To Be Built
  2. How the Whole System Will Work — Workflow Diagram
  3. Who Gets Access to Recordings — Access Model
  4. Anti-Piracy & Content Protection — All 4 Layers
  5. Screen Recording Blocking — How It Works
  6. All Edge Cases — What Could Go Wrong & How We Handle It
  7. Day-by-Day Delivery Plan (Max 5 Days)
  8. Total Estimate & Summary
Section 01

What Already Exists & What Needs to Be Built

Think of the recording feature like an iceberg — the heavy, hard part (the engine) is already underwater and built. What we're doing now is building the visible tip: the controls, the playback screen, the access gates, and the security locks.

✓ Already Built — Do Not Touch
🟢Recording Enginerecording_worker.py handles start/stop, splits the session into small video chunks (~7 sec each), and uploads them automatically
🟢API Endpoints — All backend routes exist: start recording, stop recording, get status, list past recordings, get playlist
🟢Video Storage — Chunks upload to Firebase Storage in near real-time as the meeting happens
🟢HLS Playlist — Generates a streaming playlist (.m3u8 file) that lets videos play smoothly on any device
🟢Database Schema — Meeting records already have fields for is_recording, recording_id, and history
🟢Crash Cleanup — Server automatically clears orphaned/stuck recording sessions on restart
✗ Needs to Be Built Now
🔴Start/Stop Buttons — Admin controls inside the live meeting room UI
🔴Live Recording Indicator — Red blinking dot visible to all participants so they know they're being recorded
🔴Consent Banner — Pop-up notification to participants when recording starts
🔴Access Control — Logic that decides who can see which recordings (Hybrid Batch + Admin model)
🔴Playback Page — Video player for watching recordings, with seek bar, fullscreen, mobile support
🔴Anti-Piracy Layers — AES-128 encryption, screen capture blocking, dynamic watermark, signed URLs
🔴Admin Management Panel — List all recordings, grant/revoke access per user, delete, set expiry
Bottom Line for the Client: The hardest engineering work (the recording engine) is done. We're building the interface on top of it. This is why the delivery timeline is short — we're not starting from scratch.

Section 02

How the Whole System Works

Below is a complete map of the recording feature — from the moment an admin clicks "Start Recording" to the moment a student watches it. Green boxes are already built. Red boxes are what we're building now.

Already Built To Be Built External Service Security Layer ADMIN SIDE RECORDING ENGINE SECURITY LAYER STUDENT SIDE Admin Clicks ▶ Start Recording Role Check Admin / Student? ✓ Yes ✗ 403 Error API Route /start-recording ✓ Broadcast 🔴 Live Indicator + Consent Banner LiveKit Egress Engine ✓ Composites video → HLS chunks (~7s each) AES-128 Encrypt Each chunk encrypted 🔐 Firebase Storage ✓ Encrypted .ts chunks stored encrypted HLS Playlist ✓ playlist.m3u8 generated Signed URL Service 90-min expiry · auth check AES Key Endpoint /api/recordings/{id}/key Access Control Check Batch? Granted? Revoked? Dynamic Watermark Name + email overlay on player Student Watches Recording HLS player · watermarked · screen-blocked Screen Capture Detected → Paused Audit Log Written Who · When · IP · Duration
Reading the diagram: Follow the flow top to bottom. An admin triggers recording → the engine captures and encrypts in real-time → security layers guard who can access and decrypt the content → a student sees the video with their name watermarked on top. Every red box is new work; every green box is reused.

Section 03

Who Gets Access to Recordings

We're using a Hybrid Model (Batch + Admin Control). Think of it in two layers: an automatic layer (everyone in the class gets access without any manual work) and an override layer (admin can add or remove specific people).

🏫

Automatic Batch Access

Every student currently in the batch linked to that meeting automatically gets access to its recording — no admin action needed.

Admin Manual Grant

Admin can add any specific person (by email) to a recording — even if they're not in the batch. Useful for makeup sessions or guest access.

🚫

Admin Manual Revoke

Admin can block a specific student even if they are in the batch. Revoke always wins — it overrides the batch membership.

Access Check — Step by Step

Every time a user tries to open a recording, the system runs through these checks in order:

StepCheckOutcome
1Is the user logged in?No → Redirect to login
2Is the user an Admin?Yes → Full Access
3Is the user the assigned Teacher for this batch?Yes → Access Granted
4Has the recording's access expiry date passed?Yes → Access Denied
5Is the user in the Revoked list?Yes → Denied (overrides grant/batch)
6Is the user in the Manually Granted list?Yes → Access Granted
7Is the user a member of the batch linked to this meeting?Yes → Access Granted
8None of the above match403 — Access Denied

Role Permissions at a Glance

CapabilityAdminTeacherStudent
Start / Stop a recording Yes Own meetings No
See list of recordings All meetings Own meetings Assigned only
Watch / stream a recording Yes Yes If access granted
Download a recording Yes No (configurable) Never
Delete a recording Yes No No
Grant / Revoke access Yes No No
Set access expiry date Yes No No

Section 04

Anti-Piracy & Content Protection

Medical education content is valuable. We protect it with 4 independent layers — even if a determined person bypasses one layer, the others remain. Think of it like a vault with four locks.

Honest Note for the Client: No browser-based protection is 100% unbreakable. A person holding a phone camera up to their screen can always record. The goal is to make piracy difficult, inconvenient, and traceable — not theoretically impossible. This is the same strategy used by Coursera, Unacademy, and Hotstar.
01

🔐 AES-128 Chunk Encryption — "The Vault"

Every video chunk is encrypted before it's stored in Firebase. Even if someone downloads all the raw video files, they are completely unplayable — like having a safe but no combination. The decryption key is only handed out to authenticated, authorised users through our secure backend.

Blocks: direct file downloads · ffmpeg ripping · URL sharing · audio-only extraction tools

Very High ~4 hrs work
02

🛡️ Screen Recording Blocking — "The Disruptor"

CSS and JavaScript tricks that disrupt how screen-recording tools capture the video frame. When the browser detects a screen capture is happening, playback pauses automatically and a warning overlay appears. Full detail in Section 5.

Blocks: OBS, ShareX, browser screen share, QuickTime, Windows Game Bar (~60–80% effectiveness)

Medium–High ~10 hrs work
03

🔖 Dynamic Watermark — "The Fingerprint"

Every student sees their own name and masked email address moving slowly across the video (semi-transparent). If they screen-record it anyway, their identity is baked into every frame. When a pirated copy surfaces, we can immediately trace exactly which account it came from.

Watermark injected server-side — cannot be removed by inspecting JavaScript

High (Deterrent) ~4 hrs work
04

🔗 Signed URLs + Session Binding — "The Expiring Key"

All video links automatically expire after 90 minutes. If a student copies a link and sends it to a friend, by the time the friend opens it, the link is dead. Every playback session also requires an active login — no login, no video. Every key request is rate-limited and logged with the user's IP address.

Blocks: link sharing · URL scraping · automated key harvesting bots

Very High ~6 hrs work

Protection Summary Table

TechniqueWhat It StopsEffectivenessIncluded?
AES-128 EncryptionRaw file download, ffmpeg, audio rippingVery HighYes — Day 2
CSS Capture DisruptionOBS, ShareX, screen recorder apps~60%Yes — Day 2
JS Capture DetectionBrowser-native screen shareHigh in ChromeYes — Day 2
Dynamic WatermarkScreen recording deterrence + tracingHigh deterrentYes — Day 3
Right-click / Shortcut BlockingCasual non-technical usersLow–MediumYes — Day 3
Signed URLs + Session BindingLink sharing, URL scrapingVery HighYes — Day 2
Key Rate Limiting + Audit LogAutomated key harvestingHighYes — Day 4
Full DRM (Widevine L1)OS-level capture (Netflix-grade)MaximumDeferred — Phase 2

Section 05

Screen Recording Blocking — How It Works

This deserves its own section because it's often misunderstood. Here's what we actually do, in plain English:

🎨

Technique A — CSS Rendering Disruption

We apply invisible CSS properties to the video player that look normal to a human eye on a real screen, but produce a black or distorted frame when captured by screen-recording software. This works because screen capture tools grab the frame buffer differently from how a monitor renders it. Works on roughly 60% of common capture tools on Windows and Mac Chrome.

📡

Technique B — Browser Screen Share Detection

Modern browsers expose an API that fires an event when the tab is being captured. We listen for this event — the moment a student starts sharing their screen in the same browser, we automatically pause the video and show a warning: "Screen recording detected — playback paused." Does not catch external apps like OBS capturing the desktop.

🖱️

Technique C — UI Controls Disabled

Right-click menu is disabled on the video player. Keyboard shortcuts that could save or inspect the page (Ctrl+S, Ctrl+U, F12) are blocked within the playback page. The video element cannot be dragged away. If DevTools is detected as open, the video pauses. These are deterrents for non-technical users — a developer can bypass them, which is why the other layers exist.

👁️

Technique D — Tab Visibility Detection

When a student switches away from the tab (e.g., to open OBS), we can optionally pause the video and apply a dark overlay — forcing them back to the tab to continue watching. This adds friction without fully blocking determined users.

Full DRM (Netflix-level blocking) — True OS-level screen capture blocking (Widevine L1) requires a commercial DRM license server (~$200–500/month) and a major architectural change. This is deferred to Phase 2 and is not part of the current 5-day plan. The 4 techniques above cover 90% of practical piracy scenarios for an education platform.

Section 06

All Edge Cases — What Could Go Wrong & How We Handle It

Edge cases are unusual situations that can break a feature if not planned for. We've identified every major scenario across four categories. Each has a defined handling strategy built into the delivery plan.

6.1 — Recording Lifecycle

Things that can go wrong during an active recording session.

ScenarioRiskHow We Handle It
Admin starts recording in an empty room Medium Show a warning popup before starting. Recording can still run but admin is informed the room is empty.
Admin stops recording within 10 seconds of starting Low May produce zero or partial chunks. System will not show this as a "complete" recording — it's marked as incomplete and excluded from the playback list.
Server restarts while recording is in progress High The recording engine (LiveKit Egress) runs as a separate process and may continue independently. On restart, the cleanup script reconciles any orphaned sessions via the LiveKit API and marks them correctly.
Network drops between server and recording engine High Chunk upload retries with exponential backoff (wait 2s, then 4s, then 8s). Admin gets an alert if upload fails after 3 retries.
Admin tries to start a second recording while one is running Low Already blocked in the backend. UI will show a clear message: "A recording is already in progress."
Meeting ends while recording is still active High Recording is automatically stopped as part of the meeting end flow — a hook is added to the existing meeting end logic. No orphaned recordings.
Recording engine crashes mid-session High Backend polls the engine status every 30 seconds. If a crash is detected, the recording is marked "incomplete", all chunks captured so far are preserved, and a partial playlist is generated so the available footage is still watchable.
Admin clicks Stop but the command times out Medium UI shows a loading spinner. After 30 seconds, it polls the status automatically. If the engine is still running, a "Force Stop" button appears.

6.2 — Storage & Cost

Video files are large. These cases protect against unexpected bills and full disks.

ScenarioRiskHow We Handle It
Very long meeting (3+ hours) High Admin is shown an estimated storage size before starting. 3 hours ≈ 1,500+ chunks ≈ significant cost. Alert triggers if expected size exceeds a set threshold.
Firebase Storage quota exceeded mid-recording High Upload errors are now detected and trigger an immediate admin alert. Admin Management Panel includes a storage usage dashboard so they can delete old recordings before quota is reached.
Server disk fills up during recording High System checks available disk space before starting a recording. If less than 2GB is free, recording is blocked. After each chunk is confirmed uploaded, it's deleted from local storage.
Old recordings are never deleted Medium Admin can set a retention policy (e.g., auto-delete after 30/60/90 days). Can also set a per-recording manual expiry date. Manual delete is always available from the Admin Panel.
Large recording causes browser to crash during playback Medium HLS streaming loads only small chunks (7 seconds each) into memory at a time — not the entire recording. The hls.js library handles this natively. No browser memory issues expected.

6.3 — Access & Playback

Edge cases around who can see what, and when access should change.

ScenarioRiskHow We Handle It
Student joins the batch after the meeting was recorded Medium Under our Hybrid Model, they will see the recording (batch-level automatic access). This is the expected behaviour — confirm with client if exceptions are needed.
Student is removed from batch after recording Medium Access is revoked immediately — the access check runs live on every request, so no cached permissions exist. Signed URLs also expire in 90 minutes.
Student shares their playback link externally High Signed URLs expire in 90 minutes. Even if shared, the link is dead quickly. The recipient also has no authenticated session to fetch the AES decryption key — so even a live link is useless without login.
Many students streaming the same recording simultaneously Medium HLS + Firebase Storage handles concurrent streaming natively via CDN. No special handling needed. Note: ensure Firebase project is on Blaze plan to avoid egress limits.
Student seeks to a part of the video that hasn't uploaded yet Low The HLS playlist only references chunks that have been fully uploaded and confirmed. The player won't stall on missing chunks — it simply won't show future timestamps until they're ready.
Playback on mobile devices Medium HLS (.m3u8) is natively supported on iOS Safari. Android Chrome requires the hls.js library, which is already planned. Both platforms will be tested before release.
Meeting has no batch assigned Low Automatic batch access doesn't apply. Falls back to admin-only access. Admin can still manually grant specific users.

6.4 — Privacy, Consent & Compliance

Especially important for a medical education platform with sensitive content.

ScenarioRiskHow We Handle It
Participants are not told they're being recorded High — Legal A consent banner immediately appears for all participants when recording starts. A persistent red dot + "Recording in progress" label stays visible for the entire session. This is a baseline legal/compliance requirement.
A participant objects to being recorded Medium The system cannot stop recording for one person only — LiveKit Egress composites all participants together. The participant's only option is to leave the session. This limitation is clearly communicated in the consent banner.
Recordings contain sensitive medical discussions High All playback URLs are authenticated — no public access ever. AES-128 encryption means raw files are unplayable. Access audit log records every viewing event. Consider data retention policy for HIPAA/compliance.
Admin account is compromised High Signed URL expiry (90 min) limits damage window. Audit logs capture all access by IP. Admin accounts should have 2FA enabled (separate security recommendation — not in this spec's scope).

Section 07

Day-by-Day Delivery Plan

With a large team, we're compressing what would be a 2–3 week solo developer build into 5 working days by running phases in parallel. Here's what gets done each day:

Day 1

Core Recording Controls — Admin Can Record

Add Start/Stop recording buttons to the admin meeting room view. Wire them to the existing backend API (already built). Implement the live recording indicator (red blinking dot + timer) visible to all participants. Add the consent banner that pops up for everyone when recording starts. Add the auto-stop hook so recording ends when the meeting ends. Basic error messages if the recording engine is unavailable.

Deliverable: Admin can start, stop, and see recordings working end-to-end in a test environment.
Day 2

Access Control + Anti-Piracy Foundation

Build the Hybrid Access Model backend: batch-level auto-access, manual grant/revoke, expiry dates, access check logic. Implement AES-128 chunk encryption — configure LiveKit Egress to encrypt output, build the authenticated key delivery endpoint. Replace all permanent Firebase Storage URLs with signed URLs (90-min expiry). Add screen capture detection + CSS disruption layer.

Deliverable: Only authorised users can access recordings. All chunks are encrypted. Screen recording is disrupted.
Day 3

Playback UI + Watermark + Admin Panel

Build the recording playback page with HLS video player (hls.js for cross-browser, native for iOS). Add play/pause, seek bar, timestamp, fullscreen controls. Implement the animated dynamic watermark (student name + masked email, slowly moving). Build the Admin Recordings Panel: list of all recordings per meeting, delete, grant/revoke access, set expiry, download button. Right-click and keyboard blocking on the player page.

Deliverable: Students can watch recordings (watermarked). Admin has full management interface.
Day 4

Hardening — Error Recovery, Storage & Audit

Implement retry logic for chunk upload failures with exponential backoff. Add crash detection for the recording engine with auto-mark-incomplete. Build disk space guard (blocks recording if server disk < 2GB free). Add local chunk cleanup after confirmed upload. Build storage usage dashboard in admin panel. Implement access audit log (who watched, when, IP). Rate limit the AES key delivery endpoint (max 1 request per 30 seconds per user).

Deliverable: Feature is production-resilient. No silent failures. All access is logged.
Day 5

QA, Testing & Production Deployment

Full end-to-end test: start recording → join as student → stop → play back across Chrome, Firefox, iOS Safari, Android Chrome. Access control security test: every role attempts every action, verify 403 on all unauthorized attempts. Signed URL expiry test. Egress crash simulation and recovery test. LiveKit Egress deployment configuration on the production server (if not already running). Final smoke test on production environment.

Deliverable: Live on production. All test cases pass. Client can do their own UAT.

Section 08

Total Estimate & Summary

Task-Level Hour Estimate

Start/Stop UI + live indicator + consent banner 5–7 hrs
AES-128 encryption config + key endpoint 4–5 hrs
Hybrid access control backend logic 6–8 hrs
Signed URLs (replace permanent links) 4–5 hrs
Screen capture blocking (CSS + JS detection) 6–8 hrs
Dynamic watermark (animated, server-injected) 3–4 hrs
Playback page + hls.js player (mobile-responsive) 5–7 hrs
Admin management panel (list, grant/revoke, delete, expiry) 8–10 hrs
Retry logic + crash detection + disk guard 4–5 hrs
Audit log + key rate limiting 3–4 hrs
QA + security testing + deployment 6–12 hrs
Total Estimated Hours ~48 hrs

What the Client Gets at the End of 5 Days

🎥

Full Recording Controls

Admin can start, stop, and manage recordings from within the live meeting room. Auto-stop when meeting ends. Consent banner for all participants.

🔑

Hybrid Access Model

Entire batch automatically gets access. Admin can override per-person. Expiry dates per recording. 8-step access check runs on every request.

🔐

4-Layer Anti-Piracy

AES-128 encryption, screen capture blocking, dynamic watermark, and 90-minute signed URLs. Medical content protected at every level.

📱

Cross-Platform Playback

Smooth HLS video player works on Chrome, Firefox, iOS Safari, and Android Chrome. Seek, fullscreen, mobile-responsive layout.

🛠️

Admin Management Panel

List all recordings, grant/revoke access per user, set expiry, delete recordings, view storage usage, download (admin only).

📋

Full Audit Trail

Every recording view is logged with user ID, timestamp, and IP address. AES key requests are rate-limited and logged. Full accountability.