寻求有关在 iPhone 上播放电影的建议
嗨,
我正在寻找一种在我的应用程序中以描绘模式播放电影作为背景的方法。电影不应响应任何点击,我的应用程序将在电影上有自己的按钮和标签来控制应用程序。
如果您碰巧从 iTunes 商店知道 Dragons Lair/Space Ace 应用程序,那么就是这样。
似乎有几种播放 m4v 文件的方法。
有什么建议可以给我提供如上所述的视频播放功能吗?
感谢您的阅读!
Hia,
I'm looking for a way to play a movie as background in portray mode in my app. The movie should not respond to any taps and my app would have its own buttons and labels over the movie that control the app.
If you happens to know the Dragons Lair/Space Ace app from iTunes store, something this way.
It seems there are several approaches for playing a m4v file.
Any suggestion which would give me a video playback like described above?
Thanks for reading!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在应用程序委托的
application:didFinishLaunchingWithOptions:
中,您可以使用此代码。技巧是,您仍然必须在视频播放之前显示Default.png
。请务必将
MediaPlayer.framework
添加到您的项目中In your app delegate, in
application:didFinishLaunchingWithOptions:
you can use this code. Trick is, you still have to showDefault.png
before the video plays.Be sure to add
MediaPlayer.framework
to your project查看 MPMoviePlayerController 的文档。它使您可以访问电影播放器视图,您可以任意调整该视图的大小并将其添加到视图层次结构中。类参考文档对此进行了详细解释。
将播放器的
controlStyle
设置为MPMovieControlStyleNone
以删除播放器控件。Look at the documentation for
MPMoviePlayerController
. It gives you access to a movie player view that you can arbitrarily size and add to your view hierarchy. This is explained in detail in the Class Reference documentation.Set the player's
controlStyle
toMPMovieControlStyleNone
to remove the player controls.Apple 的 MPMoviePlayerController 文档对于这项任务非常有帮助。
文档进一步指出了您所追求的真正的金块:
,您可以:
播放器顶部
以编程方式使用方法
和属性”的
MPMediaPlayback协议
Apple's documentation for MPMoviePlayerController will be very helpful for this task.
The docs further note the real nugget you are after:
So, you can:
on top of the player
programmatically using the methods
and properties" of the
MPMediaPlayback protocol