mackode
mackode

Reputation: 83

CarPlay long-press on fast forward/backward button on the steering wheel does not work

When I use default AVPlayerViewControllers setting updatesNowPlayingInfoCenter (https://developer.apple.com/documentation/avkit/avplayerviewcontroller/1845194-updatesnowplayinginfocenter)

fastForward and fastBackward works fine. The audio is „scrubbing” forward and backward with its characteristic sound.

The problem is that it causes NowPlaying is updated multiple times; by AVPlayerViewControler and by my custom code. In CarPlay this causes artwork to flicker or AVQueuePlayer to report wrong current time on looped AVPlayerItem, etc. (some other issues as well)

When I turn off updatesNowPlayingInfoCenter updates, only my code changes NowPlaying and everything works perfectly except long-press on fast forward and backward.

I tried with implementing skipForwardCommand and skipBackwardCommand (also with seekForwardCommand and seekBackwardCommand), but I’m unable to implement this nice scrubbing audio effect. Only X seconds seek when I press and plus another X seconds when button is released.

Can you please help me with a better implementation?

Upvotes: 0

Views: 103

Answers (0)

Related Questions