-
-
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
updateMetadataForTrack not working most of the time #1719
Comments
Having the same issue but my Artwork is updating correctly just not title or artist. iOS works fine. I tried TrackPlayer.updateNowPlayingMetadata({ This is the same code I used in v2.2.0-rc3 and updated fine with that version. |
Yeah, my issue is with the duration because I'm trying to get the duration and then update it, but I noticed it also fails with other properties. I haven't tried the updateNowPlayingMetadata, but if it's not working for you it's probably the same issue. |
I have the same issue in android, using the same code as before, and I have null for the artist and title, and sometimes the artwork works |
I've been attempting to debug this. The notificationMetadata property is set with the artist, title and artworkUrl. If you insert a log here, you can see the values as expected. That then calls the reload method, which in turn calls the invalidate method on Exoplayer's notification manager. This is where the trail currently runs cold for me. If you comment out the call to For anyone looking to replicate, you need to pull this repo and KotlinAudio and set everything up locally as explained in the example project's README. Then edit PlayerControls.tsx in the example project, to include a way to update metadata, like this:
You will note that the notification updates correctly with each track that is played, but when you tap the "Meta" button, only the artwork changes - the artist and title remain as they were. |
@mpivchev could use your eyes on this one. I took a high-level look. Not sure why the ExoPlayer |
I've stumbled on a fix, but I don't fully understand how/why it works. If you change:
to:
...then it works. I discovered this because I noticed how the call to set notificationManager.notificationMetadata in BaseAudioPlayer is followed by a similar snippet (but I was able to simplify it for this fix). I would definitely appreciate @mpivchev reviewing this. |
Possibly related to #1653? @gavrichards if its convenient I'd be curious to see if your fix also fixes the issue above. |
@jspizziri I'll give it a quick try now. |
I updated to RNTP v3.2 and this issue is still happening. |
The PR doublesymmetry/KotlinAudio#52 hasn't been reviewed yet, so the bug is still present. |
hi, I'm having an issue where the updateMetadataForTrack is not working. I use it when I recieve the song details from a radio live (using icy or icy-headers) inside the "PlaybackMetadataReceived" event I'm currently on "react-native-track-player": "^3.2.0", |
I was also able to fix this by removing the original It seems that it was causing exoplayer to update the notification as well. @mpivchev I see you introduced this in the following pr doublesymmetry/KotlinAudio@d2ac459 – perhaps there is a good reason for adding it that I may be missing? |
Still happening on 3.2.0-d23c3fb990aaf9d6783881fabe21e059b62b0782 |
Hi! I'm also seeing the issue on Android devices & 3.2.0. Any expected version for the review/fix? |
In the current |
Not sure if this helps, but I'm not seeing the issue at all in API 28 (ZTE Blade A530 with Android 9) |
Hi, |
Should be fixed by doublesymmetry/KotlinAudio#59 |
Now that doublesymmetry/KotlinAudio#59 has been merged we'll need to wait for the build to be available on jitpack.io and then bump the version here https://github.com/doublesymmetry/react-native-track-player/blob/main/android/build.gradle#L52 Any community members interested in creating a PR for that? Should be a chipshot. |
This is now fixed in |
I am still running into this issue on Android. I don't know for sure my problem isn't user error, but I am using the The image on the lockscreen stays whatever the image was that first loaded for the track. I call |
This issue was fixed in |
I can confirm we're seeing this regression too, after updating from |
So I think we also need to update the tag of the exoplayer media item here: https://github.com/doublesymmetry/KotlinAudio/blob/main/kotlin-audio/src/main/java/com/doublesymmetry/kotlinaudio/players/QueuedAudioPlayer.kt#L217 Will be able to look into it early September |
There's a fix for this ongoing here: doublesymmetry/KotlinAudio#87. I'll update this thread when that's done. |
This should be fixed now in |
Describe the Bug
updateMetadataForTrack is not changing the notification and the Now Playing Center on Android. I'm leaving an example with the title property changing, but the same happens with the duration and with every other property.
Steps To Reproduce
On Android Add a track to the queue, play it and try to update the notification with the updateMetadataForTrack.
You should see a change in the notification, but that's not happening.
If you get the track you'll see the changes, but the notification always stays the same (I think it worked once or twice, but fails most times).
Code To Reproduce
Environment Info:
react-native-track-player v3.1.0
Also happens in nightly.Android Studio Simulator and device.
MacOS.
How I can Help
I can provide support and data.
The text was updated successfully, but these errors were encountered: