Skip to content

feat: persist playback progress per recording in localStorage#348

Open
Beldaa wants to merge 1 commit intobigbluebutton:developfrom
Beldaa:feat/playback-progress-persistence
Open

feat: persist playback progress per recording in localStorage#348
Beldaa wants to merge 1 commit intobigbluebutton:developfrom
Beldaa:feat/playback-progress-persistence

Conversation

@Beldaa
Copy link
Contributor

@Beldaa Beldaa commented Mar 20, 2026

Summary

Adds a feature to persist playback progress for each recording using localStorage. This allows users to resume watching a recording from where they left off, even after closing the browser or refreshing the page. It provides a more modern and user-friendly experience by remembering the last viewed position automatically.

What it does

  • src/utils/progress.js — A new utility module that handles reading, writing, and clearing playback data in localStorage. It includes a throttling mechanism to prevent excessive writes and a minimum time threshold to avoid saving progress at the very beginning of a session.
  • src/components/Webcams/index.jsx — Integrates the progress utility into the player lifecycle. It saves the current time periodically during playback and restores it when the player loads.
  • Logic Priority — The system follows a specific hierarchy: it first checks for a time parameter in the URL (which takes priority), and if none is present, it attempts to restore the position from localStorage.

Usage

The feature works automatically in the background.

  1. As a user watches a recording, their progress is saved every 5 seconds (if they have watched more than 5 seconds).
  2. When the same recording is opened again, the player will automatically seek to the last saved position.
  3. If a specific start time is provided via URL (e.g., ?t=10m), the URL parameter will override the saved progress.

Note: This data is stored locally in the user's browser and is unique to each recording ID. No server-side changes are required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant