-
Notifications
You must be signed in to change notification settings - Fork 146
playStatus
isExist? edited this page Sep 22, 2016
·
2 revisions
说明播放器当前所处状态,如正在播放,暂停播放等
typedef NS_ENUM(NSInteger, MPMoviePlaybackState) {
MPMoviePlaybackStateStopped,
MPMoviePlaybackStatePlaying,
MPMoviePlaybackStatePaused,
MPMoviePlaybackStateInterrupted,
MPMoviePlaybackStateSeekingForward,
MPMoviePlaybackStateSeekingBackward
};
- MPMoviePlaybackStateStopped - 播放停止
- MPMoviePlaybackStatePlaying - 正在播放
- MPMoviePlaybackStatePaused - 播放暂停
- MPMoviePlaybackStateInterrupted - 播放被打断
- MPMoviePlaybackStateSeekingForward - 向前seeking中
- MPMoviePlaybackStateSeekingBackward - 向后seeking中
- 通过playbackState属性(只读)获取当前播放状态
- 当接收到MPMoviePlayerPlaybackDidFinishNotification和MPMoviePlayerPlaybackStateDidChangeNotification通知时应调用playbackState获取一下当前播放器状态
if (MPMoviePlayerPlaybackStateDidChangeNotification == notify.name) {
NSLog(@"------------------------");
NSLog(@"player playback state: %ld", (long)_player.playbackState);
NSLog(@"------------------------");
}