Streaming Youtube Videos

前端 未结 8 1375
太阳男子
太阳男子 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 = 
    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();
    

提交回复
热议问题