Skip to content

Commit

Permalink
Merge pull request #25 from onero/development
Browse files Browse the repository at this point in the history
Release 5 update
  • Loading branch information
onero committed May 24, 2018
2 parents bc46d0c + bd1125d commit 6599a23
Showing 1 changed file with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,13 @@ private void setExerciseInformation(Exercise exercise) {
* @param wasRestored
*/
@Override
public void onInitializationSuccess(YouTubePlayer.Provider provider, YouTubePlayer youTubePlayer, boolean wasRestored) {
public void onInitializationSuccess(YouTubePlayer.Provider provider,
YouTubePlayer youTubePlayer, boolean wasRestored) {

youTubePlayer.setPlayerStateChangeListener(mPlayerStateChangeListener);
// Makes it possible for user interactions such as play/pause the video.
youTubePlayer.setPlaybackEventListener(mPlaybackEventListener);
// Makes sure that the video is loaded, started, ended and if error.
youTubePlayer.setPlayerStateChangeListener(mPlayerStateChangeListener);

// Start buffering.
if (!wasRestored) {
Expand All @@ -108,6 +111,10 @@ public void onInitializationFailure(YouTubePlayer.Provider provider, YouTubeInit
Toast.makeText(this, "FAILED TO INITIALIZE", Toast.LENGTH_SHORT).show();
}





// Interface definition for callbacks that are invoked when video playback events occur.
private YouTubePlayer.PlaybackEventListener mPlaybackEventListener = new YouTubePlayer.PlaybackEventListener() {
@Override
Expand Down Expand Up @@ -155,12 +162,12 @@ public void onAdStarted() {

@Override
public void onVideoStarted() {
// Called when the video reaches its end.
// Called when playback of the video starts.
}

@Override
public void onVideoEnded() {
// Called when playback of the video starts.
// Called when the video reaches its end.
}

@Override
Expand Down

0 comments on commit 6599a23

Please sign in to comment.