在iOS上播放.m3u8文件

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了在iOS上播放.m3u8文件相关的知识,希望对你有一定的参考价值。

我有.m3u8链接,我需要在支持iosHLS Protocol上玩。

当我直接将URL分配给MPMoviePlayerController并播放时,视频不可见,但我可以听到音频。

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];
}

我还需要在iOS方面做些什么?

以上是关于在iOS上播放.m3u8文件的主要内容,如果未能解决你的问题,请参考以下文章