I am using VideoView for playing video,I would like to stop the playing video completely.Please help me on this for solving it.Thanks.
The android.widget.VideoView class provides methods to play and control the video player. The commonly used methods of VideoView class are as follows: sets the media controller to the video view. sets the URI of the video file. starts the video view. stops the playback. pauses the playback.
Following is the code snippet, to use VideoView and MediaController classes to implement video player in android application to play videos based on our requirements. VideoView videoView = (VideoView)findViewById (R.id.vdVw); MediaController mediaController= new MediaController (this);
Generally, the MediaController class in android will provide playback options for video player, such as play, pause, backward, forward, etc. The VideoView class in android will provide the functionality to fetch and play the videos using video player with minimal setup in android applications.
Let’s we discuss some important methods of VideoView that may be called in order to manage the playback of video: 1. setVideoUri (Uri uri): This method is used to set the absolute path of the video file which is going to be played. This method takes a Uri object as an argument.
using this code u can stop videoplayer
videoView.stopPlayback();
For further ref link
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With