Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to stop video playing in VideoView programmatically in android?

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.

like image 940
Karthik Avatar asked Mar 12 '12 06:03

Karthik


People also ask

What is the use of videoview in Android?

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.

How to implement video player in Android application to play videos?

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);

What is the difference between mediacontroller and videoview in Android?

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.

How to manage the playback of video in videoview?

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.


1 Answers

using this code u can stop videoplayer

videoView.stopPlayback();

For further ref link

like image 166
Parag Chauhan Avatar answered Oct 22 '22 02:10

Parag Chauhan