MPMovieLoadStatePlaythroughOK

MPMovieLoadStatePlaythroughOK

我找到MPMoviePlayerController.h,有

enum {
    MPMovieLoadStateUnknown        = 0,
    MPMovieLoadStatePlayable       = 1 << 0,
    MPMovieLoadStatePlaythroughOK  = 1 << 1, // Playback will be automatically started in this state when shouldAutoplay is YES
    MPMovieLoadStateStalled        = 1 << 2, // Playback will be automatically paused in this state, if started
};
typedef NSInteger MPMovieLoadState;

但是当我做的时候
NSLog(@"%d",player.loadState)
它打印出5或有时3,它是怎么发生的?我知道loadstate的值为0、1、2、4,请参阅开发人员文档。
谢谢!

最佳答案

playState是一个位掩码。可以设置任意数量的位,例如

MPMovieLoadStatePlaythroughOK | MPMovieLoadStatePlayable

检查这样的状态:
MPMovieLoadState state = [playerController loadState];
if( state & MPMovieLoadStatePlaythroughOK ) {
        NSLog(@"State is Playthrough OK");
}

10-08 12:01