3

I am trying to find a video player library that I can add to my Android App source that will allow the user to play the video at a slower speed, ideally adjustable by the user.

Also, I need the player to allow for two videos to be on screen at once, with separate controls.

I have looked at a couple of players available http://www.vitamio.org/ (can't play two videos), and http://wiki.videolan.org/AndroidCompile (I don't have access/experience on Linux machine to compile source for Android).

Steve
  • 31
  • 1
  • 5

1 Answers1

0

Android 6.0 added PlaybackParams class to control playback behavior. -

Use setPlaybackParams method of MediaPlayer as given below -

videoview = (VideoView)findViewById(R.id.videoview);
videoview.setVideoURI("Your Video URI"); 
videoview.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
                @Override
                public void onPrepared(MediaPlayer mp) {
                    //works only from api 23
                    PlaybackParams myPlayBackParams = new PlaybackParams();
                    myPlayBackParams.setSpeed(0.5f); //here set speed eg. 0.5 for slow 2 for fast mode
                    mp.setPlaybackParams(myPlayBackParams);

                    videoview.start();//start your video.
                }
        });

You can adjust speed of video by using setSpeed method of PlaybackParams .

karanatwal.github.io
  • 3,613
  • 3
  • 25
  • 57