Merge pull request #1677 from ydylla/fix-scrubbing-chrome-android

Fix preview thumbnail scrubbing not working on mobile touch devices
This commit is contained in:
Sam Potts
2020-02-08 22:17:41 +00:00
committed by GitHub
2 changed files with 3 additions and 3 deletions

View File

@ -725,7 +725,7 @@ class Listeners {
});
// Hide thumbnail preview - on mouse click, mouse leave, and video play/seek. All four are required, e.g., for buffering
this.bind(elements.progress, 'mouseleave click', () => {
this.bind(elements.progress, 'mouseleave touchend click', () => {
const { previewThumbnails } = player;
if (previewThumbnails && previewThumbnails.loaded) {

View File

@ -239,8 +239,8 @@ class PreviewThumbnails {
}
startScrubbing(event) {
// Only act on left mouse button (0), or touch device (event.button is false)
if (event.button === false || event.button === 0) {
// Only act on left mouse button (0), or touch device (event.button does not exist or is false)
if (is.nullOrUndefined(event.button) || event.button === false || event.button === 0) {
this.mouseDown = true;
// Wait until media has a duration