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

Discuss playlist API #65

Closed
2 tasks done
defagos opened this issue Apr 22, 2024 · 3 comments
Closed
2 tasks done

Discuss playlist API #65

defagos opened this issue Apr 22, 2024 · 3 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@defagos
Copy link
Member

defagos commented Apr 22, 2024

As a team we should discuss which kind of helpful APIs could be provided around playlists.

Hints

Some examples from video.js:

  • shuffle
  • reverse
  • repeat
  • ...

Repeat might also have modes (all, one, etc.).

We could also discuss helpers (e.g. view model to sync model objects with player playlist).

Acceptance criteria

  • APIs have been discussed and proposals have been written down.

Tasks

  • Discuss and document.
  • Create dedicated issues.
@defagos defagos converted this from a draft issue Apr 22, 2024
@defagos defagos added the documentation Improvements or additions to documentation label Apr 22, 2024
@defagos defagos moved this from ✏️ Draft to 📋 Backlog in Pillarbox Apr 22, 2024
@defagos defagos modified the milestone: Tracks Apr 22, 2024
@defagos defagos moved this from 📋 Backlog to 🚧 In Progress in Pillarbox May 30, 2024
@defagos
Copy link
Member Author

defagos commented May 30, 2024

Differences

  • The web API has a repeat API for the whole playlist (repeat all). Calling next wraps around the playlist in repeat mode, but calling previous in repeat mode still stops on the first item. Android has repeat all and repeat one behaviors.
  • The web has no pre-buffering of the upcoming item. Android and Apple have.
  • Android and the web have currentIndex and currentItem properties. Apple only has current index at the moment (and maybe current item has little interest since player items are not really useful per se).
  • The web provides a standard UI component (which can be customized as usual). Android and Apple do not yet but some developers have requested a component to drive the playlist UI on Apple platforms (view model currently in the demo).
  • Apple and Android have smart and non-smart navigation APIs. Smart navigation returns to the beginning of the current item if not within the first 3 seconds of the content. The web does not.
  • Apple has no built-in shuffle API unlike Android and the web. Shuffling is made on the model side and applied when synchronizing the playlist items. This API would rather make sense in a playlist UI view model on Apple platforms.
  • On Android the shuffle API changes the next and previous indices but not the playlist itself.
  • The next API on Android returns to the live edge is the item is a livestream with DVR.

Remark

All platforms support auto-advance or pause at the end of an item.

Remaining work

  • Repeat on Apple platforms (repeat one and repeat all). Have next item APIs move back to the playlist start when repeat mode is enabled.
  • Repeat one on the web.
  • Playlist view model on Apple platforms. Not really useful on Android apparently.
  • Make smart navigation interval configurable on Apple platforms (with default set to 3 seconds).

Question

  • Index or item-based (or both, or mixed) on Apple platforms? But likely the current API is ergonomic enough.

API reference

@defagos
Copy link
Member Author

defagos commented May 30, 2024

@defagos defagos closed this as completed May 30, 2024
@github-project-automation github-project-automation bot moved this from 🚧 In Progress to ✅ Done in Pillarbox May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
Status: ✅ Done
Development

No branches or pull requests

6 participants