Skip to content

Commit

Permalink
detect edge
Browse files Browse the repository at this point in the history
  • Loading branch information
KabanFriends committed Jan 9, 2024
1 parent 6a9255a commit b91ab95
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions public/js/player.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
const mobile = new MobileDetect(window.navigator.userAgent);

let player;

function start(name) {
Expand All @@ -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";
}

Expand Down

0 comments on commit b91ab95

Please sign in to comment.