在 iOS4 中损坏的 UIWebView 中播放视频?

2023-10-22移动开发问题
0

本文介绍了在 iOS4 中损坏的 UIWebView 中播放视频?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我有一个从 SDK 2.0 版开始工作的应用程序,我在其中创建和添加 UIWebView,然后加载 .mov 的 URL 以播放电影.从 4.0 beta 的早期版本到 4.0 GM,这已经停止工作.当我现在加载电影时,出现以下错误::插件处理加载"并且电影永远不会显示.

I have an app that's worked since version 2.0 of the SDK where I create and add a UIWebView and then load the URL of an .mov to play a movie. Ever since the early version of the 4.0 beta up until the 4.0 GM this has stopped working. When I load a movie now I get the following error: :Plug-in handled load" and the movie never displays.

这是一个已知问题吗?我在 4.0 中做错了吗?

Is this a known issue? Am I doing something wrong in 4.0?

推荐答案

我想通了.这似乎是 iOS4 不向后兼容使用init"而不是initWithFrame"创建的 UIWebView 的问题.在 2.0 - 3.1.3 中,您只能在 UIWebview 中将视频显示为全屏.我认为这就是为什么调用init"并不重要——电影播放器会启动并全屏显示.但是,在 3.2 及更高版本中,您现在可以在 UIWebView 中内联视频,因此您必须调用 initWithFrame 并为其提供类似 [[UIScreen mainScreen] bounds] 的内容,以便有一个可见的视图.不太确定这是否是牛市,但似乎是这样.

I figured this out. It appears to be an issue with iOS4 not being backward compatible with a UIWebView created with 'init' rather than 'initWithFrame'. In 2.0 - 3.1.3, you could only show video in a UIWebview as full screen. I think this is why it didn't matter if you called 'init' -- the movie player would kick in and go fullscreen. However, in 3.2 and higher you can now inline video in a UIWebView so you have to call initWithFrame and give it something like [[UIScreen mainScreen] bounds] so there's a visible view. Not quite sure if this is bull or not but seems to be the case.

这篇关于在 iOS4 中损坏的 UIWebView 中播放视频?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

硬件音量按钮更改应用程序音量
Hardware Volume buttons change in app volume(硬件音量按钮更改应用程序音量)...
2024-08-12 移动开发问题
10

Cocos2d - 如何检查不同层中对象之间的交集
Cocos2d - How to check for Intersection between objects in different layers(Cocos2d - 如何检查不同层中对象之间的交集)...
2024-08-12 移动开发问题
8

突出显示朗读文本(在 iPhone 的故事书类型应用程序中)
Highlight Read-Along Text (in a storybook type app for iPhone)(突出显示朗读文本(在 iPhone 的故事书类型应用程序中))...
2024-08-12 移动开发问题
9

Cocos2D + 仅禁用 Retina iPad 图形
Cocos2D + Disabling only Retina iPad Graphics(Cocos2D + 仅禁用 Retina iPad 图形)...
2024-08-12 移动开发问题
10

正确的 cocos2d 场景重启?
Proper cocos2d scene restart?(正确的 cocos2d 场景重启?)...
2024-08-12 移动开发问题
7

[ios.cocos2d+box2d]如何禁用自动旋转?
[ios.cocos2d+box2d]how to disable auto-rotation?([ios.cocos2d+box2d]如何禁用自动旋转?)...
2024-08-12 移动开发问题
7