gpt4 book ai didi

objective-c - 弹出 MPMoviePlayerController

转载 作者:行者123 更新时间:2023-11-29 04:55:38 26 4
gpt4 key购买 nike

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

最佳答案

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

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.

编辑:

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

编辑:

您有 MPMoviePlayerController 同步

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

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

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

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

关于objective-c - 弹出 MPMoviePlayerController,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8047795/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com