views:

117

answers:

0

I'm streaming a movie on the iPad. If I just load a mp4 file, the player doesn't autostart - but with the example m3u8, it insists on autostarting. Has anyone encountered this? Am I doing something wrong?

- (id)initWithVideo:(VideoDO*)video frame:(CGRect)rect { 
NSURL* videoURL = [NSURL     URLWithString:@"http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8"]; // With    this URL, player starts automatically
 self.moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:videoURL];

 moviePlayer.shouldAutoplay = NO;
 moviePlayer.controlStyle = MPMovieControlStyleEmbedded;
 moviePlayer.view.frame = rect;
 moviePlayer.view.backgroundColor = [UIColor blackColor]; 
 [moviePlayer prepareToPlay];  

 self.view = moviePlayer.view;   
 [moviePlayer stop];

 [[NSNotificationCenter defaultCenter] addObserver:self    selector:@selector(movieFinishedCallback:) name:MPMoviePlayerPlaybackDidFinishNotification object:moviePlayer];
 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(movieChangedLoadState:) name:MPMoviePlayerLoadStateDidChangeNotification object:moviePlayer];


 return self;
}