參考1
參考2
參考3
參考4
//注册一个通知来观察状态
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(playbackStateDidChange:)
name:MPMoviePlayerPlaybackStateDidChangeNotification
object:[playerViewController moviePlayer]];
- (void)playbackStateDidChange:(NSNotification *)aNote
{
MPMoviePlayerController *moviePlayer = [aNote object];
switch (moviePlayer.playbackState) {
case MPMoviePlaybackStateStopped:
break;
case MPMoviePlaybackStatePlaying:
break;
case MPMoviePlaybackStatePaused:
break;
case MPMoviePlaybackStateInterrupted:
break;
case MPMoviePlaybackStateSeekingForward:
break;
case MPMoviePlaybackStateSeekingBackward:
break;
default:
break;
}
CGFloat playtime = [moviePlayer currentPlaybackTime];//当前时间
}
沒有留言:
張貼留言