开发者

Streaming from a YouTube (live) channel [closed]

开发者 https://www.devze.com 2023-03-31 10:03 出处:网络
This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time,or an extraordinarily narrow situation that is not generally applic
This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 10 years ago.

I want to stream a live channel from YouTube into my app. See an example of a live channel here: http://www.youtube.com/watch?v=oObdPuriO2w

I don't want to use Intent and the YouTube app in the device. I don't want to depend on it. I read about streaming on Stack Overflow, but I got confused!

  1. Do I use WebView or VideoView or MediaPlayer or what?
  2. I read something about RTSP. What is it? Do I need to use it?
  3. What are the clear ste开发者_高级运维ps of what I need to implement?

To those who might be interested:

I couldn't find a solution to my problem. So, I gave up on that project!


Just follow this code...

WebView video = (WebView)findViewById(R.id.video);

video.getSettings().setJavaScriptEnabled(true);
video.getSettings().setPluginsEnabled(true);
video.loadUrl("http://www.youtube.com/watch?v=oObdPuriO2w");

Note: To stream video on your device, flashplayer must be updated.


About the intents opening, I think that one of the following lines might help avoiding it:

 webView.addJavascriptInterface(new JavascriptInterface()
    webView.setWebChromeClient(new WebChromeClient());
    webView.setWebViewClient(new WebViewClient()
      {
      @Override
      public boolean shouldOverrideUrlLoading(...)
        {
        view.loadUrl(url);
        return true;
        }
      }

...

0

精彩评论

暂无评论...
验证码 换一张
取 消