ios - MPMoviePlayerController 未完成加载且不播放流

标签 ios mpmovieplayercontroller m3u8

我正在尝试通过 HTTP 实时流式传输(使用 Adob​​e Media Server)使用 MPMoviePlayerController 播放视频。

- (void) viewDidAppear:(BOOL)animated{
    [super viewDidAppear:animated];
    [self playVideo];
}

- (void) playVideo{
    NSURL *url = [NSURL URLWithString:@"http://192.168.10.27/hls-vod/test.mp4.m3u8"];
    MPMoviePlayerController *moviePlayer =
    [[MPMoviePlayerController alloc] initWithContentURL:url];
    moviePlayer.controlStyle = MPMovieControlStyleDefault;
    [self.view addSubview:moviePlayer.view];
    [moviePlayer setFullscreen:YES animated:YES];
    [moviePlayer play];
}

播放器正确启动,但仍在加载并且没有开始播放视频。 我在我的设备下的 Safari 上尝试了一些链接,它工作正常!

你对这个问题有什么想法吗?

最佳答案

我找到了解决方案!我只需要在 Controller 的界面中声明 moviePlayer 并使用 playVideo 方法启动它,它就成功了!

关于ios - MPMoviePlayerController 未完成加载且不播放流,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14631108/

相关文章:

IOS AVPlayer 获取 fps

ios - 尝试 segue 时,没有任何反应

ios - 有没有办法在 MPMoviePlayerController 播放时截图

ios - 无法使用 MPMoviePlayerController 从视频中获取多个图像。操作系统状态 -12433

ios - 需要在 mpmovieplayercontroller swift 中显示视频图像

android - Exoplayer 无法播放某些音频流

ios - Google map (GMS View )不会在 iOS 中显示

iOS:点击 UITableView 不会调用 didSelectRowAtIndexPath

ios - MPmovieplayer 和流式 m3u8 文件?

ffmpeg 从本地 m3u8 获取 md5