-
-
Notifications
You must be signed in to change notification settings - Fork 969
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
feat: Android Auto Support #2094
base: main
Are you sure you want to change the base?
Conversation
This reverts commit ba3afe4.
…t-native-track-player into dev-android-auto
feat: full android auto support
feat: RemoteSkip
chore: sync up main
…ck-player into dev-android-auto
Hi @lovegaoshi - I'm wondering if local files could be supported for an Android Auto MediaItem's iconUri. It seems like this is possible with items added to the TrackPlayer (using require('path_to_local_file')), which directly updates things like the images in the Android Auto player screen, and icons in the playback queue, but not possible for the icons in the Android Auto lists. My understanding is the iconUri string gets mapped to the mediaDescriptionBuilder.iconUri which is used to populate the MediaItem that we see on the Android Auto screen, so in theory it should be working for any local file Uri that gets saved to a device (i.e a downloaded piece of content + image that is saved to local storage). Have you had any experience with this in the past or during testing? FYI - Forcing a loading indicator for an AA template is possible by temporarily sending a result of null in the onLoadChildren callback. |
I don't think when i first made it, i made it right that it also accepts a resource id; see |
its a bit more complicated than that: the player view you are referring to uses specifically lovegaoshi/KotlinAudio@7a3d90b so you're looking at onLoadChildren, NotificationManager, and exoplayer's internal queue - I guess I'm not surprised only the internal queue behaves if some of them has to fail. If I did setIconUri correctly, then I believe this is a better question to google/media3; however the way we used this, exoplayer2, is depreciated and I doubt google will give you an answer. Otherwise you're welcome to poke around yourself |
Hi there. I've testet your version and it is working great. Do you have a hint for long lists? For example a list of all albums/tracks or all tracks in a playlist? Is there a "ScrollToEnd" Event to fetch more items? |
hi! i rememebr seeing an implementation of infinite scrolling on android
auto but i didnt save it. also for your consideration it is quite bad ux to
scroll that far on a mot that responsive hud, its recommended to use voice
search
i dont think aa registers any scrolling events on googles guidelines but
youre welcome to look. it up.
…On Thu, Apr 18, 2024, 5:20 AM Andre Rinas ***@***.***> wrote:
Hi there. I've testet your version and it is working great. Do you have a
hint for long lists? For example a list of all albums/tracks or all tracks
in a playlist? Is there a "ScrollToEnd" Event to fetch more items?
—
Reply to this email directly, view it on GitHub
<#2094 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AZMOVVXPD4J7CBSZ33RY6BLY563BNAVCNFSM6AAAAAA3OM3BA2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANRTG4ZTMMJQG4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***
com>
|
Hi @lovegaoshi, Have you had a chance to check and understand how to handle an Android Auto startup from closed app? Also, I would like to point out that development for Android Automotive OS (AOSP) is growing rapidly. https://developers.google.com/cars/design/automotive-os Could this be a launching point to support it? The big challenge here is that Android Automotive is an operating system and platform running directly on the in-vehicle hardware supporting development as for Android Auto but no primary Activity is available. |
hi! |
Do you think this is ever likely to be merged into the main branch? Have the maintainers shared what their reluctance is, or is it just a case of needing time to review? |
My hope has always been to get this in -- the reluctance has been about the need for the main project to eventually update to using I understand though that this has been waiting for a while and am sorry for that. |
well, this pr does blatantly copy headlessJsTaskService from the rn repo...
so it locks rn versions. its quite destructive but imo also have other good
uses, like properly implrmrnting the wakelock
but also if u had the chance to follow the newarch pr, meta currently isnt
supporting headless with newarch + bridgeless on rn0. 74. this is gonna be
difficult to maintain for sure.
also bout the ?media3 migration - there is an easy way that doesn't change
much (though its gonna be heavier on my side tl migrate to
MediaLibraryService) and one that needs an android rewrite. either way im
still maintaining this fork since my app depends on it.
…On Tue, Apr 30, 2024, 5:07 AM David Chavez ***@***.***> wrote:
Do you think this is ever likely to be merged into the main branch? Have
the maintainers shared what their reluctance is, or is it just a case of
needing time to review?
My hope has always been to get this in -- the reluctance has been about
the need for the main project to eventually update to using media3 for
Android audio playback. There are some adjustments I'm envisioning will
need to happen here, and as stretched out as I am, I am fearful of getting
this in before then and then being responsible for also maintaining this
behaviour after migration.
I understand though that this has been waiting for a while and am sorry
for that.
—
Reply to this email directly, view it on GitHub
<#2094 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AZMOVVR5QOQSOK3VPATNH5LY76CRFAVCNFSM6AAAAAA3OM3BA2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOBVGE2TOMJZGU>
.
You are receiving this because you were mentioned.Message ID:
***@***.***
com>
|
Hi @lovegaoshi . I've maybe found a bug. There is no "subtitle"/artists on my headunit. I've tried the default artist for trackplayer and a subtitle too. But none of them is showing up. Any advice? |
i dont think RNTP track has a subtitle property - u could try mapping all artist to subtitle and see if that works |
how exactly did u map/use subtitle? |
Thanks for your answer, but I don't get it. [
{
id: 11,
title: "More the victim"
subtitle: "Linkin Park",
artist: "Linkin Park",
url: "https://url.com/lp.mp3",
duration: 200,
artwork: "cover.jpg"
}
] This works all in my app on my phone with trackplayer. It shows everywhere in the notification and so on. On my android auto it doesn't show the artist. You see I tried setting both artist and subtitle, but that didn't change anything. Now I tried your latest version with implementation 'com.github.lovegaoshi:KotlinAudio:v2.0.0-aa23' as dependency but it says, that there is no version aa23 in jitpack.io. |
should be built now?
https://jitpack.io/com/github/lovegaoshi/KotlinAudio/v2.0.0-aa23/build.log
…On Thu, May 16, 2024, 9:23 PM Andre Rinas ***@***.***> wrote:
Thanks for your answer, but I don't get it.
I have a playlist like this with 1 track for example
[
{
id: 11,
title: "More the victim"
subtitle: "Linkin Park",
artist: "Linkin Park",
url: "https://url.com/lp.mp3",
duration: 200,
artwork: "cover.jpg"
}
]
This works all in my app on my phone with trackplayer. It shows everywhere
in the notification and so on. On my android auto it doesn't show the
artist. You see I tried setting both artist and subtitle, but that didn't
change anything. Now I tried your latest version with implementation
'com.github.lovegaoshi:KotlinAudio:v2.0.0-aa23' as dependency but it says,
that there is no version aa23 in jitpack.io.
—
Reply to this email directly, view it on GitHub
<#2094 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AZMOVVXBHKBHILV5BW2XGHDZCWA4JAVCNFSM6AAAAAA3OM3BA2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMJWGU4TOOJQHE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***
com>
|
Wanted to try this out but can't get past this error: |
edit about album art on AA: I originally enabled album art via lovegaoshi/KotlinAudio@7a3d90b but google's guidelines seem to contradict with that. nevertheless however RNTP is currently set up (for ex https://github.com/lovegaoshi/react-native-track-player/blob/6f634594f24aa1974b2c8cdc6848b8b349cccdf0/android/src/main/java/com/doublesymmetry/kotlinaudio/notification/NotificationManager.kt#L389) for remote urls it works great, but for local uris (file:///) and embedded covers within local media files it wont work. for local uris while I do not have a use and no rigorous tests yet, I believe converting the file:/// uri to a content:// one, as specified in the google guidelines, would work. u can see how i did this via a fileProvider: lovegaoshi/azusa-player-mobile#449 for embedded covers (which I worked on for the past few days) this has to be first resolved and written to a file, then load the content:// uri as in the google guidelines. I tried with both ffmpeg and MediaMetadataRetriever, opted for the latter in the end for simplicity. commit is here: lovegaoshi@6f63459 the specific implementation I have does have a drawback taht the local file is written in the /Pictures folder. you might be able to write to cache using File() then convert to content:// with a fileProvider, but I chose the simplicity of MediaStore and can deal with this drawback. |
continuation of #2043 . Synced up with RNTP v4.0.0 rc07