在iOS上播放.m3u8文件

问题描述 投票:7回答:1

我有.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 video http-live-streaming m3u8
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.