Skip to content

Instantly share code, notes, and snippets.

@PierfrancescoSoffritti
Last active February 11, 2019 18:32
Show Gist options
  • Save PierfrancescoSoffritti/9b7e79260647aec961e47a6095b3b90a to your computer and use it in GitHub Desktop.
Save PierfrancescoSoffritti/9b7e79260647aec961e47a6095b3b90a to your computer and use it in GitHub Desktop.
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