11

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 issues:

  • When the latest version of Youtube is installed on my device (Youtube 11.13.56), I get the following message : "There was a problem while playing, Tap to retry"

  • After removing youtube updates and going back to "youtube 10.18.55" version, everything works fine.

Any idea to handle this problem ?

Thanks for your help

Environment: Samsung Galaxy S4, Android 5.0.1, YouTubeAndroidPlayerApi-1.2.2

Paul
  • 13,042
  • 3
  • 41
  • 59
Issam
  • 113
  • 1
  • 6

2 Answers2

2

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.

Community
  • 1
  • 1
abielita
  • 13,147
  • 2
  • 17
  • 59
  • I am using the same source code, and I tried many video IDs: - When the ID is a live stream: it didn't work - When the ID is another video: it worked fine Also, when I downgrade my Youtube app, it works fine for both (live and simple videos) Maybe I am doing something wrong, but I really don't know exactly what. Any help you can give will be greatly appreciated. – Issam May 08 '16 at 21:16
2

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

user1313723
  • 126
  • 1
  • 8
  • Will the exact code that works for normal youtube videos now work for live streaming video ID? Please confirm. – Paras Jain Sep 24 '17 at 05:07