I have a ViewPager which is used to display images or videos. So it uses two fragments. One fragment has ImageView and the other one has VideoView.
So when a user is watching a movie and swipes to another fragment I want the video to stop playing in the now offscreen fragment.
How can I do this?