jellyfin-android
jellyfin-android copied to clipboard
Play next episode from video
Describe the feature you'd like Would be nice if we can press the next icon in the player overlay to go to the next episode. Also automatically playing the next episode when an episodes finishes.
Exoplayer or web player?
Exoplayer
So i started looking into the code and as far as i understand it there are 2 solutions to this problem. Currently the native player is implemented as a player with local playlist management (just like the web player) . Which means that playbackmanager.js in the web client manages playback and playlists (see enableLocalPlaylistManagement in playbackmanager.js). To make sure the native player (and i guess the external player as well) can skip to the next video (both at the end of the video and on user input) we can:
-
The local playlist management approach: Make sure the callback onPlaybackStopped is triggered correctly (which is triggered by the event 'stopped'. This hold the logic for going to the next video. I will then also have to replace the default exo_next and exo_previous buttons, because exoplayer has not internal playlist in this case and hides the next button.
-
The non local playlist management approach: On loading of a video us self._playQueueManager.getNextItemInfo() to load the entire playlist in the native player. Also implement the player.nextTrackand previousTrack function. Exoplayer behaviour would then stay default
Advantages for 1 is staying as close to the webclient implementation as possible and with that using tried and tested code and reducing weird interaction behaviour, advantage of 2 is that we stay close to the native exoplayer implementation and reduce implementation effort. I prefer option 1, what do you prefer? I would like your feedback before starting implementation
So i started looking into the code and as far as i understand it there are 2 solutions to this problem. Currently the native player is implemented as a player with local playlist management (just like the web player) . Which means that playbackmanager.js in the web client manages playback and playlists (see enableLocalPlaylistManagement in playbackmanager.js). To make sure the native player (and i guess the external player as well) can skip to the next video (both at the end of the video and on user input) we can:
The local playlist management approach: Make sure the callback onPlaybackStopped is triggered correctly (which is triggered by the event 'stopped'. This hold the logic for going to the next video. I will then also have to replace the default exo_next and exo_previous buttons, because exoplayer has not internal playlist in this case and hides the next button.
The non local playlist management approach: On loading of a video us self._playQueueManager.getNextItemInfo() to load the entire playlist in the native player. Also implement the player.nextTrackand previousTrack function. Exoplayer behaviour would then stay default
Advantages for 1 is staying as close to the webclient implementation as possible and with that using tried and tested code and reducing weird interaction behaviour, advantage of 2 is that we stay close to the native exoplayer implementation and reduce implementation effort. I prefer option 1, what do you prefer? I would like your feedback before starting implementation
I'd prefer to keep web-related changes to the ExoPlayer at a minimum, to make it easier to switch to a native interface without the webclient in the future. Not sure what approach would fit better in that regard, but I'm also leaning towards option one, if any.
hmm if you want to replace the webclient in the future then i actually think option 2 is better. It uses exoplayer for playlist management and doesn't break the exoplayers next and previous buttons. The question then becomes if with exoplayer we can create the same at least the same features as the webclient