views:

462

answers:

3

I am new to iphone development,I am parsing a XML URL and display its content in the table, when i click a row , its corresponding parsed tube URL is played using the movie player.I am using media player framework.Here is my code

NSURL *movieURL = [NSURL URLWithString:requiredTubeUrl];

if (movieURL)
{
if ([movieURL scheme])  
{
    MoviePlayerController *myMovie = [[MoviePlayerController alloc]init];

    [myMovie initAndPlayMovie:movieURL];

}

}

This is working fine, but i want to play the video using "HTTP Live Streaming".How can i do that? Any tutorials and sample code would me more helpful.Thanks.

+1  A: 

Apple provides and overview and some sample pages with streams. You provide the playlist file (.M3U8) URL to your MPMoviePlayer instance. If your server is set up properly, the .M3U8 file URL should suffice.

http://developer.apple.com/iphone/library/documentation/NetworkingInternet/Conceptual/StreamingMediaGuide/Introduction/Introduction.html#//apple_ref/doc/uid/TP40008332-CH1-DontLinkElementID_29

Cirrostratus
+1  A: 

Use MPMoviePlayerController for streaming from server.

-(void)initAndPlayMovie:(NSURL *)movieURL {
// Initialize a movie player object with the specified URL
MPMoviePlayerController *mp = [[MPMoviePlayerController alloc] initWithContentURL:movieURL];
if (mp)
{
[self.moviePlayer play];
}
}

Anil Sivadas
+1  A: 

To implement in for the browser, which applies for a lot to native app development since it directs iphone users to movie app. A lot depends on the proper stream you're wanting to view http://www.ioncannon.net/programming/452/iphone-http-streaming-with-ffmpeg-and-an-open-source-segmenter/

André van Toly