In my app I am trying to play a Vimeo video using VideoView but that seems out of scope right now and therefore I have decided to first try and get the youtube video work.
I added vitamio plugin and it seems to work fine with mp4 videos that I uploaded on my site over the both 3G and wifi connection however it does not work when I provide a rstp link of youtube to videoview and try to watch it over Wifi.
Do I have to use another technique to make the youtube video work over both WIFI and 3G? Do I need a special URL for it?
If someone also has suggestions on how I can use Vimeo video with Vitamio then that would also be great.
Here is the code I am using:
String SrcPath = "rtsp://v4.cache7.c.youtube.com/CjYLENy73wIaLQky7ThXrRjPYRMYDSANFEIJbXYtZ29vZ2xlSARSBXdhdGNoYKjR78WV1ZH5Tgw=/0/0/0/video.3gp"; //this doesnot work over WIFI
String SrcPath = "http://myURL.com/videoname.mp4"; //this works over 3G connection but failes on WIFI
try {
VideoView myVideoView = (VideoView)findViewById(R.id.myvideoview);
myVideoView.setVideoURI(Uri.parse(SrcPath));
myVideoView.setMediaController(new MediaController(this));
myVideoView.requestFocus();
myVideoView.start();
} catch (Exception e) {
Log.d("custom", "Unable to play video");
}