Search code examples
iosmpmovieplayercontrollerm3u8

MPMoviePlayerController don't finish loading and don't play the stream


I'm trying to play a video with MPMoviePlayerController over HTTP Live Streaming (with Adobe Media Server).

- (void) viewDidAppear:(BOOL)animated{
    [super viewDidAppear:animated];
    [self playVideo];
}

- (void) playVideo{
    NSURL *url = [NSURL URLWithString:@"http://192.168.10.27/hls-vod/test.mp4.m3u8"];
    MPMoviePlayerController *moviePlayer =
    [[MPMoviePlayerController alloc] initWithContentURL:url];
    moviePlayer.controlStyle = MPMovieControlStyleDefault;
    [self.view addSubview:moviePlayer.view];
    [moviePlayer setFullscreen:YES animated:YES];
    [moviePlayer play];
}

The player is launching correctly, but it's still loading and doesn't start playing the video. I tried some links on Safari under my device and it works correctly!

Do you have any idea about that problem?


Solution

  • I found the solution ! I just have to declare the moviePlayer in the interface of the controller and initiate it an the playVideo method and it's worked !