如何在iPhone应用程序中播放网址?

时间:2012-01-28 07:06:31

标签: ios4

[urlDict setObject:urlStr forKey:@“url”];

    [urlArray addObject:urlDict];

//在urlArray这里有我的网址,

http://example.com/somevidya.AVI

如何在iphone应用程序中播放此URL?

1 个答案:

答案 0 :(得分:0)

您可以将此网址添加到MPMoviePlayerController中。

MPMoviePlayerController *videoPlayer = [[MPMoviePlayerController alloc] initWithContentURL:url];

然后以模态方式呈现它:

[[UIApplication sharedApplication].keyWindow.rootViewController presentModalViewController:video animated:YES];

并发布videoPlayer:

[videoPlayer release];