我想下载,流媒体和下载视频同时通过应用程序。视频很重,所以转换成m4u8格式,并使用VOD流媒体技术在MPMoviePlayer中播放。如何同时下载现场流媒体视频。你能建议我。
发布于 2012-05-15 12:48:34
FOllowing是播放这部电影的代码,希望这是有用的。
NSURL *fileURL = [NSURL URLWithString:@"<Video URL>"];
[self playMovie:fileURL];
-(IBAction)playMovie:(NSString *) theURL
{
NSURL *fileURL = [NSURL fileURLWithPath:theURL];
MPMoviePlayerController *moviePlayerController = [[MPMoviePlayerController alloc] initWithContentURL:fileURL];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(moviePlaybackComplete:)
name:MPMoviePlayerPlaybackDidFinishNotification
object:moviePlayerController];
[self.view addSubview:moviePlayerController.view];
moviePlayerController.useApplicationAudioSession = NO;
moviePlayerController.fullscreen = YES;
[moviePlayerController play];
}
- (void)moviePlaybackComplete:(NSNotification *)notification
{
MPMoviePlayerController *moviePlayerController = [notification object];
[[NSNotificationCenter defaultCenter] removeObserver:self
name:MPMoviePlayerPlaybackDidFinishNotification
object:moviePlayerController];
[moviePlayerController.view removeFromSuperview];
[moviePlayerController release];
}使视频能够播放
。
查看苹果直播 HTTP LIve Streaming的更多信息
https://stackoverflow.com/questions/10597884
复制相似问题