Hi,
You could observe Audio interruption notifications in awakeFromNib():
NotificationCenter.default.addObserver(self, selector: #selector(handleInterruption(_:)), name: .AVAudioSessionInterruption, object: nil)
And then make function to handle those interruptions:
@objc func handleInterruption(_ notification: Notification) {
// Handle interruptions
playPauseButton.setImage(#imageLiteral(resourceName: "play"), for: .normal)
miniPlayPauseButton.setImage(#imageLiteral(resourceName: "play"), for: .normal)
}