Using Android Youtube API to play Live streams

后端 未结 2 961
青春惊慌失措
青春惊慌失措 2020-12-28 09:26

I am developing an Android app that uses the Android Youtube API. I can successfully play any video from Youtube. However, when I try to play a live stream, I encounter some

相关标签:
2条回答
  • 2020-12-28 10:12

    It seems like YouTube fixed their SDK and live videos are now working again.

    0 讨论(0)
  • 2020-12-28 10:15

    Based from this thread, there is no difference in playing any videos from YouTube and playing a live stream. Latest version of YouTube app must also play live stream.

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);   
    
      YouTubePlayerView youTubeView = (YouTubePlayerView) findViewById(R.id.youtube_view);
      youTubeView.initialize(DEVELOPER_KEY, this);
    }
    @Override
    public void onInitializationSuccess(YouTubePlayer.Provider provider,
            YouTubePlayer player, boolean wasRestored) {
    
        player.loadVideo("UT86BH2LVUU"); //live vid
    
    }
    

    Make sure that you integrated broadcasts and streams properly based from this documentation. The stream provides the content that will be broadcast to YouTube users. Once created, a liveStream resource can be bound to one or more liveBroadcast resources.

    Here are examples using YouTube Live Streaming API.

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