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式传输
- video应该是.mp4格式。
- 所有video都应该使用Mac(或类似转换器)中的Miro Video Converter进行转换,并使其兼容iPhone,iPad和Android设备。 转换后的video将在移动设备上播放。 但是,只有从服务器下载完整video后才能播放video。
- 为了进行videostream传输,video的元数据必须被移动到video的开头。 为了达到这个目的,我们必须使用一个名为Medadata mover的工具来编码video。
- 然后,最终的video兼容stream媒体,并能够在所有移动设备上播放。 然后video必须FTP'ed到所需的虚拟主机。 例如demo.com/videos/test.mp4。
- 然后,video可以在iPhone或Android应用程序中configuration,并可以stream式传输。
查看更多关于Apple Live Streaming HTTP LIve Streaming的信息
- 自定义键盘与常规键盘?
- 避免video开始和结束时的模糊(甚至在使用setPreferredVideoStabilizationMode:AVCaptureVideoStabilizationModeAuto之后)?
- 带有应用程序组的NSUserDefault在iOS 8 Beta3中不起作用
- AppStore rejection – 性能:软件要求prefs:root =“GraphicsServices.framework”
- 如何在iPhone中的自定义button上设置活动指示器
- 从横向到纵向如何解决Viewport问题
- PushSharp为新创build的P12返回无效标记
- 在不同的UITableViewControllers中的UITableViewCells上一致使用UIImageView
- 如何在Phonegap / Cordova项目中实施Facebook移动安装广告跟踪?