-
-
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
fix(android, events): properly intercept and fire remote playback events #1668
Conversation
@@ -381,7 +385,7 @@ class MusicService : HeadlessJsTaskService() { | |||
} | |||
|
|||
scope.launch { | |||
event.onMediaSessionCallbackTriggered.collect { | |||
event.onPlayerActionTriggeredExternally.collect { |
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.
This observer should now be collecting events when media session OR notification triggers player events. Make sure to put some breakpoints here and test it.
@mpivchev (cc @doughsay) I just tested RNTP. I tested the following events:
All of them were working as I expected 🎊 . I tested both the notification player and via connected Bluetooth headphones. Here are some things I noticed that did not seem to be working:
|
Fixed :)
Can't reproduce it on my side, I only receive one event. Maybe it got fixed along with other things.
These are actually the right events, since we used them before removing the fork as well. The only issue was the RN side did not handle them. The new commits fix that. |
PR is updated with the fixes. New KA version is 1.2.1. Already uploaded to JitPack, but the PR is here: doublesymmetry/KotlinAudio#43 |
@mpivchev thanks for the work on this. I'll retest today and let you know if I have more feeback. |
@mpivchev I just finished running through all the same tests. I can confirm everything is now working as I expect. Let's merge and release 🎊 |
This PR enables notification events to be intercepted. Conveniently, this also intercepts media session events without any additional code.
Followup of doublesymmetry/KotlinAudio#40