0

I have a viewpager who has a fragments that displays a webview (the webview has video) The problem is: i start the video then swipe to the next fragment, the video is still playing! even when i call fragment onPasue method along with webview onpause according to this:

 public void onPause() 
{
            super.onPause();
            Log.d("onPause", "onPause");
            mWebview.onPause();

}

the log print onPause but the video is still playing. What am I doing wrong?

Community
  • 1
  • 1
A.AL
  • 135
  • 3
  • 12

1 Answers1

0

Try to get the swipe on the ViewPager using onTouchEvent and when you swipe from the screen with the Webview, pause the video.

Stefan Ionescu
  • 129
  • 1
  • 8