I have to play a video in my android app. The file is stored on a online file server
link is : http://view.vzaar.com/923037/video
I am unable to play this file using VideoView. I also tried to load this file into WebView but the WebView opens Web Browser and then the file starts playing.
Is there any way to play these kind of file directly into my app without downloading into device?
For your VideoView, the prpoblem is with setVideoPath
method. You need to use setVideoURI
instead to specify a streaming source:
VideoView mVideoView = (VideoView) findViewById(R.id.vdoTest);
mVideoView.setMediaController(new MediaController(this));
String viewSource ="http://view.vzaar.com/923037/video";
mVideoView.setVideoURI(Uri.parse(viewSource));
This should work, provided the video is encoded correctly: (AAC+H.264, baseline)