播放mms流的问题

时间:2009-11-25 04:16:11

标签: iphone streaming

错误日志:

[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
)

代码示例:

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];
    }
}

1 个答案:

答案 0 :(得分:0)

您的内容网址无效。我猜想MPMoviePlayerController类不支持MMS(Microsoft Media Server)。如果您绝对需要支持,我会从wikipedia page看到VLC支持MMS,因此您可以尝试移植该部分代码。对于谷歌来说,这是一个非常难的问题,其中其他定义的MMS在iPhone讨论中如此普遍。