AVAudioEngine, AVPlayer, AVPlayerViewController - Controls are disabled when AVPlayerViewController plays video

I use AVAudioEngineto play audio files and AVPlayerand AVPlayerViewControllerto play videos.

and notification to the Control Center UIApplication.shared.beginReceivingRemoteControlEvents()

The control center works great for audio files (play / pause / next / prev / slider) if the video file does not play (if there is no instance AVPlayerViewController)

but as soon as I play the video file and then release AVPlayerViewControllerand play the audio file, all controls in the Control Center will be disabled.

refreshing nowPlayingInfo does not work - it only updates the thumbnail and sound name

enter image description here After rejecting AVPlayerViewController

After rejecting AVPlayerViewController

+4

Source: https://habr.com/ru/post/1683085/


All Articles