Reputation: 167
I have the VIMEO video url like "https://vimeo.com/channels/staffpicks/119777338". If am play this url in android videoview using following code
MediaController mediaController = new MediaController(this);
mediaController.setAnchorView(videoView);
Uri video = uri.parse("https://vimeo.com/channels/staffpicks/119777338");
videoView.setMediaController(mediaController);
videoView.setVideoURI(video);
videoView.start();
I had error as "Can't play this video". So how can i play this vimeo video url in android videoview. Please kindly help me in this issue. Thanks in advance.
Upvotes: 6
Views: 5599
Reputation: 3998
The URL you have requested is a webpage, not a video. To turn vimeo.com urls into embed codes (for webviews) you should use oEmbed (https://developer.vimeo.com/apis/oembed).
If you are a PRO user you can get direct access to the video files through the api (https://developer.vimeo.com/api)
Upvotes: 2
Reputation: 2670
Maybe you could use a WebView to play the video
Url would be something like:
http://player.vimeo.com/video/<VIDEO_ID_GOES_HERE>player_id=player&title=0&byline=0&portrait=0&autoplay=1&api=1
Upvotes: -1