Pruthvi
Pruthvi

Reputation: 590

Disabling the youtube icon on the YouTubeStandalonePlayer in android?

I just wanted to know how to disable the youtube icon that comes in the YouTubeStandalonePlayer. Is it possible? I don't want to take the user to youtube on clicking the icon. Is there any way to disable the youtube icon?

The below is the code how I am playing the the video using the YouTubeStandalonePlayer.

String videoId = getVideoId(cardsInfo.getCard_video_url());
Intent intent = YouTubeStandalonePlayer.createVideoIntent(getActivity(), getResources().getString(R.string.android_key), videoId, 0, true, false);
startActivity(intent);

Upvotes: 3

Views: 880

Answers (1)

Sean
Sean

Reputation: 5256

According to the API, you can't.

But, you can try and use the other (not standalone) classes, which might give you better control as suggested in the docs: There are two ways to play videos. The first option is to place a YouTubePlayerFragment or YouTubePlayerView in your View hierarchy and then use the YouTubePlayer to control video playback in the View. **This gives a fine control of the experience**. If they don't let it, you could atleast have better control of the flow/UI-visibility because you are controling the Activity (in contrast of giving the control to the standalone activity)

Upvotes: 1

Related Questions