1
0
mirror of https://github.com/videojs/video.js.git synced 2025-01-02 06:32:07 +02:00

bugfix: fix window.navigator.userAgentData may be '{}' (#8474)

This commit is contained in:
JJ 2023-10-24 16:03:50 +08:00 committed by GitHub
parent f7b1e3d03d
commit d535e163da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -154,7 +154,7 @@ export const TOUCH_ENABLED = Boolean(Dom.isReal() && (
const UAD = window.navigator && window.navigator.userAgentData;
if (UAD) {
if (UAD && UAD.platform && UAD.brands) {
// If userAgentData is present, use it instead of userAgent to avoid warnings
// Currently only implemented on Chromium
// userAgentData does not expose Android version, so ANDROID_VERSION remains `null`