Last active
February 11, 2019 18:32
-
-
Save PierfrancescoSoffritti/9b7e79260647aec961e47a6095b3b90a to your computer and use it in GitHub Desktop.
How to customize the UI of an Android YouTube Player: https://medium.com/@soffritti.pierfrancesco/customize-android-youtube-players-ui-9f32da9e8505
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CustomUiController { | |
private boolean isPlaying = false; | |
CustomUiController(View customPlayerUI, YouTubePlayer youTubePlayer) { | |
playPauseButton = customPlayerUI.findViewById(R.id.play_pause_button); | |
playPauseButton.setOnClickListener( view -> { | |
if(isPlaying) youTubePlayer.pause(); | |
else youTubePlayer.play(); | |
isPlaying = !isPlaying; | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment