I have managed to play YouTube videos using YouTubePlayer. However, when I try to play live streams using YouTubePlayer, nothing happens. Is playing live streams supported by the API? If so, how do I do it?
Asked
Active
Viewed 6,809 times
1 Answers
1
There is no difference in playing normal YouTube videos and live videos.I was unable to play live videos on android version 4.1. however on version 4.2.2, live videos played successfully. Latest version of Official Youtube app must be installed in order to use API. Code:
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
}

SohailAziz
- 8,034
- 6
- 41
- 43
-
This worked for me until a week ago ..now i can't play any live videos while normal videos continue to play normally! Did anything changed on the API ? – FOliveira Sep 22 '14 at 13:41
-
Have you got the solution for youtube Live stream API (for live video)?? – Ramesh Bhati Apr 05 '18 at 07:10