<嵌入>在由 Webview 加载的 HTML 中 在 Sense UI 中损坏嵌入>
我有一个加载包含
试试下面的代码...有什么想法吗?我很困惑。看起来确实像是 HTC Sense 的 bug?
WebView wv = (WebView) findViewById(R.id.wv1);
wv.getSettings().setJavaScriptEnabled(true);
wv.getSettings().setBuiltInZoomControls(true);
wv.getSettings().setPluginsEnabled(true);
wv.loadData("
<html>
<body>
Here is the test embed:
<embed src=\"http://www.youtube.com/v/-ptYTGTNiyQ\"
type=\"application/x-shockwave-flash\" width=\"280\"
height=\"170\"></embed>
</body>
</html>",
"text/html", "UTF-8");
在我的测试中,这将在没有 SenseUI 的所有 Android 版本上运行良好,但对于任何看起来像任何 SenseUI 手机的内容显示为空白,因此用户无法单击它。
I have a WebView that loads HTML that contains an <embed>. When loading in stock android (G1, NexusOne, Ion, etc) it looks fine and can be clicked on to watch it in the YouTube app. But when loading it using either the HTC EVO or Incredible (both Sense UI phones ) the space where the content should be is completely blank.
Try this code below... Any ideas? I'm stumped. Certainly looks like an HTC Sense bug?
WebView wv = (WebView) findViewById(R.id.wv1);
wv.getSettings().setJavaScriptEnabled(true);
wv.getSettings().setBuiltInZoomControls(true);
wv.getSettings().setPluginsEnabled(true);
wv.loadData("
<html>
<body>
Here is the test embed:
<embed src=\"http://www.youtube.com/v/-ptYTGTNiyQ\"
type=\"application/x-shockwave-flash\" width=\"280\"
height=\"170\"></embed>
</body>
</html>",
"text/html", "UTF-8");
In my testing, this will run fine on all Android versions, without SenseUI, but it shows blank for what looks like any SenseUI phone, so the user can't click on it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以尝试添加 GestureOverlayView 并实现 onGestureListener() 或使用通用View.onClickListener() 查找用户的点击输入。
然后尝试看看 JavaScript 中是否有一种方法可以在 Web 视图中接受来自 Android 的事件(我确信有),并使用它来显式触发视频的启动/停止,以便它在 SenseUI 中工作。 (我在 Sense 方面也遇到了麻烦,所以我能感受到你的痛苦!)
希望这会有所帮助!
You might try adding a GestureOverlayView and implementing onGestureListener() or using the generic View.onClickListener() to look for a click input by the user.
Then try seeing if there is a way in javascript to accept events from Android in a webview (I'm sure there is) and use that to trigger starting/stopping of the video explicitly, so that it works in SenseUI. (I'm having troubles with Sense, as well, so I feel your pain!)
Hope this helps!