From b91ab952f7b9b20eeba0d4e3e9150cafc8d40bf9 Mon Sep 17 00:00:00 2001 From: KabanFriends Date: Tue, 9 Jan 2024 11:06:48 +0900 Subject: [PATCH] detect edge --- public/js/player.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/public/js/player.js b/public/js/player.js index 6d08b9f..cae988a 100644 --- a/public/js/player.js +++ b/public/js/player.js @@ -1,5 +1,3 @@ -const mobile = new MobileDetect(window.navigator.userAgent); - let player; function start(name) { @@ -18,8 +16,8 @@ function start(name) { unmuteOverlay: "hidden", }; - if (mobile.is("AndroidOS") && !!window.chrome) { - console.log("Set preferred renderer to WebGL as the client uses Chrome on Android (https://bugs.chromium.org/p/chromium/issues/detail?id=1510149)") + if (navigator.userAgent && /Android/.test(navigator.userAgent) && /Edg/.test(navigator.userAgent)) { + console.log("Set preferred renderer to WebGL due to a bug on Chromium Android. See: https://bugs.chromium.org/p/chromium/issues/detail?id=1510149") player.config.preferredRenderer = "webgl"; }