Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

why does MPMovieLoadState have state 5?

I find MPMoviePlayerController.h,there is

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;

but when i did

NSLog(@"%d",player.loadState)

it prints out 5 or sometimes 3,how did it happen?As i know the loadstate has value of 0,1,2,4 refer to developer documentation. Thank you!

like image 286
ben Avatar asked Jun 29 '10 07:06

ben


1 Answers

The playState is a bitmask. Any number of bits can be set, such as

MPMovieLoadStatePlaythroughOK | MPMovieLoadStatePlayable

Check for states like this:

MPMovieLoadState state = [playerController loadState];
if( state & MPMovieLoadStatePlaythroughOK ) {
        NSLog(@"State is Playthrough OK");
} 
like image 59
flitzwald Avatar answered Oct 21 '22 03:10

flitzwald