Jonatan Ortheden
Jonatan Ortheden

Reputation: 190

How can I stream video from a video hidden inside a URL iOS?

I'm currently working on adding video support to my app.

The only problem is that no method of streaming video seems to work.

This is the format of the url that I'm generating:

http://jerwuqu.appspot.com/SnapGrapple?v=1&username=testacchere&videoid=620672369494608704r&authtoken=f6152fb6-b17a-4256-94d1-1280df34ace0

I have tried loading it in a webview but I'm then getting a disabled play button and plugin error.

I have also tried loading it with a MPMoviePlayerController like this:

NSURL *fileURL = [NSURL URLWithString:stringURL];

     moviePlayerController = [[MPMoviePlayerController alloc] initWithContentURL:fileURL]; 
     [moviePlayerController.view setFrame:CGRectMake(0, 70, 320, 270)]; 
     [self.view addSubview:moviePlayerController.view];  
     moviePlayerController.fullscreen = YES;  
     [moviePlayerController play];  

Where stringURL is the url generated. In this approach the movieplayer is instantly closed and it simply doesn't work.

Does anyone have any suggestion on how I possibly can make it work?

Upvotes: 0

Views: 326

Answers (1)

Guillaume Algis
Guillaume Algis

Reputation: 11016

The problem is not in the URL of your video but in its encoding. I tried re-encoding it with the MPEG-4 video codec at 1024kb/s using VLC, and it played just right on my iPhone.

See this question for the video formats supported by iOS.

Upvotes: 2

Related Questions