Skip to content

feat(player): video chapters & bookmarks with per-video persistence#1718

Open
mazen-salah wants to merge 1 commit into
anilbeesetti:mainfrom
mazen-salah:feat/chapters-compose
Open

feat(player): video chapters & bookmarks with per-video persistence#1718
mazen-salah wants to merge 1 commit into
anilbeesetti:mainfrom
mazen-salah:feat/chapters-compose

Conversation

@mazen-salah

Copy link
Copy Markdown

Summary

Adds a Chapters / bookmarks feature to the player, built on the current Jetpack Compose UI.

This supersedes #1146, which was written against the old XML / view-binding player and is no longer mergeable after the Compose rewrite — every layout it modified (exo_player_control_view.xml, bottom_sheet_sections.xml, …) has since been removed. I re-implemented the feature from scratch following the patterns already used by the existing selector panels.

What it does

  • A Chapters button in the bottom player controls:
    • Tap → opens a chapters panel (same overlay style as the playback-speed / playlist selectors).
    • Long-press → adds a bookmark at the current position.
  • In the panel you can tap an entry to seek to it, add a bookmark, import a chapters file, or export the current list. Entries are simple { "title": String, "timestampMs": Long } JSON objects.
  • Chapters are persisted per video in the existing Room media_state table, so they survive reopening the file.

Implementation

  • New Chapter model + ChapterListConverter in core:model (kotlinx-serialization, already a dependency there — keeps other modules dependency-free).
  • media_state gains a chapters TEXT column; DB version 4 → 5 with an additive, non-destructive MIGRATION_4_5. Generated 5.json schema is included.
  • MediaRepository gains updateChapters / getChaptersStream, using the same read-copy-upsert pattern as the other per-video state.
  • UI follows the existing selector convention: OverlayView.CHAPTERS + ChaptersSelectorView + a rememberChaptersState holder, plus one PlayerButton in ControlsBottomView.
  • No new dependencies and no DI-graph changes beyond the added repository method.

Testing

  • Builds clean — ./gradlew :app:assembleDebug passes (Room v4→5 KSP, Hilt, resource linking and packaging all succeed).
  • On-device verification of the full flow (add → seek → import/export → persistence across reopen) is in progress.

Happy to adjust the button placement, naming, or the import/export format to match your preferences. Supersedes #1146.

Re-implements the chapter/bookmark feature on the Compose player. A new
Chapters control opens an overlay panel listing {title, timestamp} entries;
tap to seek, long-press the control (or the panel's add button) to bookmark
the current position, and import/export the list as JSON. Chapters are
persisted per video in the existing Room media_state table (new TEXT column,
DB v4->5) so they survive reopening the file.
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