大佬教程收集整理的这篇文章主要介绍了ios – MPRemoteCommandCenter暂停/播放按钮没有切换?,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
- (void)setupMPRemoteCommandCenter{ MPRemoteCommandCenter *commandCenter = [MPRemoteCommandCenter sharedCommandCenter]; MPRemoteCommand *play = [commandCenter playCommand]; [play setEnabled:YES]; [play addTarget:self action:@SELEctor(playAudio:)]; MPRemoteCommand *pause = [commandCenter pauseCommand]; [pause setEnabled:YES]; [pause addTarget:self action:@SELEctor(playAudio:)]; [commandCenter.skipBACkWARDCommand setPreferredIntervals:@[@30.0]]; MPRemoteCommand *skipBACkWARDs = [commandCenter skipBACkWARDCommand]; [skipBACkWARDs setEnabled:YES]; [skipBACkWARDs addTarget:self action:@SELEctor(skipBACkWARDEvent:)]; [commandCenter.skipForWARDCommand setPreferredIntervals:@[@30.0]]; MPRemoteCommand *skipForWARDs = [commandCenter skipForWARDCommand]; [skipForWARDs setEnabled:YES]; [skipForWARDs addTarget:self action:@SELEctor(skipForWARDEvent:)]; } -(void)playAudio: (MPRemoteCommandHandlerStatus *)event{ [self playAction]; //playAction handles the audio pausing and toggling the play button on the app }
让我知道,如果你们能想到任何事情,我会很乐意帮助.这让我疯了
以上是大佬教程为你收集整理的ios – MPRemoteCommandCenter暂停/播放按钮没有切换?全部内容,希望文章能够帮你解决ios – MPRemoteCommandCenter暂停/播放按钮没有切换?所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。