如何从Musickit获得系统音乐队列?
我正在使用Musickit构建一个管理Apple Music队列的iOS应用程序。我能够通过以下方式将当前物品获取:
SystemMusicPlayer.shared.queue.currentEntry
我可以订阅队列中的更改:
cancellable = SystemMusicPlayer.shared.queue.objectWillChange.sink(receiveValue: { _ in
print("Received value: \(SystemMusicPlayer.shared.queue.currentEntry)")
})
但是,我无法弄清楚如何在队列中获取即将到来的项目。有人知道如何使用新的Musickit API做到这一点吗?
I'm using MusicKit to build an iOS app that manages the queue of Apple Music. I am able to get the current item in the queue by:
SystemMusicPlayer.shared.queue.currentEntry
And I can subscribe to changes in the queue with:
cancellable = SystemMusicPlayer.shared.queue.objectWillChange.sink(receiveValue: { _ in
print("Received value: \(SystemMusicPlayer.shared.queue.currentEntry)")
})
However, I'm unable to figure out how I can get the upcoming items in the queue. Does anyone know how to do this with the new MusicKit API?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
苹果公司拥有自己的论坛,开发人员可以在其中询问有关Musickit的问题,并从熟悉该框架的Apple员工那里获得答案。
我建议您检查 apple开发人员论坛的musickit部分那里的问题。
我希望它有帮助。
此致,
Apple has its own forums where developers can ask questions about MusicKit and get answers from Apple employees who are familiar with the framework.
I would recommend that you check the MusicKit section of the Apple Developer Forums, and post your question there.
I hope it helps.
Best regards,