【发布时间】:2012-05-15 09:30:26
【问题描述】:
我想通过应用程序同时下载和流式传输和下载视频。 有视频很重所以转换成 m4u8 格式并使用 VOD 实时流媒体 cocept 在 MPMoviePlayer 中播放它们。 如何在播放时同时下载实时流媒体视频。 你能推荐我吗?
【问题讨论】:
标签: ios
我想通过应用程序同时下载和流式传输和下载视频。 有视频很重所以转换成 m4u8 格式并使用 VOD 实时流媒体 cocept 在 MPMoviePlayer 中播放它们。 如何在播放时同时下载实时流媒体视频。 你能推荐我吗?
【问题讨论】:
标签: ios
以下是播放电影的代码,希望对你有用..
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];
}
使视频能够流式传输
查看更多关于 Apple 直播的信息 HTTP LIve Streaming
【讨论】: