diff options
author | ydylla <ydylla@gmail.com> | 2020-02-08 18:59:09 +0100 |
---|---|---|
committer | ydylla <ydylla@gmail.com> | 2020-02-08 19:14:06 +0100 |
commit | 9075ea189a013f7c9ddc0a473d7efbd96ac557f8 (patch) | |
tree | 86f2dc778909fa77699a1ac553cd3cfb71705d6d /src/js | |
parent | 8b9521d5a5d34bf81c57e901286ac325da2c1fc0 (diff) | |
download | plyr-9075ea189a013f7c9ddc0a473d7efbd96ac557f8.tar.lz plyr-9075ea189a013f7c9ddc0a473d7efbd96ac557f8.tar.xz plyr-9075ea189a013f7c9ddc0a473d7efbd96ac557f8.zip |
fix scrubbing for chrome android & hide thumb preview on touchend
Chrome android sends TouchEvent which does not have a button property.
Diffstat (limited to 'src/js')
-rw-r--r-- | src/js/listeners.js | 2 | ||||
-rw-r--r-- | src/js/plugins/preview-thumbnails.js | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/js/listeners.js b/src/js/listeners.js index f68245e4..5b888a90 100644 --- a/src/js/listeners.js +++ b/src/js/listeners.js @@ -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) { diff --git a/src/js/plugins/preview-thumbnails.js b/src/js/plugins/preview-thumbnails.js index 44e6ace7..6cd09ef2 100644 --- a/src/js/plugins/preview-thumbnails.js +++ b/src/js/plugins/preview-thumbnails.js @@ -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 |