Skip to content

Commit

Permalink
Merge branch 'master' into readme
Browse files Browse the repository at this point in the history
  • Loading branch information
divayprakash committed Apr 17, 2016
2 parents 5d54e91 + d1c691f commit f09d262
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions js/everything.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ var errorMessage = {
$("#zen-video-error").text("ERROR: " + message);
$("#zen-video-error").show();

// Pause if we got an error
ZenPlayer.pause();

// When the error message is shown, also hide the player
ZenPlayer.hide();

Expand Down Expand Up @@ -216,6 +219,12 @@ var ZenPlayer = {
$("#pause").show();
$("#play").hide();
},
play: function() {
player.playVideo();
},
pause: function() {
player.pauseVideo();
},
showPlayButton: function() {
$("#play").show();
$("#pause").hide();
Expand All @@ -239,15 +248,16 @@ var ZenPlayer = {
});
},
setupMediaControls: function() {
var that = this;
// play/pause button click event
$("#playPause").click(function(event) {
event.preventDefault();

if ($("#play").is(":visible")) {
player.playVideo();
that.play();
}
else {
player.pauseVideo();
that.pause();
}
});

Expand Down

0 comments on commit f09d262

Please sign in to comment.