iPhone / iPad同时下载和播放 [英] iPhone/iPad Downloading and Playing Simultaneously

查看:160
本文介绍了iPhone / iPad同时下载和播放的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过App同时下载和流式传输和下载视频。
视频很重,所以转换成m4u8格式并使用VOD Live流媒体cocept在MPMoviePlayer中播放它们。
如何下载现场直播视频与模仿同步。
你能建议我。

I want to Download and Streaming and Downloading the video simulteniouslly by App. There video are heavy so Converted into m4u8 format and using the VOD Live streaming cocept to play them in MPMoviePlayer. How to download there live streaming Video simulteniouslly with palying . Can you suggest me.

推荐答案

以下是播放电影的代码,希望这是有用的..

FOllowing are the code to play the movie, Hope this is useful..

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

使视频能够流式播放


  1. 视频应为.mp4格式。

  2. 所有视频都应使用Miro Video Converter进行转换。 Mac(或类似的转换器),使其兼容iPhone,iPad和Android设备。
    转换后的视频将在移动设备中播放。但是,只有在从服务器下载完整视频后才能播放视频。

  3. 要制作视频流,必须将视频的元数据移动到视频的开头。为实现这一目标,我们必须使用名为Medadata移动设备的工具对视频进行编码。

  4. 然后最终视频兼容流媒体并能够在所有移动设备中播放。
    然后视频必须通过FTP连接到所需的虚拟主机。例如demo.com/videos/test.mp4。

  5. 然后可以在iPhone或Android应用程序中配置视频,并且可以进行流式传输。

  1. Video should be of .mp4 format.
  2. All videos should be converted using the Miro Video Converter in Mac (Or similar converters) and make it compatible to play in iPhone, iPad and Android devices. Converted videos will play in mobile devices. However, the video will play only after the full video is downloaded from the server.
  3. To make the video streaming, the video's metadata has to be moved to the beginning of the video. To achieve this, we have to use a tool called Medadata mover to encode the video.
  4. Then the final video is compatible of streaming and able to play in all mobile devices. Then the video have to be FTP'ed to the desired web hosting. for example demo.com/videos/test.mp4.
  5. Then the video can be configured in iPhone or android app and can be streamed.

查看更多Apple Live Streaming
HTTP LIve Streaming

这篇关于iPhone / iPad同时下载和播放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆