iPhone / iPad同时下载和播放

我想下载和stream媒体和下载videosimulteniouslly由应用程序。 有video很重,所以转换成m4u8格式,并使用VOD直播streamcocept在MPMoviePlayer中播放它们。 如何下载直播videosimulteniouslly与palying。 你能build议我吗?

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]; } 

使video能够stream式传输

  1. video应该是.mp4格式。
  2. 所有video都应该使用Mac(或类似转换器)中的Miro Video Converter进行转换,并使其兼容iPhone,iPad和Android设备。 转换后的video将在移动设备上播放。 但是,只有从服务器下载完整video后才能播放video。
  3. 为了进行videostream传输,video的元数据必须被移动到video的开头。 为了达到这个目的,我们必须使用一个名为Medadata mover的工具来编码video。
  4. 然后,最终的video兼容stream媒体,并能够在所有移动设备上播放。 然后video必须FTP'ed到所需的虚拟主机。 例如demo.com/videos/test.mp4。
  5. 然后,video可以在iPhone或Android应用程序中configuration,并可以stream式传输。

查看更多关于Apple Live Streaming HTTP LIve Streaming的信息