Streaming Youtube Videos

前端 未结 8 1332
太阳男子
太阳男子 2020-11-30 01:53

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

相关标签:
8条回答
  • 2020-11-30 02:20

    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
    }
    
    0 讨论(0)
  • 2020-11-30 02:21

    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....

    0 讨论(0)
  • 2020-11-30 02:28

    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

    0 讨论(0)
  • 2020-11-30 02:31

    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.

    0 讨论(0)
  • 2020-11-30 02:32

    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")));

    0 讨论(0)
  • 2020-11-30 02:42

    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.

    0 讨论(0)
提交回复
热议问题