views:

247

answers:

0

Here is some code... I have a stream that works correctly if I view with safari on the iphone or quicktimex on the mac... but the stream doesnt view in my code for the ipad simulator

- (IBAction)clickedOpenMovie:(id)sender {

 NSString *myString = [NSString stringWithFormat:@"http://myipofstreamingserver:1935/live/aStream/playlist.m3u8"];
 //NSString *myString = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"720p5994-prores-hq_iPhone_320x240.m4v"];
 NSURL *myURL = [NSURL fileURLWithPath:myString];

 [self playMovieAtURL:myURL];

}



-(void)playMovieAtURL:(NSURL*)theURL
{
 //CGRect moviePlayerFrame = CGRectMake(20, 33, 100, 100);
 //UIView playerView = [[[UIView alloc] initWithFrame:moviePlayerFrame] autorelease];


 MPMoviePlayerViewController* movieViewController = [[MPMoviePlayerViewController alloc]
           initWithContentURL:theURL];

 //theMovie.scalingMode = MPMovieScalingModeNone;

 //theMovie. = MPMovieControlStyleFullscreen;
 //movieViewController.controlStyle = MPMovieControlModeDefault;

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


 //UIViewController *movieViewController = [[UIViewController alloc] initWithContentURL:theURL];
 [self presentMoviePlayerViewControllerAnimated:movieViewController];


 //[theMovie play];
}