弹出 MPMoviePlayerController

发布于 2024-12-14 11:52:48 字数 74 浏览 6 评论 0原文

正在开发一个 ipad 应用程序,我想在其中弹出所需大小的 MPMoviePlayer 控制器(比如屏幕的 3/4)。如何才能实现呢?

Am developing an ipad app in which I want to pop up the MPMoviePlayer controller in a required size(Say 3/4th of the screen). How it can be achieved?

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

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

发布评论

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

评论(1

遮云壑 2024-12-21 11:52:48

您可以在任意位置添加 MPMoviePlayerController 视图(它不是 UIViewController 子类,但有一个 view 属性,即 UIView)(您也可以根据需要设置其框架)

moviePlayerController.view.frame = yourCustomFrame;
[otherView addSubview:moviePlayerController.view];

电影播放器​​(类型为 MPMoviePlayerController)管理播放
来自文件或网络流的电影。播放发生在视图中
由电影播放器​​拥有并以全屏或内联方式进行。
您可以将电影播放器​​的视图合并到拥有的视图层次结构中
通过您的应用程序,或使用 MPMoviePlayerViewController 对象来管理
为您准备的演示文稿。

编辑:

要将其集成到 UIPopoverController 中,您可以创建 UIViewController 的子类,例如 YourVideoViewController ,它具有 MPMoviePlayerController 属性(并将 MPMoviePlayerController 视图添加到其自己的视图中),然后使用 YourVideoViewController 创建 UIPopoverController 。

编辑:

您必须使用 MPMoviePlayerController 同步

- (UIImage *)thumbnailImageAtTime:(NSTimeInterval)playbackTime timeOption:(MPMovieTimeOption)option

加载电影(您必须注册加载状态更改通知)或异步

- (void)requestThumbnailImagesAtTimes:(NSArray *)playbackTimes timeOption:(MPMovieTimeOption)option

API。在后一种情况下,您应该注册 MPMoviePlayerThumbnailImageRequestDidFinishNotification 通知以获取缩略图。

You can add the MPMoviePlayerController view (it is not a UIViewController subclass but has a view property, which is a UIView), where ever you want (you can also set its frame as you wish)

moviePlayerController.view.frame = yourCustomFrame;
[otherView addSubview:moviePlayerController.view];

A movie player (of type MPMoviePlayerController) manages the playback
of a movie from a file or a network stream. Playback occurs in a view
owned by the movie player and takes place either fullscreen or inline.
You can incorporate a movie player’s view into a view hierarchy owned
by your app, or use an MPMoviePlayerViewController object to manage
the presentation for you.

EDIT:

To integrate it to a UIPopoverController, you can make a subclass of UIViewController, say YourVideoViewController which has a MPMoviePlayerController property (and adds the MPMoviePlayerController view to its own view), then create a UIPopoverController with YourVideoViewController.

EDIT:

You have MPMoviePlayerController synchronous

- (UIImage *)thumbnailImageAtTime:(NSTimeInterval)playbackTime timeOption:(MPMovieTimeOption)option

the movie must be loaded (you must register for the load state changes notifications), or asynchronous

- (void)requestThumbnailImagesAtTimes:(NSArray *)playbackTimes timeOption:(MPMovieTimeOption)option

APIs. In the latter case you should register for MPMoviePlayerThumbnailImageRequestDidFinishNotification notifications to get the thumbnails.

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