1

The Android app that I created works pretty well except on phones with Android 4.0 (ICS). Users have been reporting that they only see grey background.

I tried to test this with the Android emulator but I don't get any stacktraces or errors (although I can't test whether or not the video actually plays since it's on an emulator).

Here's the code:

WebView player = (WebView) findViewById(R.id.player);
player.getSettings().setLoadWithOverviewMode(true);
player.getSettings().setUseWideViewPort(true);
player.getSettings().setJavaScriptEnabled(true);
player.getSettings().setJavaScriptCanOpenWindowsAutomatically(false);
player.getSettings().setPluginState(WebSettings.PluginState.ON);
player.setWebViewClient(new JoinDOTAWebViewClient());
player.setKeepScreenOn(true);
player.setBackgroundColor(R.drawable.background);
player.setVerticalScrollBarEnabled(false);
player.setHorizontalScrollBarEnabled(false);

flashObject = changeDimensions(flashObject);
String actualURL = wrapActualURL(getVideoID(flashObject));
player.loadUrl(actualURL);

If you need more information, feel free to ask. Thanks!

bassicplays
  • 328
  • 1
  • 7
  • 21
  • Hey if you don't mind posting the apk somewhere I've got a Galaxy Nexus with ICS I can test it out on for ya, I've got some system tools that let me look on at the logs on the phone so I might be able to give some insight (also be able to tell you if I can re-produce, I think there's now an OS option for disabling plugins in the browser, I'm curious if that's overriding your attempt to set the PluginState. – shaunhusain Mar 24 '12 at 20:05
  • Oh actually just double checked it it's in the browser settings under the advanced section: Enable plug-ins, but I honestly don't recall the default value, I have it set to "Always On", the other options are "on demand" and "off". – shaunhusain Mar 24 '12 at 20:08
  • you can find the app in Google Play here: https://play.google.com/store/apps/details?id=com.dokgu.joindota also my entire code, the entire project can be found on GitHub: https://github.com/dokgu/JoinDOTA – bassicplays Mar 24 '12 at 20:56
  • Well so far I can confirm what your other users are saying, I don't really see anything load, I do see the spinner when going to Live stream or VOD and picking a clip but otherwise just a black screen... I'm re-installing the Android SDK cause mine had gotten stale and corrupted, but I'll let you know if i get any more info from DDMS/Logcat or otherwise. – shaunhusain Mar 24 '12 at 21:17
  • Wow thanks shaunhusain! I'm really looking forward to anything that would lead me to trace where the fault is at. Thanks for your time. – bassicplays Mar 24 '12 at 21:24

1 Answers1

0

Have to post as an answer cause I want to get a screenshot up to you in case you want to diff before I'm able to pull down your code and actually debug. I don't see anything obvious going wrong though.

Debug Output

Open the image in a new tab to see full size.

I cleared the logs, filtered down to your app, then started up the app, chose one live stream, didn't work, no error, went back went to VOD, chose a video there, nothing loads, went back, and this is the resulting log so far.

ah taking away the filter and scanning through the logs a bit more I found something pertinent: 03-24 16:22:33.928: W/webview(2507): java.lang.Throwable: Warning: A WebView method was called on thread 'WebViewCoreThread'. All WebView methods must be called on the UI thread. Future versions of WebView may not support use on other threads.

enter image description here

shaunhusain
  • 19,630
  • 4
  • 38
  • 51
  • Well we have the same result. Nothing obviously wrong seems to pop, even in the emulator. – bassicplays Mar 24 '12 at 21:28
  • I'm not sure what this means but I am guessing I should play the videos on a separate thread? Much like the thread I used to populate the list of livestreams and VODs? – bassicplays Mar 24 '12 at 21:34
  • Yah not sure exactly what to make of it either but it does sound like it could be the issue, found another similar question with an answer based on the warning but the answer wasn't accepted so not sure if it works: http://stackoverflow.com/questions/9621257/ads-showing-on-honeycomb-webview-but-not-ics-webview – shaunhusain Mar 24 '12 at 21:40
  • Ok, I'll take a look at this later. And try it out too. I'll let you know what I find out. Thanks again! – bassicplays Mar 24 '12 at 21:43
  • No problem, you just gotta add SC2 live streams so I can use it too :) – shaunhusain Mar 24 '12 at 21:48
  • Hey, I found out what was causing the Warning you got there. On both WatchLivestream.java and WatchVOD.java, you can comment out the player.getSettings().setUseWideViewPort(true); part. I tested this on Android 2.3 and it still works, I tried with ICS emulator and the warning didn't appear. Could you test on your device if it plays the clips? By the way, for SC2, try https://play.google.com/store/apps/details?id=com.streamcatcher I've installed that before and worked great. Not really a player of SC2. – bassicplays Mar 24 '12 at 22:57
  • Just playing with ya I figure most DOTA players have firmly decided not to jump ship at this point, I'm not hardcore in SC2 but it's pretty fun (so yah thanks for the link). I have to update my SDKs/APIs in the SDK manager to run it locally, I'm getting Android 2.2 for platform 8 let me know if you're using something different but that's what the errors suggested when I imported your project. – shaunhusain Mar 24 '12 at 23:49
  • Yes the project is intended to run from Froyo onwards. – bassicplays Mar 25 '12 at 00:08
  • Tried commenting that out, no change though still seeing the warning too – shaunhusain Mar 25 '12 at 00:15
  • That is weird. I've tried several times now and the warning is not showing anymore. – bassicplays Mar 25 '12 at 00:25
  • Yah not sure what changed, either commenting or not commenting that out though I'm getting the following message in logcat now too: 03-24 19:26:22.841: E/libEGL(7802): call to OpenGL ES API with no current context (logged once per thread) – shaunhusain Mar 25 '12 at 00:29
  • Ok I'll take a look into this later again. This seems new, never seen it before. – bassicplays Mar 25 '12 at 00:40