【发布时间】:2012-06-01 03:30:53
【问题描述】:
我在视图控制器中使用MPMoviePlayer。在viewwillappear我正在做
[[UIApplication sharedApplication] beginReceivingRemoteControlEvents];
[self becomeFirstResponder];
但是当我点击播放器上的下一首曲目或上一首曲目按钮时,-(void)remoteControlReceivedWithEvent:(UIEvent *)event 不会被调用。
我还在viewwillappear中包含了以下代码
NSError *setCategoryErr = nil;
NSError *activationErr = nil;
[[AVAudioSession sharedInstance] setCategory: AVAudioSessionCategoryPlayback error: &setCategoryErr];
[[AVAudioSession sharedInstance] setActive: YES error: &activationErr];
让我知道可能是什么问题?或者给我一个例子或一些示例代码,我们可以在其中通知UIEventSubtypeRemoteControlNextTrack 和UIEventSubtypeRemoteControlPreviousTrack 事件。
【问题讨论】:
标签: iphone mpmovieplayercontroller mpmovieplayer uievent