1
0
mirror of https://github.com/videojs/video.js.git synced 2025-02-04 11:43:27 +02:00

fix: cast TOUCH_ENABLED to boolean (#6943)

This needs to be cast before exporting so users
can confidently pass it into their videojs config
and not worry about videojs internals doing strict
equality checks against true/false.

Co-authored-by: Kevin Kipp <kkipp@cloudflare.com>
This commit is contained in:
Kevin Kipp 2020-11-16 13:46:21 -06:00 committed by GitHub
parent 3901ab0e72
commit dcce0e908d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -169,10 +169,10 @@ export const IS_WINDOWS = (/Windows/i).test(USER_AGENT);
* @const
* @type {Boolean}
*/
export const TOUCH_ENABLED = Dom.isReal() && (
export const TOUCH_ENABLED = Boolean(Dom.isReal() && (
'ontouchstart' in window ||
window.navigator.maxTouchPoints ||
window.DocumentTouch && window.document instanceof window.DocumentTouch);
window.DocumentTouch && window.document instanceof window.DocumentTouch));
/**
* Whether or not this device is an iPad.