freedomtan / html5webview

Automatically exported from code.google.com/p/html5webview
0 stars 0 forks source link

Android 4.0 #5

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
This will not work with ICS(Android 4.0 or higher) as it would use new method 
onShowCustomView(View view, int requestedOrientation, 
WebChromeClient.CustomViewCallback callback)

I hope you will update it to support ICS.

Original issue reported on code.google.com by mind...@gmail.com on 5 May 2012 at 9:53

GoogleCodeExporter commented 9 years ago
That method wasn't called when I've tried to open youtube video.
Sound is playing fine but it shows black screen instead of video

Original comment by VShapra...@betria.com on 3 Jul 2012 at 9:29

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I am facing the exact same issue i am trying to load a url which has youtube 
video embedded using iframe. I have added hardwareacceleration as true in 
manifest file.
I am only able to hear sound and i see a black screen.

The onShowCustomView and getVideoLoadingProgressView do not get called
and this is what i see in the logcat when the video is loaded.

07-05 18:45:29.790: E/libEGL(1143): call to OpenGL ES API with no current 
context (logged once per thread)
07-05 18:45:29.800: D/MediaPlayer(1143): Couldn't open file on client side, 
trying server side
07-05 18:45:30.079: E/libEGL(1143): call to OpenGL ES API with no current 
context (logged once per thread)
07-05 18:45:30.079: D/ShaderProgram(1143): couldn't load the vertex shader!
07-05 18:45:30.079: E/libEGL(1143): call to OpenGL ES API with no current 
context (logged once per thread)
07-05 18:45:30.079: D/ShaderProgram(1143): couldn't load the vertex shader!
07-05 18:45:30.079: E/libEGL(1143): call to OpenGL ES API with no current 
context (logged once per thread)
07-05 18:45:30.079: D/ShaderProgram(1143): couldn't load the vertex shader!
07-05 18:45:30.079: E/libEGL(1143): call to OpenGL ES API with no current 
context (logged once per thread)
07-05 18:45:30.079: D/ShaderProgram(1143): couldn't load the vertex shader!
07-05 18:45:30.079: E/libEGL(1143): call to OpenGL ES API with no current 
context (logged once per thread)
07-05 18:45:30.079: D/ShaderProgram(1143): couldn't load the vertex shader!

NOTE: This works perfectly fine on android gingerbread
Can anyone help me out on this?

I also tried the new method onShowCustomView(View view, int 
requestedOrientation, WebChromeClient.CustomViewCallback callback)
as suggested in the first comment but it is not working

Original comment by Aniket.B...@gmail.com on 5 Jul 2012 at 1:37

GoogleCodeExporter commented 9 years ago
Write this code in onBackPressed() or in onPause()

Class.forName("com.***.HTML5WebView").getMethod("onPause", (Class[]) 
null).invoke(html5WebView, (Object[]) null);

It worked for me in 4.2

Original comment by subairar...@gmail.com on 8 Jan 2013 at 12:49

GoogleCodeExporter commented 9 years ago
I think adding  android:hardwareAccelerate="true" to manifest file will solve 
most of your problems. For <iframe>, simple solution is to change 
shouldOverrideUrlLoading() to always return false.

Original comment by koansin....@gmail.com on 4 Feb 2013 at 1:10

GoogleCodeExporter commented 9 years ago
You can try to set an user agent to the webView it works for me on ICS like 
this:
String ua = "Mozilla/5.0 (Android; Tablet; rv:20.0) Gecko/20.0 Firefox/20.0";

WebSettings s = getSettings();
s.setUserAgentString(ua);

if it don't work look at this link for other user agents:
http://android-er.blogspot.com/2013/05/set-user-agent-string-of-webview.html

Good luck

Original comment by hafid....@gmail.com on 31 Oct 2013 at 10:22