2

Anyone know how to open new intent to play video from url in android using native video player.

My code as below

Intent intent = new Intent(android.content.Intent.ACTION_VIEW);
Uri data = Uri.parse(UriLink);
intent.setDataAndType(data, "video/*");
startActivity(intent);

when try to play video error msg with unable to play the video. I'm playing the video url http://player.vimeo.com/video/31240369. Any help will appreciated.

Ankit
  • 6,554
  • 6
  • 49
  • 71
nick
  • 121
  • 1
  • 2
  • 10

2 Answers2

2

That URL does not appear to lead to a video. It leads to a Web page. Specifying video/* will at best work if the URL points to an actual video (e.g., MP4 file); it will certainly not work if you point to a Web page.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
0

You can't play vimeo videos without using their SDK. If the videos are in the pro vimeo account, then you can get the mp4 urls which are playable outside the vimeo sdk.

However, there is a worked around, use following third party library, that will fetch you the mp4 video if you pass the vimeo videoId or the vimeo video URL; that mp4 url would be playable using any media player outside the vimeo sdk.

compile 'com.github.ed-george:AndroidVimeoExtractor:1.1.1'

(https://github.com/ed-george/AndroidVimeoExtractor)

Abdul Samad
  • 526
  • 5
  • 13