4

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.

Steve Haley
  • 55,374
  • 17
  • 77
  • 85
Justin
  • 111
  • 4

1 Answers1

0

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!

Codeman
  • 12,157
  • 10
  • 53
  • 91