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

After rejecting AVPlayerViewController