iPhone/iPad Downloading and Playing Simultaneously

前端 未结 1 899
遇见更好的自我
遇见更好的自我 2021-01-17 04:16

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 cocep

相关标签:
1条回答
  • 2021-01-17 05:00

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

    To Make the Video capable of streaming

    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.

    See More for Apple Live Streaming HTTP LIve Streaming

    0 讨论(0)
提交回复
热议问题