Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(video-player): playback service and storage #241

Closed
4 tasks done
chrismclarke opened this issue Feb 23, 2024 · 0 comments · Fixed by #263
Closed
4 tasks done

feat(video-player): playback service and storage #241

chrismclarke opened this issue Feb 23, 2024 · 0 comments · Fixed by #263
Assignees

Comments

@chrismclarke
Copy link
Collaborator

chrismclarke commented Feb 23, 2024

Is your feature request related to a problem? Please describe.
Following work on #237 it is now possible for a video to be resumed on native after being closed, however the playback state only persists for as long as the component (so destroyed after page back navigation or app restart).

Instead it would be useful to persist the playback state of all videos across sessions, and provide users indication of which videos have been previously viewed and which are in progress.

Describe the solution you'd like

  • Create a video-player.service.ts file to manage main logic for storing and retrieving playback state
  • Create a folder in the video-player for schemas and create a database schema to hold video playback information (e.g. video id, current time, total time, playback percentage). Would recommend calling the data table video-playback
  • Add data bindings to update db entries from the service when video playback events
  • Add ui to show playback progress bar below start button

Additional context
Video player code in libs\shared\src\features\video-player

The video player currently generates a random id for each video played, however it would be good instead pass as an input that can be used to link with the db. E.g. when linking with a video resource the input could allow for the resource.id to be passed

<picsa-video-player [source]="videoUri" [id]="videoResource.id"></picsa-video-player>

Progress bar ui can just be mat-progress-bar, with some extra css to make it sit below the play start button.

Example of creating db schema and using with service can be found in apps\picsa-tools\seasonal-calendar-tool\src\app\schema and apps\picsa-tools\seasonal-calendar-tool\src\app\services\calendar.data.service.ts. Full rxdb docs at https://rxdb.info/rx-schema.html


Misc
I also thought it might be a nice enhancement to look into auto-generating thumbnails for videos, although I think probably better as a lower priority follow-up so excluding from here. But just to put some links for research purposes (so I can close some tabs!):

Web

Native

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants