![]() ![]() getCurrentPosition() – Returns an integer value indicating the current position of playback.Will typically return -1 unless called from within the OnPreparedListener() callback method. getDuration() – Returns the duration of the video.setOnCompletionListener(MediaPlayer.OnCompletionListener) - Allows a callback method to be called when the end of the video is reached.setOnErrorListener(MediaPlayer.OnErrorListener) - Allows a callback method to be called when an error occurs during the video playback.setOnPreparedListener(MediaPlayer.OnPreparedListener) – Allows a callback method to be called when the video is ready to play. ![]() isPlaying() – Returns a Boolean value indicating whether a video is currently playing.stopPlayback() – Stops the video playback.setVideoUri(Uri uri) – Performs the same task as the setVideoPath() method but takes a Uri object as an argument instead of a string.This can be either the URL of a remote video file or a video file local to the device. setVideoPath(String path) – Specifies the path (as a string) of the video media to be played.Some of the more commonly used methods are as follows: The VideoView class has a wide range of methods that may be called in order to manage the playback of video. Android currently supports the following video formats: This is a visual component which, when added to the layout of an activity, provides a surface onto which a video may be played. By far the simplest way to display video within an Android application is to use the VideoView class. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |