在 iOS 上打开具有精确视频的电影应用程序

发布于 2024-12-22 18:54:37 字数 179 浏览 4 评论 0原文

我想从我的应用程序中打开 iPad 电影播放器​​来播放视频。 视频已经在设备上,并且应用程序注定要在预先配置的设备上临时分发,因此我们可以说视频将永远在这里。

我的问题是我不知道如何打开视频应用程序!我搜索了很多东西,包括UTI,或者嵌入式视频,但这并不能满足我的需求。

有没有办法简单地打开指定文件的播放器?

I would like to open the iPad movie player from my app to play a video.
The video will already be on the device, and the app is destined to ad-hoc distribution on pre-configured device, thus we can say the video will always be here.

My problem is that I can't figure out how to open the video app! I've searched a lot of things, including UTI, or embedded video, but that doesn't meet my needs.

Is there any way to simply open the player with the specified file ?

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

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

发布评论

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

评论(1

甚是思念 2024-12-29 18:54:37

您需要打开视频应用程序本身吗?或者您只需要从您的应用程序播放本地视频文件?在后一种情况下,您可以只使用 MPMoviePlayerController(或适用于 iOS > 3.2 的包装 MPMoviePlayerViewController)。

这样的事情对我有用。

NSURL * url = [[NSBundle mainBundle] URLForResource:@"yourvideo" withExtension:@"mov"];
player = [[MPMoviePlayerController alloc] initWithContentURL:url];
player.view.frame = self.view.bounds;
player.movieSourceType = MPMovieSourceTypeFile;

[self.view addSubview:player.view];

player.shouldAutoplay = NO;
player.fullscreen = YES;
[player prepareToPlay];    

Do you need to open the video app per se? Or do you just need to play local video file from your app? In the latter case, you can just use MPMoviePlayerController (or the wrapping MPMoviePlayerViewController for iOS > 3.2).

Something like this works for me.

NSURL * url = [[NSBundle mainBundle] URLForResource:@"yourvideo" withExtension:@"mov"];
player = [[MPMoviePlayerController alloc] initWithContentURL:url];
player.view.frame = self.view.bounds;
player.movieSourceType = MPMovieSourceTypeFile;

[self.view addSubview:player.view];

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