创建自己的 iOS 音乐播放器并显示在 iPhone 的锁屏上

Create own iOS music player and display on lock screen of iPhone

是否可以在 iOS 11 中使用新的 MusicKit API(或任何其他 iOS API)创建音乐播放器并将其显示在iPhone的锁屏,像现在的Apple Music播放器?如果是这样,应该如何使用 APIs?

The first - play user's songs on my app and allow control of my app from the lock screen as my app is playing the music.

这是可能的,音乐包 API 允许您访问用户的图书馆:

MusicKit on iOS lets users play Apple Music and their local music library natively from your apps and games. When a user provides permission to their Apple Music account, your app can create playlists, add songs to their library, and play any of the millions of songs in the Apple Music catalog. If your app detects that the user is not yet an Apple Music member, you can offer a trial from within your app.

https://developer.apple.com/musickit/

关于锁定屏幕上的控件。这可以在不使用该 SDK 的情况下完成,只需填充 "MPNowPlayingInfoCenter"

参考这个:iOS: Displaying currently played track info in LockScreen?