1

It is showing like this in browser,when I click on play it doesn't do anything. But the same URL is working fine in Android native player.

enter image description here

Here is my code and URL of that video stored in server, format of video is MP4.

I tried with some other URLs like

NSURL *url=[[NSURL alloc] initWithString:@"http://www.ebookfrenzy.com/ios_book/movie/movie.mov"];
NSURL *urll = [[NSURL alloc]initWithString:@"http://nordenmovil.com/urrea/InstalaciondelavaboURREAbaja.mp4"];

These are working fine but below one is not working

NSURL *url = [[NSURL alloc]initWithString:@"http://****IP****.com:8888/alias_1440247177838"];
moviePlayer=[[MPMoviePlayerController alloc] initWithContentURL:url];
moviePlayer.view.frame = CGRectMake(0, 20, self.videoPlayView.frame.size.width, self.videoPlayView.frame.size.height * (1.0f/3.0f)-20);
moviePlayer.controlStyle=MPMovieControlStyleDefault;
moviePlayer.shouldAutoplay=YES;
[self.videoPlayView addSubview:moviePlayer.view];
[moviePlayer setFullscreen:YES animated:YES];
Santo
  • 1,611
  • 3
  • 17
  • 37

1 Answers1

0

Unfortunately MPMoviePlayer can only play video from a direct link. (similar to the ones that you mentioned in your question.

You can either:

  1. use a direct link
  2. Or switch to UIWebView instead of MPMoviePlayer

You can use a UIWebView in following way:

UIWebView* webView = [[UIWebView alloc] initWithFrame:self.view.frame];
[self.view addSubview:webView];
webView.allowsInlineMediaPlayback = YES;
NSURL* url = [NSURL URLWithString:@"http://****IP****.com:8888/alias_1440247177838"];
[webView loadRequest:[NSURLRequest requestWithURL:url]];

Hope this helps!

S1LENT WARRIOR
  • 11,704
  • 4
  • 46
  • 60