Play .m3u8 file on iOS

I have a .m3u8 link that I need to play on iOS that supports the HLS Protocol .

When I assign the URL directly to MPMoviePlayerController and play, the video does not appear, but I can hear the sound.

 NSURL *movieURL = [NSURL URLWithString:@"http://qthttp.apple.com.edgesuite.net/1010qwoeiuryfg/sl.m3u8"]; MPMoviePlayerController *mp = [[MPMoviePlayerController alloc] initWithContentURL:movieURL]; [self.view addSubview:self.moviePlayer.view]; if (mp) { // save the movie player object self.moviePlayer = mp; [self.moviePlayer setFullscreen:YES]; // Play the movie! [self.moviePlayer play]; } 

What additional material do I need to do on the iOS side?

+7
ios video m3u8
source share
1 answer
 NSURL *movieURL = [NSURL URLWithString:@"http://qthttp.apple.com.edgesuite.net/1010qwoeiuryfg/sl.m3u8"]; MPMoviePlayerController *mp = [[MPMoviePlayerController alloc] initWithContentURL:movieURL]; if (mp) { mp.view.frame = self.view.bounds; [self.view addSubview:mp.view]; // save the movie player object [mp setFullscreen:YES]; // Play the movie! [mp play]; self.moviePlayer = mp; } 
+9
source share

All Articles