0

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?

Adinia
  • 3,722
  • 5
  • 40
  • 58
  • make sure you test your stream (segmenting and encoding) using [apple's tools](http://developer.apple.com/library/ios/#technotes/tn2235/_index.html). – Till May 25 '13 at 19:02

1 Answers1

2

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.

Community
  • 1
  • 1
Guillaume Algis
  • 10,705
  • 6
  • 44
  • 72
  • Well it's not the encoding, it should be right encoding right now. This is the encoding used in the official SnapChat app and they are able to stream the video somehow. Do you know how? – Jonatan Ortheden May 25 '13 at 23:40
  • I don't know SnapChat, maybe have a shot with Till's propostion with apple's validation tools. – Guillaume Algis May 26 '13 at 13:55