Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to hide youtube logo in youtube player in android

I don't want to share youtube videos in my android application.But when i click youtube logo in youtube playe, the link goes to youtube website.

So, How can i hide youtube logo in youtube player.Please suggest some ideas...

Think is i don't want to share youtube videos


2 Answers

I don't know what kind of style you want, but you can use YouTube Player as Activity or Fragment or a View. So you can basically customise your player easily with new YouTubePlayer API. If you want some simple youtube player with fullscreen (no titlebar mode).

You can pick he chromeless style, it doesn't have any controls - it's only a rectangle that plays a video under programmatic control. You're free to implement your own controls UI outside the player and wire them up through the YouTubePlayer that you get back after initializing a YouTubePlayerView or YouTubePlayerFragment. Keep in mind that, as mentioned in the YouTubePlayerView JavaDoc, "it is not permitted to overlay the [player] view with other views while a video is playing"

Refer below links:

1] https://gist.github.com/TheFinestArtist/5545437

2]https://developers.google.com/youtube/android/player/reference/com/google/android/youtube/player/YouTubePlayer.PlayerStyle#Enums

like image 54
VVB Avatar answered Nov 02 '25 00:11

VVB


Try this way:

ViewGroup tmpVg = youTubeView;

int[] loopLv = new int[]{0,0,4,0,0,3,0,1};

for( int i = 0; i < loopLv.length; i++){
    if( i == loopLv.length-1 ){
        tmpVg.getChildAt(loopLv[i]).setVisibility( View.GONE );
    } else {
        tmpVg = (ViewGroup)tmpVg.getChildAt( loopLv[i] );
    }
}

your problem will be solved.

like image 43
David Avatar answered Nov 01 '25 22:11

David



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!