Fix for video click
This commit is contained in:
parent
20a71300a5
commit
fd12247a62
@ -2320,22 +2320,6 @@
|
|||||||
|
|
||||||
// Captions
|
// Captions
|
||||||
_on(plyr.buttons.captions, 'click', _toggleCaptions);
|
_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
|
// Listen for media events
|
||||||
@ -2372,6 +2356,22 @@
|
|||||||
// Loading
|
// Loading
|
||||||
_on(plyr.media, 'waiting canplay seeked', _checkLoading);
|
_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
|
// Proxy events to container
|
||||||
_on(plyr.media, config.events.join(' '), function(event) {
|
_on(plyr.media, config.events.join(' '), function(event) {
|
||||||
_triggerEvent(plyr.container, event.type);
|
_triggerEvent(plyr.container, event.type);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user