我能够将我的 vimeo 视频嵌入到我的应用程序中,并在点击时在本地视频播放中播放。我的问题是,在使用 native 视频播放器时,实际上是 webview 或完全独立的东西。我试图让播放器自动旋转,因为我的应用程序都是纵向模式。有谁知道我怎么能做到这一点?我正在使用 phonegap 来组装这个应用程序。预先感谢您的帮助!
最佳答案
标准 Xcode Mac OS 应用程序中的层次结构应该是这样的:
窗口: 看法: QTMovieView
如果你已经安装了 Xcode,你可能想检查你硬盘上的这个文件: file:///Library/Developer/Documentation/DocSets/com.apple.adc.documentation.AppleSnowLeopard.CoreReference.docset/Contents/Resources/Documents/index.html#samplecode/MyMediaPlayer/Introduction/Intro.html#//apple_ref/doc/uid/DTS40009203-介绍-DontLinkElementID_2
不确定如何使用 PhoneGap 实现,但这是在 ObjectiveC 中的实现方式
要让它自动旋转,您所要做的就是让 View 响应旋转的变化。
控制 View 的东西( View Controller )就是完成此操作的地方。
您将需要在 View 文件的界面中使用它: - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation;
这个方法稍后在 .m 文件中
(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)接口(interface)方向 { 返回是;
如果您的 HD 上安装了最新的 iOS SDK,您还可以查看这个 iOS 项目 (AVPlayerDemo),它可能会有所帮助:file:///Library/Developer/Shared/Documentation/DocSets/com。 apple.adc.documentation.AppleiOS5_0.iOSLibrary.docset/Contents/Resources/Documents/index.html#samplecode/AVPlayerDemo/Listings/ReadMe_txt.html
关于IOS 视频播放器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9999495/