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 playback rewrite queue system #2209

Merged
merged 2 commits into from
Oct 26, 2022

Conversation

nielsvanvelzen
Copy link
Member

There we go, the first real code for the playback rewrite! This code was relatively stable (didn't see much changes in my occasional refactoring) so it's good enough to PR upstream.

Changes

playback.core

  • Add Queue interface
    A queue contains the items to play, simple as that. Queues are always lazy loaded to allow for big queues or changing future items on demand.

  • Add EmptyQueue implementation
    It's a queue that is empty.

  • Add PagedQueue implementation
    This one is kinda cool, it loads (sequential) pages of items and cache them. So when the player wants to know the next queue item it might have (pre-)loaded already so no network request is needed. Most of the Jellyfin specific queue implementations use this one as base.

  • Add SequenceQueue implementation
    Like PagedQueue but with a sequence, I used this before creating the PagedQueue. Currently unused but might still have some use cases in the future.

  • Add initial QueueManager
    It's a helper to work with queues, this one will probably change a bunch in upcoming PR's.

  • Add QueueEntry
    It's an item in the Queue. This interface contains properties that are used by all playback components. Including the QueueEntryMetadata which is a container for all kinds of properties used for mediasessions, media notifications, player metadata, logging etc. etc.

playback.jellyfin

  • Add BaseItemDtoUserQueueEntry
    Implementation for QueueEntry that contains Jellyfin specific data (like BaseItemDto). It contains a builder function that is used by the Jellyfin specific queue implementations.

  • Add AudioAlbumQueue, AudioInstantMixQueue, AudioTrackQueue
    Music specific implementations for the player. As I said before, focus is currently on getting music to work perfect before working on video. These three queues should be sufficient for most music playing scenarios. There might still be some more like an ArtistQueue later.

  • Add EpisodeQueue
    Focus is on music but video playback already works.. locally. This one is to play episodes in a season.

Issues

Part of #1057

@nielsvanvelzen nielsvanvelzen added the playback Issue related to media playback label Oct 25, 2022
@nielsvanvelzen nielsvanvelzen changed the title Add queue system to playback-core Add playback rewrite queue system Oct 25, 2022
@nielsvanvelzen nielsvanvelzen marked this pull request as ready for review October 25, 2022 07:58
@nielsvanvelzen nielsvanvelzen merged commit 0938a8a into jellyfin:master Oct 26, 2022
@nielsvanvelzen nielsvanvelzen deleted the playback-queue branch October 26, 2022 21:10
@nielsvanvelzen nielsvanvelzen added this to the v0.15.0 milestone Oct 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
playback Issue related to media playback
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants