3

Well, I've used VideoView to play my Video. It only support .mp4 format(Correct me if I'm wrong), I need to play .flv video. I've MX Player/VLC player installed on my Android phone. How do I load the list of available Media Players when I click Play Video Button in my Activity.

Below is the code I've written using Video View, if it helps

public void onClick(View v) {
            File root = Environment.getExternalStorageDirectory();                
            String externalFilesDir = getExternalFilesDir(null).toString();       
            String videoResource = externalFilesDir +"/" + "VID_20160115_215637181.mp4";
            mediaController.setAnchorView(videoView);
            videoView.setMediaController(mediaController);
            videoView.setVideoPath(videoResource);
            videoView.requestFocus();
            videoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
                @Override
                public void onPrepared(MediaPlayer mp) {
                    videoView.seekTo(0);
                    videoView.start();
                }
            });
        }
Spark
  • 371
  • 6
  • 15

1 Answers1

1

If You want to play video in some other player, you can use ACTION_VIEW intent

Example in this question: Android intent for playing video?

Community
  • 1
  • 1
bartexsz
  • 239
  • 1
  • 11