Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Android Youtube API to play Live streams

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

like image 874
Issam Avatar asked May 03 '16 09:05

Issam


People also ask

How do I watch YouTube live on Android?

Any public event on Livestream can be viewed via the Livestream mobile app. This is available as a free download for both iOS devices in the App Store and Android devices in Google Play. You will need to log in to a Livestream account. If you don't have an account you can sign up for one directly from the app.

Can you use YouTube for live streaming?

Enable live streamingOn your phone or tablet, open the YouTube app. Go live. Starting your first live stream may take up to 24 hours. Once enabled, you can live stream instantly.

What is API in live streaming?

Overview. With Live Stream API, you can transcode live, linear video streams into a variety of formats. Live Stream API benefits broadcasters, production companies, businesses, and individuals looking to transform their live video content for use across a variety of user devices.


2 Answers

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

like image 143
user1313723 Avatar answered Nov 11 '22 19:11

user1313723


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.

like image 43
abielita Avatar answered Nov 11 '22 18:11

abielita