Android WebView 中的 Flash - 分层问题

发布于 2024-11-01 06:50:06 字数 951 浏览 7 评论 0原文

我正在尝试在包含 flash 的 android WebView 中添加交互式按钮。作为测试,我设置了一个 HTML,以便以设定的 x/y 大小快速加载。

public class webz extends WebView {
private Drawable image;
public webz(Context context, AttributeSet attrs) {
    super(context, attrs);
    image=context.getResources().getDrawable(R.drawable.icon);
    getSettings().setPluginsEnabled(true);
}
@Override
protected void onDraw(Canvas canvas) {
    super.onDraw(canvas);
    image.setBounds(100, 300, 150, 450);
    image.draw(canvas);
}

我设置了一个测试图像

,将其自身一半覆盖在闪光灯上,一半覆盖在未使用的画布上。 一旦加载,Flash 将加载到画布上绘制,只留下 HTML 上的部分。

屏幕截图链接

这个问题指出adobe的flash播放器在webview内部创建了一个surfaceview。我认为这是分层问题的原因,但我不知道如何克服它。

有谁知道如何覆盖这个?该按钮还必须将按键事件发送到闪光灯(就像您按下屏幕按钮,然后按 A 键发送到闪光灯)。如果您也知道如何做到这一点,那将会非常有帮助

I am trying to have interactive buttons in an android WebView that contains flash. As a test, I set up a HTML to load in a flash through with a set x/y size.

public class webz extends WebView {
private Drawable image;
public webz(Context context, AttributeSet attrs) {
    super(context, attrs);
    image=context.getResources().getDrawable(R.drawable.icon);
    getSettings().setPluginsEnabled(true);
}
@Override
protected void onDraw(Canvas canvas) {
    super.onDraw(canvas);
    image.setBounds(100, 300, 150, 450);
    image.draw(canvas);
}

}

I set up a test image that would overlay itself half over the flash, half over the unused canvas.
once loaded, the flash will load over the canvas draw, leaving only the part over the HTML.

LINK TO SCREENSHOT

the answer to this question states that adobe's flash player creates a surfaceview inside of the webview. i assume this is the cause of the layering issue, but i have no idea how to overcome it.

does anyone know how to override this? the button has to also send key events to the flash (like you press the on screen button, and the A key to sent to the flash). if you know how to do this as well, it would be very helpful

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

开始看清了 2024-11-08 06:50:06

将按钮添加到布局中,然后使用 setcontentview 将布局设​​置为对话框。加载活动后,将对话框显示为全屏透明对话框。

Add your button to a layout and then set the layout to a dialog using setcontentview. When your activity is loaded, show your dialog as full screen transparent dialog.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文