-
-
Notifications
You must be signed in to change notification settings - Fork 530
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 backend and plugin systems #2401
Add playback rewrite backend and plugin systems #2401
Conversation
playback/jellyfin/src/main/kotlin/queue/item/BaseItemDtoUserQueueEntry.kt
Fixed
Show fixed
Hide fixed
import org.jellyfin.playback.core.plugin.PlaybackPlugin | ||
import org.jellyfin.playback.core.plugin.PlayerService | ||
|
||
class PlaybackManagerBuilder() { |
Check warning
Code scanning / detekt
Empty block of code detected. As they serve no purpose they should be removed.
import org.jellyfin.playback.core.PlaybackManager | ||
import org.jellyfin.playback.core.PlayerState | ||
|
||
abstract class PlayerService { |
Check warning
Code scanning / detekt
An abstract class is unnecessary. May be refactored to an interface or to a concrete class.
class PlaybackManager internal constructor( | ||
val backend: PlayerBackend, | ||
private val services: MutableList<PlayerService>, | ||
private val mediaStreamResolvers: List<MediaStreamResolver>, |
Check warning
Code scanning / detekt
Private member is unused and should be removed.
There we go, the second big PR for the playback rewrite! I've spent some time rewriting the core of the rewrite to design an architecture that I felt satisfied with the past few weeks. This PR contains a part of it. Everything related to video is removed and some unstable parts are missing too.
(Not all individual commits build because some of them are missing PlaybackManager)
Changes
Add PlaybackManager
Manages all the playback stuff, should technically support multi-instance but we'll use it single instance for now. Stores the active backend in the PlaybackRepository (name will probably change, implementation is mostly missing because most of it's functionality is video related).
Add MediaStreamResolver (currently unused, reserved for a future PR)
Returns MediaStream's (most implementation is missing because it was still incomplete/non-functional. Only stream URL for now)
Add PlayerState
It contains the current state of playback and contains functions to manipulate the state. This is one of the most important parts of the playback module.
Add PlayerBackend & BasePlayerBackend
Binds to the actual player (ExoPlayer). Emits events that are converted to the PlayerState instance. Plugins should normally not access the backend directly.
Add plugins
A plugin provides various parts to the playback code: backends, services and media stream resolvers. Most plugins will only provide services that work with PlayerState.
Queue changes
Converted to service, some metadata updates
Next PR in another year!
Issues
Part of #1057