Created
December 19, 2017 09:47
-
-
Save sanjogshrestha/cc8c44b33255d0a527502080404048bd to your computer and use it in GitHub Desktop.
Play video using MediaPlayer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private VideoView videoView; | |
videoView = (VideoView) findViewById(R.id.videoView); | |
Uri video = Uri.parse("http://www.servername.com/projects/projectname/videos/1361439400.mp4"); | |
videoView.setVideoURI(video); | |
videoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() { | |
@Override | |
public void onPrepared(MediaPlayer mp) { | |
mp.setLooping(true); | |
videoView.start(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment