Android HoneyComb video not showing

My Android app has a WebView that includes video and audio. When the application runs on Android 2.3.x, video streams and sound are played.

I changed the application to work on HoneyComb (3.1) on the Samsung Tab 10.1 tablet, the video does not broadcast and the sound does not play. Video streams when the URL is entered in the Tab browser.

This is the java code:

mWebView.setWebChromeClient(new WebChromeClient()); mWebView.setWebViewClient(new WebViewClient()); mWebView.getSettings().setAllowFileAccess(true) mFileName = fileName_items[item_position]; mFullPath = "file:///android_asset/"+mFileName+".html"; mWebView.loadUrl(mFullPath); 

In HTML, I tried both the embed tag and the video tag. The inserted tag does not show anything, while the video tag shows controls, and I can switch the play / pause, but the video is not displayed.

  <video controls="controls" style="align:center;" height="300" width="300"> <source src="http://www.at.com/videos/an1.mp4" type="video/mp4"> </video> <embed type="video/mp4" src="http://www.at.com/videos/an1.mp4" width="340" height="140" /> 
+4
source share
1 answer

I found the same thing. But here is some more info:

  • When I set hardwareAccelerated to true, the video is shown, but in landscape mode only part of the video is displayed.
  • youtube plays fine in portrait mode with hardware acceleration enabled

In addition, I experience crashes when turning on hardware acceleration and when loading data from some URLs. (Sometimes it falls, sometimes it doesn't)

+5
source

All Articles