Iphone – writing an iPhone application with embedded video

iphonevideovideo-streaming

I am researching video streaming for an iPhone application that I may have to write in the near future. The application does a whole lot other than stream video, but video aspect is the part that I have no experience with.

Anyone know of any good articles on writing streaming video apps?

Google seems to inundate me with links that have everything not to do what I seek.

Thanks,

m

Best Solution

Apple provide good documentation on the media framework i ntheir docs.

Search for MPMoviePlayerController. The following sample code plays a movie from a URL. (disclaimer, this code lifted from Apple).

-(void)playMovieAtURL:(NSURL*)theURL 

{
    MPMoviePlayerController* theMovie=[[MPMoviePlayerController alloc] initWithContentURL:theURL]; 
    theMovie.scalingMode=MPMovieScalingModeAspectFill; 
    theMovie.userCanShowTransportControls=NO;

    // Register for the playback finished notification. 

    [[NSNotificationCenter defaultCenter] addObserver:self 
                                            selector:@selector(myMovieFinishedCallback:) 
                                                name:MPMoviePlayerPlaybackDidFinishNotification 
                                              object:theMovie]; 

    // Movie playback is asynchronous, so this method returns immediately. 
    [theMovie play]; 
} 

// When the movie is done,release the controller. 
-(void)myMovieFinishedCallback:(NSNotification*)aNotification 
{
    MPMoviePlayerController* theMovie=[aNotification object]; 
    [[NSNotificationCenter defaultCenter] removeObserver:self 
                                                    name:MPMoviePlayerPlaybackDidFinishNotification 
                                                  object:theMovie]; 

    // Release the movie instance created in playMovieAtURL
    [theMovie release]; 
}
Related Question