I have a simple tvOS app that has a single audio track, a storyboard with single scene that contains a button for play/pause toggling.
I am trying to add Siri Remote handling so that user can play/pause the track with remote's "toggle play/pause" button.
The problem, though, is that when the application starts it doesn't respond to remote control events if the AVPlayer is paused. When user starts playback using the touch-button on Siri Remote I can pause the playback using "toggle play/pause" button. I CAN'T start playback again after the track has been paused.
I tried two approaches:
application.beginReceivingRemoteControlEvents()
MPRemoteCommandCenter.shared().pauseCommand.addTarget(...)
Using the remoteControlReceived(with event: UIEvent?) I receive the event only when the AVPlayer is playing and the event's subtype is pause command.
Using the remote command center I registered for pauseCommand, playCommand and togglePlayPauseCommand
commands but only pauseCommand is being triggered when the playback is active.
Am I missing something?