Skip to content

Commit

Permalink
Fix for video click
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Potts committed Jan 19, 2016
1 parent 20a7130 commit fd12247
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions src/js/plyr.js
Original file line number Diff line number Diff line change
Expand Up @@ -2320,22 +2320,6 @@

// Captions
_on(plyr.buttons.captions, 'click', _toggleCaptions);

// Click video
if (plyr.type === 'video' && config.click) {
_on(plyr.videoContainer, 'click', function() {
if (plyr.media.paused) {
_play();
}
else if (plyr.media.ended) {
_seek();
_play();
}
else {
_pause();
}
});
}
}

// Listen for media events
Expand Down Expand Up @@ -2372,6 +2356,22 @@
// Loading
_on(plyr.media, 'waiting canplay seeked', _checkLoading);

// Click video
if (plyr.type === 'video' && config.click) {
_on(plyr.videoContainer, 'click', function() {
if (plyr.media.paused) {
_play();
}
else if (plyr.media.ended) {
_seek();
_play();
}
else {
_pause();
}
});
}

// Proxy events to container
_on(plyr.media, config.events.join(' '), function(event) {
_triggerEvent(plyr.container, event.type);
Expand Down

0 comments on commit fd12247

Please sign in to comment.