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

The Playback Rewrite #1057

Open
15 of 35 tasks
nielsvanvelzen opened this issue Jul 31, 2021 · 12 comments
Open
15 of 35 tasks

The Playback Rewrite #1057

nielsvanvelzen opened this issue Jul 31, 2021 · 12 comments
Labels
confirmed Issue can be reproduced roadmap Discussion about a significant change to the app

Comments

@nielsvanvelzen
Copy link
Member

nielsvanvelzen commented Jul 31, 2021

🚀 What is The Playback Rewrite?

The goal of the rewrite is to create new playback code from scratch for video playback, audio playback and live tv. The new code should be easier to maintain and be prepared for a migration to Jellyfin 11. New features like SyncPlay can be added without much trouble. All code is Kotlin-first and uses the new SDK. It should be used by all our official Android apps for consistent behavior between (Android-) devices when playing files.

The rewrite is a very long project because I'm just one person volunteering to work on Jellyfin in my spare time. There is no hard deadline or specific version goals. This issue contains a task list of the bigger features/changes.

Status updates will be posted occasionally in the comments. Please read the bottom paragraph of this issue before commenting yourself.

🏆 Tasks

This list will change over time, some features might not be available on the initial release of the new playback code. When possible issues/pull requests will be linked for tracking purposes. There is no particular order for this list, new features might be added before restoring older features.

The amount of checked boxes does not indicate progress or completeness of the rewrite. Some changes required to make this happen have been running in production since version 0.15.0.

🏗️ Preparations

Various tasks that need to be completed to work on the rewrite.

🎆 Proof of Concept

🔄 Restoring features

🛠️ Integration (ATV)

🛠️ Integration (mobile)

  • Make player UI touch compatible
  • Release playback module to Maven Central (same versioning as the app)
  • Replace native player with playback module
  • Restore missing features

💥 Adding new features

Server blockers

Some features cannot be made or won't work great without changes to the server. This is a list of them.

❗ This issue

Please do not reply to this issue for any questions about the playback rewrite. The comment sections is meant for our contributors to give updates or discuss the implementation. For anything else, please create a new issue or discussion. We may delete your comment if we consider it off topic.

@nielsvanvelzen nielsvanvelzen added the roadmap Discussion about a significant change to the app label Jul 31, 2021
@nielsvanvelzen nielsvanvelzen pinned this issue Aug 2, 2021
@nielsvanvelzen nielsvanvelzen added confirmed Issue can be reproduced and removed stale labels Jan 26, 2022
@jellyfin jellyfin deleted a comment from jellyfin-bot Mar 25, 2022
@mueslimak3r
Copy link
Member

I was looking intro the code for trailer playback last night and I see that the object for external trailers just uses links videos (eg: a link to a youtube video). I'm not sure how feasible it would be, but it seems like a good design for a re-written player might be for it to just play video links. Then other classes would be queried for stuff specific to jellyfin like subtitle object classes, mediastream info, etc.

With the current player it's entirely designed around using jellyfin specific classes like BaseItemDto and its MediaStreams and SubtitleInfos, etc. Because of this it's not possible to make exoplayer play an arbitrary youtube link, even though exoplayer is capable of doing so.

@nielsvanvelzen
Copy link
Member Author

it seems like a good design for a re-written player might be for it to just play video links.

The current implementation already does this, it never uses the Jellyfin API directly to make it easier to update if the ever API changes. This doesn't mean that YouTube video is supported though, the implementation will only allow video from the Jellyfin server. If we want to support YT a server plugin should deal with that, not the client.

Then other classes would be queried for stuff specific to jellyfin like subtitle object classes, mediastream info, etc.

My idea is to create some kind of "lookup" service where the playback code queries for data. This service would be implemented in the app code. I haven't worked on this part yet.

it's not possible to make exoplayer play an arbitrary youtube link, even though exoplayer is capable of doing so.

I don't think this is possible without using the proprietary YouTube API.

@Andy2244

This comment was marked as off-topic.

@Yeetov

This comment was marked as spam.

@nielsvanvelzen
Copy link
Member Author

Let me give all of you another (quick) status update about the famous playback rewrite. I've been very busy the past few weeks (might even be months, didn't check) on a few key points:

  1. 10.9 compatibility. This work happens in multiple places, from manually validating each API change in the release to updating the SDK and updating the app. This work is now done and the current 0.16.z releases of the app are fully compatible.
  2. Refactoring the app to fully use the SDK. I recreated the layer that talks with the API a few years back, this is our "Kotlin SDK". However, the app still used our old "Java Apiclient" in most places. With all new additions in 10.7, 10.8 and 10.9 I could no longer not use the SDK as all newly added features could not be used. This migration took up most of my time and I can now say that almost all code is using the SDK! The first (real) 10.9 feature I added is support for normalization gain in music playback (Implement normalization gain for music tracks #3660)!
  3. Rethinking some core components of the playback code. Most of this is now implemented and this should make it easier to add video playback related functionality.
  4. Add video support. The initial changes are already merged, and development builds have an option to enable it. It's highly experimental but it does work, you can play video now.

While all of this is great news, I'm also working towards the next release of the app, 0.17.0. The current release started its beta cycle almost a year ago so it's time for a new one. Considering the new video playback is still very early it will not be ready for 0.17. The experimental option for it will also most likely be hidden for the release (still debating this part).

This was the quick status update for now, I didn't bother too much with the formatting or even re-reading it so forgive me for any mistakes. Hoping to give the next status update a lot quicker!

Happy watching!

If you appreciate my work, you can show your support with a donation through GitHub sponsors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed Issue can be reproduced roadmap Discussion about a significant change to the app
Projects
Status: started
Development

No branches or pull requests

8 participants