From Apple
2. 5 Performance: Software Requirements
Guideline 2.5.4 - Performance - Software Requirements
Your app declares support for audio in the UIBackgroundModes key in your Info.plist, but we were unable to play any audible content when the app was running in the background. Next Steps The audio key is intended for use by apps that provide audible content to the user while in the background, such as music player or streaming audio apps. Please revise your app to provide audible content to the user while the app is in the background or remove the "audio" setting from the UIBackgroundModes key.
锁屏后,播放器不但要有声音,还有有一个锁屏时候的播放界面
- 开启锁屏播放
if UIApplication.shared.responds(to: #selector(UIApplication.beginReceivingRemoteControlEvents)){
UIApplication.shared.beginReceivingRemoteControlEvents()
UIApplication.shared.beginBackgroundTas