I am writing an application to play youtube videos using streaming.
First method:
I am getting the RTSP URL to the video using GData APIs. Here is the code t
I've displayed YouTube videos with the following code. I hope its useful, but let me know how it might be improved.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
startActivity(new Intent(Intent.ACTION_VIEW,
Uri.parse("http://www.youtube.com/watch?v=...")));
}
public void onPrepared(MediaPlayer mp) {
// TODO Auto-generated method stub
}
we faced a very similar problem.
At the moment I'm at the first step of my project and I'm trying to make the videoview simply works. I'm taking data from here: http://gdata.youtube.com/demo/ and I'm testing all the videos links.
RTSP 3GP videos are really really really low quality video.... and there is no way to access to mp4 (good quality) videos. I really don't know how to make it works because I think that MP4 streams are available only to premium devs....
Throw eye over Youtube API
I think this also use youtube app(Which you don't want)
But just refer may be you will find some key to solve it
The header on the video indicates it does work for Android. So, try a good video link to experiment with. Here is one that I use:
rtsp://184.72.239.149/vod/mp4:BigBuckBunny_115k.mov
I works great on Nexus and Samsung tablets.
If you're willing to do the work in a new activity, the following will work on a device but not on the emulator:
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.youtube.com/watch?v=cxLG2wtE7TM")));
I'm impressed that the dirty way works at all! If you've got a working solution, go with it. I don't think there's a clean way to get RTSP streaming working in the SDK yet.