LeoKlaus / plappa

An Audiobook client for Jellyfin and AudioBookShelf, written in Swift/SwiftUI.
https://plappa.me
159 stars 0 forks source link

[BUG] CarPlay play/pause media button in the car does not work #119

Closed timespaced closed 2 weeks ago

timespaced commented 3 weeks ago

Describe the bug Pressing the physical media button for Play/Pause in a car while playing an audiobook via CarPlay does not play or pause the book. However, the physical car skip back/forward buttons do function properly.

To Reproduce Steps to reproduce the behavior:

  1. Play an audiobook via Carplay
  2. Press the car's play/pause button
  3. Nothing happens; the audiobook does not pause.

Expected behavior I would expect the audiobook to pause if playing and play if paused when the car's play/pause button is pressed.

Screenshots N/A

Logs N/A

Environment(please complete the following information):

Additional context N/A

sevenlayercookie commented 3 weeks ago

Same on my system

mrburns-42 commented 3 weeks ago

I have the same problem. However, I only have this when Plappa is on in full screen mode. If it is in split screen, e.g. with Apple maps, then the buttons work.

LeoKlaus commented 3 weeks ago

I can't reproduce this in the CarPlay simulator. Does the play/pause button on the lock screen work for you?

The CarPlay interface (both fullscreen and small), lock screen and hardware buttons all use the same play/pause mechanism that plappa provides to the OS. I can't really think of any reason why one wouldn't work if the others do.

I'm still waiting for my physical CarPlay unit, it should arrive early next week.

timespaced commented 3 weeks ago

I have the same problem. However, I only have this when Plappa is on in full screen mode. If it is in split screen, e.g. with Apple maps, then the buttons work.

Interesting, that screen doesn’t work for me either.

@LeoKlaus The play/pause button on the iPhones lock screen works while connected to CarPlay, and all the digital play/pause buttons on CarPlay work wether in fullscreen or in tsplit screen. It’s just the physical play/pause button that does not work. I do not experience this in other apps such as Prologue.

sevenlayercookie commented 2 weeks ago

I can't reproduce this in the CarPlay simulator. Does the play/pause button on the lock screen work for you?

The CarPlay interface (both fullscreen and small), lock screen and hardware buttons all use the same play/pause mechanism that plappa provides to the OS. I can't really think of any reason why one wouldn't work if the others do.

I'm still waiting for my physical CarPlay unit, it should arrive early next week.

I have Xcode and a little bit of experience, do you have any suggestions on how I could supply some debug info to you?

sevenlayercookie commented 2 weeks ago

Does Plappa handle togglePlayPauseCommand in addition to playCommand and pauseCommand? My steering wheel control is a single play/pause toggle button instead of separate play and pause buttons. Perhaps togglePlayPauseCommand isn't being handled (CarPlay Simulator does not have a play/pause button as far as I can find, so I could see how this might be missed)

timespaced commented 2 weeks ago

I don’t know if it’s related, but today I noticed that when connected to a Bluetooth speaker (I tried two different Bluetooth speakers of different brands), I have to press the play/pause button on the speaker twice to get Plappa to pause. However pressing it once does play (resume) as expected. Happy to make another GitHub issue if appropriate, but figured I’d post here in case it might be related and help troubleshoot the CarPlay issue.

LeoKlaus commented 2 weeks ago

Does Plappa handle togglePlayPauseCommand in addition to playCommand and pauseCommand? My steering wheel control is a single play/pause toggle button instead of separate play and pause buttons. Perhaps togglePlayPauseCommand isn't being handled (CarPlay Simulator does not have a play/pause button as far as I can find, so I could see how this might be missed)

It doesn't, actually. Thanks for bringing this to my attention. So far, this caused no issues with a lot of devices that also only have a single play/pause button like AirPods and bluetooth speakers. I'll make a small update for TestFlight to check if this fixes the issue.

LeoKlaus commented 2 weeks ago

I don’t know if it’s related, but today I noticed that when connected to a Bluetooth speaker (I tried two different Bluetooth speakers of different brands), I have to press the play/pause button on the speaker twice to get Plappa to pause. However pressing it once does play (resume) as expected. Happy to make another GitHub issue if appropriate, but figured I’d post here in case it might be related and help troubleshoot the CarPlay issue.

Thank you for the update. I'm almost certain this is the same issue, so I'd keep this in one thread for now.

Again, I can't reproduce this on my device using a bluetooth speaker (I only have one from JBL with a single play/pause button) or AirPods. I've just pushed update 1.1.6 (build 13) to TestFlight. It adds logging for received commands and support for the togglePlayPauseCommand.

If you find the time, it would be great if you could test this with your speaker and or your car and check the logs afterwards (logs are only kept for the lifetime of the app, so you'd have to export them before closing plappa).

timespaced commented 2 weeks ago

I don’t know if it’s related, but today I noticed that when connected to a Bluetooth speaker (I tried two different Bluetooth speakers of different brands), I have to press the play/pause button on the speaker twice to get Plappa to pause. However pressing it once does play (resume) as expected. Happy to make another GitHub issue if appropriate, but figured I’d post here in case it might be related and help troubleshoot the CarPlay issue.

Thank you for the update. I'm almost certain this is the same issue, so I'd keep this in one thread for now.

Again, I can't reproduce this on my device using a bluetooth speaker (I only have one from JBL with a single play/pause button) or AirPods. I've just pushed update 1.1.6 (build 13) to TestFlight. It adds logging for received commands and support for the togglePlayPauseCommand.

If you find the time, it would be great if you could test this with your speaker and or your car and check the logs afterwards (logs are only kept for the lifetime of the app, so you'd have to export them before closing plappa).

The latest TestFlight fixed the play/pause issue in CarPlay - now works as expected. Will report back re: Bluetooth speaker, likely in about 12 hours time.

Thank you!

LeoKlaus commented 2 weeks ago

The latest TestFlight fixed the play/pause issue in CarPlay - now works as expected. Will report back re: Bluetooth speaker, likely in about 12 hours time.

Great, thank you for taking the time and reporting back! I'll make 1.1.6 ready for the AppStore then.

If it works for the speaker as well (and nobody else still has this issue), feel free to close this.

sevenlayercookie commented 2 weeks ago

Can confirm 1.1.6 solved this issue for me

timespaced commented 2 weeks ago

Closing this, will make a new issue for the Bluetooth playback - I checked the logs and know what causes it, can reproduce the issue.

Thanks for the CarPlay update!