MPMediaPickerController 在一个视图中,MPMediaPlayback 在另一个视图中。怎样做?

发布于 2024-09-15 07:28:35 字数 196 浏览 1 评论 0原文

基本上我有一个三视图堆栈。在最后一个视图中,我得到了一个 MPMediaPickerController,它允许用户从他/她的库中选择一首歌曲。该歌曲将在稍后从第一个视图播放。我如何告诉玩家(在第一个视图中)应该玩什么?

一种可能性是发送通知并包含 MPMediaItemCollection 作为对象?

这是正确的方法还是您有其他更明智的建议?

Basically I have a three view stack. In the last view I got a MPMediaPickerController that lets the user pick a song from his/her library. The song is to be played later from the first view. How can I tell the player (in the first view) what should be played?

One possibility would be to send a notification and include the MPMediaItemCollection as the object maybe?

Is this a/the correct way or do you have other smarter suggestions?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

吖咩 2024-09-22 07:28:35

我最终使用 NSNotification 并将 MediaItemCollection 附加为 userInfo。

I ended up using NSNotification and attaching the MediaItemCollection as userInfo.

霓裳挽歌倾城醉 2024-09-22 07:28:35

使用 MPMediaPickerController 委托:

在第三个视图控制器中将 MPMediaPickerController 委托设置为您的第一个视图。在您的第一个视图控制器中实现委托回调函数。

Use the MPMediaPickerController delegate:

in your third view controller set the MPMediaPickerController delegate to be your first view. Implement the delegate callback functions in your first view controller.

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