4

The old trick WebView and HTML5 <video> works great until Android 3+. The problem with ICS is the video can play both inline and fullscreen, but when I lock the screen, the video will continue play at the background (I can hear the voice).

Does anybody know how to fix this?

Try this in your code, I think this is how I fixed the problem :

public void onPause() {
    if(Build.VERSION.SDK_INT >= 11) {
        super.onPause();
    }
}

public void onResume() {
    if(Build.VERSION.SDK_INT >= 11) {
        super.onResume();
    }
}
Community
  • 1
  • 1
dongshengcn
  • 6,434
  • 7
  • 35
  • 44

0 Answers0