Streaming Youtube Videos

前端 未结 8 1333
太阳男子
太阳男子 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:45

    Sometimes Uri.parse return "null" because cant parse an rtsp protocol instead of http protocol.

    Look it with an Log in logcat Uri.parse(rtspURL).toString() and you will see nothing written. or only make Log.d("tag", Uri.parse); and the same will be return.

    Try to find another way to parse (create) an Uri.

    I'd try with that and run:

    String urlVideo = <your rtspURL>
    VideoView video = (VideoView)findViewById(R.id.VideoView01);
    Log.d(tag , urlVideo);
    video.setVideoURI(Uri.parse(urlVideo));
    MediaController mc = new MediaController(this);
    video.setMediaController(mc);
    video.requestFocus();
    video.start();
    mc.show();
    
    0 讨论(0)
  • 2020-11-30 02:45

    do you have the access to the internet? if not, please add the Internet permission to the manifest file

     <uses-permission android:name="android.permission.INTERNET" />
    

    and also please try these URIs:

    rtsp://184.72.239.149/vod/mp4:BigBuckBunny_175k.mov
    
    http://www.wowza.com/_h264/BigBuckBunny_175k.mov
    
    0 讨论(0)
提交回复
热议问题