iPhone MPMoviePlayerController上的下一个/上一个按钮

编程入门 行业动态 更新时间:2024-10-28 02:31:05
本文介绍了iPhone MPMoviePlayerController上的下一个/上一个按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

使用MPMoviePlayerController时,播放按钮被下一步和上一页按钮包围。

When using the MPMoviePlayerController, the play button is surrounded with "Next" and "Previous" buttons.

如何点击通知? 有没有办法用内容列表(数组)提供MPMoviePlayerController?

How do I get notifications when they are clicked? is there a way to feed MPMoviePlayerController with a list (array) of content?

推荐答案

Nathan对于需要是正确的如果您想要按钮通知,请为播放器实现自己的UI。您可以从播放器获取有关播放状态的通知。

Nathan is correct about needing to implement your own UI for the player if you want button notifications. You can get notifications from the player about playback state though.

来自AddMusic示例,其中self是包含MPMusicPlayerController实例的控制器或模型:

from the AddMusic example, where self is the controller or model containing the instance of MPMusicPlayerController:

- (void) registerForMediaPlayerNotifications { NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; [notificationCenter addObserver: self selector: @selector (handle_NowPlayingItemChanged:) name: MPMusicPlayerControllerNowPlayingItemDidChangeNotification object: musicPlayer]; [notificationCenter addObserver: self selector: @selector (handle_PlaybackStateChanged:) name: MPMusicPlayerControllerPlaybackStateDidChangeNotification object: musicPlayer]; /* // This sample doesn't use libray change notifications; this code is here to show how // it's done if you need it. [notificationCenter addObserver: self selector: @selector (handle_iPodLibraryChanged:) name: MPMediaLibraryDidChangeNotification object: musicPlayer]; [[MPMediaLibrary defaultMediaLibrary] beginGeneratingLibraryChangeNotifications]; */ [musicPlayer beginGeneratingPlaybackNotifications]; }

更多推荐

iPhone MPMoviePlayerController上的下一个/上一个按钮

本文发布于:2023-10-12 21:44:52,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1485986.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:按钮   iPhone   MPMoviePlayerController

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!