【发布时间】:2026-02-22 10:45:01
【问题描述】:
我正在尝试使用 MPMoviewPlayerController 通过实时流式传输在我的应用程序中播放视频,它对于保存在我的捆绑包中的那些视频工作正常,但它不适用于我正在使用的实时流式传输
//for Bundle Video
NSString *urlStr = [[NSBundle mainBundle] pathForResource:@"Video.mp4" ofType:nil];
//for Streaming Video
NSURL *videoURL = [NSURL URLWithString:@"http://streaming.disponivel.uol.com.br/video360p2/288148-1192657.mp4"];
self.playerController = [[MPMoviePlayerViewController alloc] initWithContentURL:videoURL];
[self.view addSubview:self.playerController.view];
self.playerController.view.frame = CGRectMake(0, 0, 320, 400);
[self.playerController.moviePlayer play];
我如何流式传输实时视频?
【问题讨论】:
-
您发布的 URL 指向位于网络服务器上的文件,而不是流。
MPMoviePlayerViewController将接受流,但不仅仅是位于服务器上的文件。 -
能否请您提供一些流媒体链接,我尝试了几次但无法正常工作
-
我想使用 MPMoviePlayer 播放视频,而不是在 webview 中
标签: iphone ios objective-c xcode mpmoviewcontroller