Have you called UIApplication.shared.beginReceivingRemoteControlEvents()
before your audio starts playing?
Topic:
UI Frameworks
SubTopic:
UIKit
Tags: