1

I'm trying to open a video that I've stored in the app on an external player. But I do not know how to do it.

My video is in the folder res/raw. This link is for testing.

public void openVideo(View view) {
    String vidAddress = "https://archive.org/download/ksnn_compilation_master_the_internet/ksnn_compilation_master_the_internet_512kb.mp4";
    Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(vidAddress));
    intent.setDataAndType(Uri.parse(vidAddress), "video/*");
    startActivity(intent);
}
Zoe
  • 27,060
  • 21
  • 118
  • 148
OliverDamon
  • 147
  • 9
  • Check out this question and answer and update. https://stackoverflow.com/questions/7909634/android-using-default-video-player – Mr.Drew Jun 03 '18 at 15:25

0 Answers0