Error log:
[Session started at 2009-11-25 11:10:27 +0700.]
2009-11-25 11:10:32.454 MoviePlayer[1085:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Invalid content URL provided to MPMoviePlayerController (mms://202.142.200.130/fm97.5). Use +[NSURL fileURLWithPath:] for local movie files.'
2009-11-25 11:10:32.456 MoviePlayer[1085:207] Stack: (
31081563,
2496697609,
31165499,
31165338,
26283790,
11147,
16078,
2733145,
3140514,
3149251,
3144463,
2838067,
2746396,
2773173,
39177937,
30866304,
30862408,
39171981,
39172178,
2777091,
10648,
10502
)
Code Sample:
NSURL *movieURL = [NSURL URLWithString:@"mms://202.142.200.130/fm97.5"];
MoviePlayerAppDelegate *appDelegate = (MoviePlayerAppDelegate *)[[UIApplication sharedApplication] delegate];
[appDelegate initAndPlayMovie:movieURL];
-(void)initAndPlayMovie:(NSURL *)movieURL
{
// Initialize a movie player object with the specified URL
MPMoviePlayerController *mp = [[MPMoviePlayerController alloc] initWithContentURL:movieURL];
if (mp)
{
// save the movie player object
self.moviePlayer = mp;
[mp release];
// Apply the user specified settings to the movie player object
[self setMoviePlayerUserSettings];
// Play the movie!
[self.moviePlayer play];
}
}