4

I am developing a app which will be on both platform android and IPhone.

the app is about record video and post to server and users can see that video on their home feed of app.

i am successfully recorded video and uploaded it on server from both IPhone and android. video is uploaded in base64 format to server and server converts that into video and save it on server.

but unable to play video recorded from android on IPhone. video recorded from IPhone can be played in android.

video is recording in .mp4 format in both platform.

i have paste my code for recording video in android and code for playing video in iphone

Please if anyone can help me is appreciated

Code for recording video in Android:-

Intent intent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
intent.putExtra(MediaStore.EXTRA_OUTPUT, fileUri);
intent.putExtra("android.intent.extra.durationLimit", 7);
intent.putExtra(android.provider.MediaStore.EXTRA_VIDEO_QUALITY,0);

Code for play video in IPhone(Live Streaming) from URL

    MPMoviePlayerViewController* movieController = [[MPMoviePlayerViewController alloc] initWithContentURL:[NSURL URLWithString:@"http://journeyappadmin.appealsoft.com//storedata//ExpVideos//420_v635296694326445312.mp4"]];
    movieController.moviePlayer.controlStyle=MPMovieControlStyleFullscreen;
    movieController.view.frame = CGRectMake(0, 0, 320,400);
    [self presentViewController:movieController animated:YES completion:nil];
    [movieController.moviePlayer prepareToPlay];
    [movieController.moviePlayer play];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlayBackDidFinish:) name:MPMoviePlayerPlaybackDidFinishNotification object:movieController];




- (void)moviePlayBackDidFinish:(NSNotification *)notification {

    [[NSNotificationCenter defaultCenter]removeObserver:self name:MPMoviePlayerPlaybackDidFinishNotification object:nil];

    [movieController dismissModalViewControllerAnimated:YES];

}

Error:

_itemFailedToPlayToEnd: {
  kind = 1;
  new = 2;
  old = 0;
}
Omar
  • 32,302
  • 9
  • 69
  • 112
Kanhaiya
  • 249
  • 1
  • 2
  • 8

1 Answers1

0

It's not mp4 for real even if it appears as extension. You need some more codecs as said here Can't Play video in android uploaded from iphone and here some more explanation iPhone recorded video is not playing on Android
I was having the opposite problem with .mov iPhone videos not playing on Android and solved it using the VLC application.

IvanF.
  • 513
  • 10
  • 18