7
我有.m3u8
鏈接,我需要播放iOS
,它支持HLS Protocol
。在iOS上播放.m3u8文件
當我將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 =熔點;'和設定它到全屏'[self.moviePlayer setFullscreen:YES];'而其中被添加到屏幕的MPMoviePlayerController視圖的代碼? – iCoder
@iCoder:根據您的評論編輯代碼,仍然沒有運氣。 –
檢查出答案! – iCoder