问题描述:

I am trying to hide the buttons in a Youtube video player (api). I used

player.setShowFullscreenButton(false)

this hides the fullscreen button successfully, but I did not find way to hide the control button -- that button can go to youtube application.

I tried using

player.setPlayerStyle(PlayerStyle.MINIMAL);

This hides all buttons, but also changes the progress bar, but I need the old progress bar.

Any help?

网友答案:

You can initiate the player as a "Chromeless" player. That should do it.

网友答案:

I only know this works with version 1.2.2 of Youtube player of the API. Hides YOUTUBE button only.

((ViewGroup)((ViewGroup)((ViewGroup)((ViewGroup)((ViewGroup)((ViewGroup)((ViewGroup)((ViewGroup)findViewById(R.id.YOUR_VIDEO_PLAYER_ID)).getChildAt(0)).getChildAt(0))
                .getChildAt(4)).getChildAt(0)).getChildAt(0)).getChildAt(3)).getChildAt(0)).getChildAt(1).setVisibility(View.GONE);
相关阅读:
Top