-
-
Notifications
You must be signed in to change notification settings - Fork 219
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 android auto support #143
Conversation
Before I start reviewing I'd like to point out a few things:
And lastly, thanks for this contribution! I'm really excited to see our efforts for the app rewrite are enabling features like this. |
Cool! Does this have playlist support? |
@nielsvanvelzen That all sounds good. For reference, I have been doing the majority of testing on my phone using the Android Auto for phones app @neopc10 Good idea. I just added that. Going forward I don't want to add too much more to this pr, otherwise it may become harder to review. |
I had some issues to get the Android Auto app working but fortunately Google made the "Android Media Controller Test" app which is useful for testing the media browser: |
Sorry I am of no help here whatsoever, but I just want to cheer you on from the sidelines, sooooo yeah! 🥳 🙌 Really looking forward to this! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Just one tiny change left.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution! The changes generally look quite good, I'm not happy with some smaller parts and some of the formatting however. Also, I think some things require advance changes to the rest of the app, as described in the individual comments.
@Spacetech I've decided to not do the database stuff and merge this pretty much as is. I've already rebased it locally onto the latest master and fixed the conflicts and squashed the commits in that process. If it's ok for you, I'd force push the changes to this branch. |
@Maxr1998 Yea that sounds great. Go for it |
Perfect! I just noticed that since we updated ExoPlayer in the meantime, the MediaService uses deprecated APIs now. I'll fix those in a minute 😁 |
Updated to the latest ExoPlayer APIs, refactored some code, fixed the album covers for the currently playing song (it didn't work for me because for my collection only the albums have images, so now it falls back to those), and gave it a final test, worked perfectly. I'm happy now 😊 |
"StartTimeTicks=0&" + | ||
"EnableRedirection=true&" + | ||
"EnableRemoteMedia=true" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- The deviceId should probably be plaintext, not base64
- PlaySessionId doesn't exist
- StartTimeTicks should default to 0 when missing
- EnableRedirection is true by default
@Spacetech if you have any interest in adding this to Gelli feel free 😅 lots of people ask about Android Auto but I can't exactly test it easily without a device that supports it. |
Hey @Spacetech you mind it if I use your YouTube video in the 2.1 release notes? edit: I'll go ahead and use it in our blog post (jellyfin-archive/jellyfin-blog#84). Please let us know if you don't like that and we'll remove the video asap. |
@nielsvanvelzen I don't mind, go for it. |
This change adds basic android auto support. A video of it in action for reference: https://youtu.be/Zl-ETVcv5BQ
Main changes:
MediaBrowserServiceCompat
which lets Android auto detect Jellyfin as a music playerNotes:
MediaService
(implementation ofMediaBrowserServiceCompat
) is a fairly standalone thing. Due to how android auto music players work, it will not rely on the main webview for ui. Instead it will use theApiClient
to load data from Jellyfin.car
because that's more inline with what Google calls it - Android for CarscreateMediaSource
method on what the web client did. Is there a better way to obtain this url? (is there an api property for it?)I see this as basic support that should be good enough to merge for now. There's certainly room for improvement. Here's a few ideas:
This was my first time using Kotlin so let me know if I did anything weird. Thanks
References: