WebView won't play embedded flash video

All your problems with Audio, Video and Images.

WebView won't play embedded flash video

Postby matdelong » Mon Aug 22, 2011 2:27 am

I am testing on a Xoom device, running OS 3.2. The project is built (in Eclipse) using the 3.1 library.

I have the latest version of flash installed, and embedded flash plays fine in my tablet's browser.

If I create an activity like this:

WebView browser = (WebView) findViewById(R.id.browserView);
browser .getSettings().setJavaScriptEnabled(true);
browser .getSettings().setPluginsEnabled(true);
browser .loadUrl("http://m.kongregate.com/games/Jiggmin/the-game-of-disorientation-mobile");

Then I hear the sound playing for the flash, but it shows up as a white box.

Similarly, any other page with embedded flash has the same problem. I've also tried making a string containing static HTML content, and loading that into the browser... but it has the same problem.

I've read every solution I could find online, from setting the view to invisible until the onPageFinish event is called, to extending the WebView class, and paining over it. I've tried reflection, to call hidden properties on the WebView's settings for enabling flash, etc. Nothing works.

Please help!

Thanks,

Mat
matdelong
Once Poster
Once Poster
 
Posts: 1
Joined: Mon Aug 22, 2011 2:14 am

Top

Re: WebView won't play embedded flash video

Postby stece » Tue Aug 23, 2011 9:49 am

does the following code work on your device?

Code: Select all
private String temp = "<object width='400' height='200'>" +
   "<param name='movie' value='http://www.youtube.com/v/DZi6DEJsOJ0?fs=1&amp;hl=nl_NL'>" +
   "</param><param name='allowFullScreen' value='false'>" +
   "</param><param name='allowscriptaccess' value='always'>" +
   "</param><embed src='http://www.youtube.com/v/DZi6DEJsOJ0?fs=1&amp;hl=nl_NL'" +
   " type='application/x-shockwave-flash' allowscriptaccess='always' allowfullscreen='false'" +
   " width='400' height='200'></embed></object>";

mWebView = (WebView) findViewById(R.id.browserView);
          mWebView.getSettings().setJavaScriptEnabled(true);
          mWebView.getSettings().setPluginsEnabled(true);
          mWebView.setBackgroundColor(Color.BLACK);
          mWebView.loadData(temp,"text/html", "utf-8");


this should just show a youtube video :) (just to check, I know very certain that this codes works)
User avatar
stece
Experienced Developer
Experienced Developer
 
Posts: 62
Joined: Wed Apr 21, 2010 10:50 am
Location: Belgium

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: No registered users and 32 guests