Skip to content
Pierfrancesco Soffritti edited this page Jun 30, 2018 · 5 revisions

The documentation has been moved in the readme of the project. This wiki is outdated.


You can use these methods to control the menu's behavior:

PlayerUIController.showMenuButton(boolean show);
PlayerUIController.setMenuButtonClickListener(@NonNull View.OnClickListener customMenuButtonClickListener);

By default the menu icon is not visible.

The default OnClickListener shows the default menu.

YouTubePlayerMenu

Internally the menu is represented by a YouTubePlayerMenu. You can see its contract here.

You can get a reference of the YouTubePlayerMenu from the PlayerUIController, using the method PlayerUIController.getMenu().

You can add your own implementation of YouTubePlayerMenu using PlayerUIController.setMenu(YouTubePlayerMenu youTubePlayerMenu).

DefaultYouTubePlayerMenu

The default implementation of YouTubePlayerMenu (provided by the library) shows a popup window when its show() method is called. The popup window contains a list of MenuItems. You can see the default implementation here.

Unless you want to provide a different UX to your users you can safely use the default implementation of YouTubePlayerMenu.

Initially the menu doesn't contain any MenuItem. You need to add them, using the method YouTubePlayerMenu.addItem(MenuItem menuItem).

MenuItem

MenuItems are the entries in the YouTubePlayerMenu. They are POJOs with a String of text, an icon and an OnClickListener. Here is the implementation.

Clone this wiki locally