【发布时间】:2014-04-04 01:26:17
【问题描述】:
我有.m3u8 链接,我需要在支持HLS Protocol 的iOS 上播放。
当我将 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 方面我还需要做些什么?
【问题讨论】:
-
首先分配
self.moviePlayer = mp;并将其设置为全屏[self.moviePlayer setFullscreen:YES];MPMoviePlayerController 视图添加到屏幕的代码在哪里? -
@iCoder:根据您的评论编辑了代码,仍然没有运气。
-
查看答案!
标签: ios video http-live-streaming m3u8