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

Add playlist panel to video player page #237

Merged
merged 2 commits into from
Jun 25, 2024
Merged

Add playlist panel to video player page #237

merged 2 commits into from
Jun 25, 2024

Conversation

dan-niles
Copy link
Collaborator

This PR adds a playlist panel to the video player page.

  • Added a playlist panel that displays the videos in a playlist (Playlist is loaded through the list query parameter in URL)
  • Added player control buttons to loop (Loop video/playlist) and shuffle playlist.
  • Updated error handling for unknown videos, playlists and paths.

Screenshot:
image

Closes #216

@dan-niles dan-niles self-assigned this Jun 21, 2024
@dan-niles dan-niles marked this pull request as ready for review June 21, 2024 16:04
@dan-niles dan-niles requested a review from benoit74 June 21, 2024 16:04
Copy link
Collaborator

@benoit74 benoit74 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, works well, thank you!

Only a small interrogation. I'm not familiar at all with the nextTick API, and I fail to find examples on the net on how to use this properly. Do we really need the two calls to nextTick, once in the watch and once in the method itself?

@benoit74
Copy link
Collaborator

Maybe one question for @Popolechien: we have a setting at ZIM level regarding autoplay, which is used to decide if we want to autoplay the video every time a page is opened. By default, it is off.

However, with the new UI in playlist mode we will now automatically move from one video to the next when the video is over. Do we still want to take into account the autoplay setting? I.e. if autoplay setting is false, when a video finishes, the UI moves automatically to the next video but video does not start. Or do we want to always start the next video automatically in such a situation?

@Popolechien
Copy link

What does Youtube do? Unless we can make a compelling argument that our users are different from theirs, we should mimic YT's behaviour as much as possible (which may, at times, include things we at a personal level do not particularly enjoy).

Autoplay it is, then.

@benoit74
Copy link
Collaborator

Agreed.

Does it means we do not really need the "autoplay" setting at scraper level and could even imagine to get rid of it? Do you recall when / why it was introduced? I imagine it could be to save bandwidth (avoid loading the video if the user finally decides he does not want to see it) but I'm not sure it makes lot of sense in terms of usability.

@Popolechien
Copy link

Do you recall when / why it was introduced?

I think you wildly overestimate my technical involvement or even my ability to understand why certain technical choices are made. But thank you for that :-)

I am pretty sure I don't understand the difference between autoplay and autoplay at scraper level, so I'll focus on the end result and simply ask that things, well, autoplay.

@dan-niles
Copy link
Collaborator Author

dan-niles commented Jun 25, 2024

Only a small interrogation. I'm not familiar at all with the nextTick API, and I fail to find examples on the net on how to use this properly. Do we really need the two calls to nextTick, once in the watch and once in the method itself?

@benoit74 Oops that's a mistake. Thanks for pointing it out. I must have duplicated it when doing some debugging and forgot to remove it. Removed it in 59b89cd.

nextTick() is used to ensure that the automatic scrolling in the playlist panel happens after the DOM updates for loading the next video are completed.

@dan-niles
Copy link
Collaborator Author

If there is anything else to fix please let me know or else I can squash and rebase. Should I remove the --autoplay argument and make autoplay always true? or do we create a seperate issue for this?

@dan-niles dan-niles requested a review from benoit74 June 25, 2024 05:00
@benoit74
Copy link
Collaborator

If there is anything else to fix please let me know or else I can squash and rebase.

Please squash and rebase

Should I remove the --autoplay argument and make autoplay always true? or do we create a seperate issue for this?

Please update #233 by changing title and add a new comment saying that we've finally decided to autoplay: true and remove CLI argument, referring to the discussion in this PR. And do the change in other PR for clarity.

Copy link
Collaborator

@benoit74 benoit74 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, please squash and rebase

Copy link

codecov bot commented Jun 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 1.62%. Comparing base (d0212f9) to head (4af6500).

Additional details and impacted files
@@          Coverage Diff          @@
##            main    #237   +/-   ##
=====================================
  Coverage   1.62%   1.62%           
=====================================
  Files         11      11           
  Lines       1049    1049           
  Branches     158     158           
=====================================
  Hits          17      17           
  Misses      1032    1032           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dan-niles
Copy link
Collaborator Author

Squash and rebase completed

@dan-niles dan-niles requested a review from benoit74 June 25, 2024 07:26
Copy link
Collaborator

@benoit74 benoit74 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like rebase is not finished, your branch is still not on top of main latest commit

@dan-niles dan-niles requested a review from benoit74 June 25, 2024 09:09
Copy link
Collaborator

@benoit74 benoit74 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you

@benoit74 benoit74 merged commit bb26bfb into main Jun 25, 2024
9 checks passed
@benoit74 benoit74 deleted the playlist-player branch June 25, 2024 09:28
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.

UI Revamp: Playlist Video Player Page
3 participants