-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
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. |
@lovegaoshi @PatelPiyush04 @andreknieriem I need some guidelines regarding RNTP with Android Auto. |
can u spend an hour and read whats in this pr b4 commenting? thx
…On Wed, Jun 5, 2024, 1:30 AM Ali ***@***.***> wrote:
@lovegaoshi <https://github.com/lovegaoshi> @PatelPiyush04
<https://github.com/PatelPiyush04> @andreknieriem
<https://github.com/andreknieriem> I need some guidelines regarding RNTP
with Android Auto.
Currently, we're working on the React Native application in which we have
implemented the React Native track player, now our goal is to connect our
app with the Android Auto. So, need to confirmation that RNTP is working
properly with Android Auto or not?
—
Reply to this email directly, view it on GitHub
<#2094 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AZMOVVXCES54DXFQFQ3AQOLZF3EAZAVCNFSM6AAAAAA3OM3BA2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNBZGIYDAOBYGU>
.
You are receiving this because you were mentioned.Message ID:
***@***.***
com>
|
pr welcome
…On Thu, Jun 20, 2024, 3:47 AM Kestas Venslauskas ***@***.***> wrote:
Can this A-Z sorting be implemented here?
Example:
Screenshot.at.Jun.20.13-20-04.png (view on web)
<https://github.com/doublesymmetry/react-native-track-player/assets/52245569/ee257fc5-b574-45e5-8133-2132f585c11b>
—
Reply to this email directly, view it on GitHub
<#2094 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AZMOVVXPTTX4MROHUZRGFT3ZIKXMRAVCNFSM6AAAAAA3OM3BA2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOBQGM3TIOBXG4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***
com>
|
Hey @lovegaoshi, awesome work. I was able to implement your solution and was wondering if there is possibility to show progress indicator while items are loading? Currently Android Auto just shows message "No items". Can you give me some advice/directions on how could I extend this solution to support it? |
hi! please scroll up and read the thread. someone mentioned in a comment
for this, i remember its like returning null for onGetRoot
alternatively ive been thinking i should port the toast library over so we
can display some toast msgs
…On Thu, Jul 4, 2024, 12:25 AM MatejMijic ***@***.***> wrote:
Hey @lovegaoshi <https://github.com/lovegaoshi>, awesome work. I was able
to implement your solution and was wondering if there is possibility to
show progress indicator while items are loading? Currently Android Auto
just shows message "No items". Can you give me some advice/directions on
how could I extend this solution to support it?
—
Reply to this email directly, view it on GitHub
<#2094 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AZMOVVSJNS3L6B7HHTXA5ZTZKT2E5AVCNFSM6AAAAAA3OM3BA2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMBYGI4TGNBRGI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***
com>
|
@MatejMijic - You can force a loading indicator by explicitly returning @lovegaoshi - I am wondering if you have any ideas about react-native >= 0.73, with the new bridgeless architecture. I can see that the app works as expected with AA minus headless mode. I am going to have a look into exactly what is happening, but thought I would see if you had any ideas / intention to upgrade your app to later versions of react-native. I noted that you have mentioned that this will be difficult to maintain moving forwards, and so I'm wondering if it is better to handle AA completely natively if launched headlessly. |
rntp is not supporting bridgeless newarch right now. in fact facebook is
hinting to drop support on anything using headlessJs bc they dont use it. u
can follow the discussion on the rntp new arch pr and the related mentions
in the rn repo. a pr is merged but nobody tested it, and i cant figure out
how to compile RN. without bridgeless it works flawlessly on 0.74.3.
my personal opinion is if u handle aa natively u should just ditch the
entire rn part and go with native.
…On Sun, Jul 28, 2024, 8:14 PM caustin24345 ***@***.***> wrote:
@MatejMijic <https://github.com/MatejMijic> - You can force a loading
indicator by explicitly returning null from the onLoadChildren callback.
My implementation pushes a media item with a specific mediaId while
content is being fetched. When the onLoadChildren callback is fired, you
can check to see what the mediaId of the pushed media item is, and return
null if needed. Once the data is fetched, a new media item can be pushed
to the tree which includes the loaded content.
@lovegaoshi <https://github.com/lovegaoshi> - I am wondering if you have
any ideas about react-native >= 0.73, with the new bridgeless architecture.
I can see that the app works as expected with AA minus headless mode. I am
going to have a look into exactly what is happening, but thought I would
see if you had any ideas / intention to upgrade your app to later versions
of react-native. I noted that you have mentioned that this will be
difficult to maintain moving forwards, and so I'm wondering if it is better
to handle AA completely natively if launched headlessly.
—
Reply to this email directly, view it on GitHub
<#2094 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AZMOVVURYFGMHZWF2LJ5BQ3ZOWXR7AVCNFSM6AAAAAA3OM3BA2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENJUHA3DCMJTHE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***
com>
|
@lovegaoshi - Thanks, I've had a look at those issues in the RN repo. I can see that it looks like RN will deprecate headlessJS and leave it up to 3rd party packages for their own integration. When you say without bridgeless, everything works flawlessly on 0.74.3, do you mean that you have enabled the new arch but have set bridgeless = false in the load function, or do you mean without the new arch entirely (and therefore without bridgeless). I will likely look into migrating to an entirely native approach for AA to futureproof the functionality for any RN or Expo changes in the future. The implemetation seems very fragile at the moment with all of these new architectural changes. Thanks again for your help. |
bridgeless =false. please follow that meta thread to get a sense where meta
wants rn to be right now. its worth mentioning meta eants to kill
headlessJs which has nothing to do with android auto, but rather all
background tasks will be affected. u should build a native android app if u
can, or look up how flutter (audio_service) handles headlessJs.
…On Sun, Jul 28, 2024, 10:54 PM caustin24345 ***@***.***> wrote:
@lovegaoshi <https://github.com/lovegaoshi> - Thanks, I've had a look at
those issues in the RN repo. I can see that it looks like RN will deprecate
headlessJS and leave it up to 3rd party packages for their own integration.
When you say *without bridgeless, everything works flawlessly on 0.74.3*,
do you mean that you have enabled the new arch but have set bridgeless =
false in the load function, or do you mean without the new arch entirely
(and therefore without bridgeless).
I will likely look into migrating to an entirely native approach for AA to
futureproof the functionality for any RN or Expo changes in the future. The
implemetation seems very fragile at the moment with all of these new
architectural changes. Thanks again for your help.
—
Reply to this email directly, view it on GitHub
<#2094 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AZMOVVWGCV2EBGIVD3BGOYDZOXKKJAVCNFSM6AAAAAA3OM3BA2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENJVGAYDCNRXHA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***
com>
|
while working with my media3 migration work, I found I could not reliably wake up activities anymore via MediaLibrarySession.Callback, as legacy controller package names are handled there. However I found something interesting that the service actually launches the JS bridge. setupPlayer is blocked by MusicModule but I maybe have a better understanding about the error and believe this is no longer the case..? So if one invokes setupPlayer inside index.js you will have a fully functional service with event emitters/parsers. This requires some proof of concept work and probably major refactors for a lot of us but great if can be done. I dont remember the JS bridge actually initializes with exoplayer2 but its been a while. |
update:
You may reference my media3 migration work that I believe showcases the headless start. You should see the mediaSession loads, along with the headlessJS events emit even if the app is fully closed, while being awaken by say the media controller tester. While I'm having many issues with media3 right now, i dont see myself maintaining this fork anymore once I get media3 to work to the bare minimum. PR will be left open as i think its mostly functional, until the maintainers decide to migrate to media3 as well. |
@lovegaoshi Thanks for all your work. I'm looking to integrate Android Auto into an app of my own. Quickly reading through this PR, I see a lot of mentions of media2 and media3. Am I correct that despite the fact that media2 is deprecated, this should still be a fully functional example? All I really need is for it to play a shoutcast stream. Some direct urls to MP3s in the future to add podcasts would be nice, but first and foremost would be the shoutcast stream. I've poked react-native-carplay (which has experimental Android Auto support, but lacks some documentation in that department) and react-native-android-auto (which was build in a hackathon and doesn't seem to be as plug-n-play as it appears on the surface), but couldn't get those to work. So hoping just using your extension to RNTP does the trick. |
please try the example app n see if its funxtional urself
…On Wed, Dec 18, 2024, 2:05 AM René Vlugt ***@***.***> wrote:
@lovegaoshi <https://github.com/lovegaoshi> Thanks for all your work. I'm
looking to integrate Android Auto into an app of my own. Quickly reading
through this PR, I see a lot of mentions of media2 and media3. Am I correct
that despite the fact that media2 is deprecated, this should still be a
fully functional example?
All I really need is for it to play a shoutcast stream. Some direct urls
to MP3s in the future to add podcasts would be nice, but first and foremost
would be the shoutcast stream. I've poked react-native-carplay (which has
experimental Android Auto support, but lacks some documentation in that
department) and react-native-android-auto (which was build in a hackathon
and doesn't seem to be as plug-n-play as it appears on the surface), but
couldn't get those to work. So hoping just using your extension to RNTP
does the trick.
—
Reply to this email directly, view it on GitHub
<#2094 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AZMOVVX4XKFHY7P4RMFLXHL2GFCF3AVCNFSM6AAAAAA3OM3BA2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNJQHEYDCMRWHE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***
com>
|
continuation of #2043 . Synced up with RNTP v4.0.0 rc07