如何从Musickit获得系统音乐队列?

发布于 2025-01-28 14:21:08 字数 408 浏览 3 评论 0原文

我正在使用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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

飘落散花 2025-02-04 14:21:08

苹果公司拥有自己的论坛,开发人员可以在其中询问有关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,

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文