Video not working properly in the below mentioned code. What could be the problem for this?
MediaController mediaController = new MediaController(getBaseContext());
mediaController.setAnchorView(videoweb);
Uri video = Uri.parse("http://www.youtube.com/v/wwI2w2YHkCQ?fs=1");
videoweb.setMediaController(mediaController);
videoweb.setVideoURI(video);
videoweb.start();
Error:
Cannot play video
Sorry,this video cannot be played.
The link you have provided,
http://www.youtube.com/v/wwI2w2YHkCQ?fs=1, is for an HTML page. The URI to be provided forsetVideoURI()should be a media file such as MP4 or AVI.VideoView cannot parse a HTML page. It can only decode and play a video file or stream a video content (in this case the URI should point to the media file, such as
http://people.sc.fsu.edu/~jburkardt/data/mp4/cavity_flow_movie.mp4). See Stack Overflow question Using VideoView for streaming or progressive-download video.You should use a Webview for opening the YouTube link.