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

发布于 2024-12-29 14:15:42 字数 274 浏览 1 评论 0原文

[urlDict setObject:urlStr forKey:@"url"];

    [urlArray addObject:urlDict];

//在urlArray中我得到了以下网址,

http://example.com/somevidya.AVI

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

[urlDict setObject:urlStr forKey:@"url"];

    [urlArray addObject:urlDict];

//here in urlArray i got bellow url,

http://example.com/somevidya.AVI

How to play this url in iphone application?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

掌心的温暖 2025-01-05 14:15:42

您可以像这样将 url 添加到 MPMoviePlayerController 中。

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

然后像这样以模态方式呈现它:

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

并释放 videoPlayer:

[videoPlayer release];

You can add the url to a MPMoviePlayerController like this.

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

then present it modally like so:

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

and release the videoPlayer:

[videoPlayer release];
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文