Skip to content

Commit

Permalink
Disable panner node for Android
Browse files Browse the repository at this point in the history
Currently Android seems to have a panner node audio problem.
We already reported it. Until it will be resolved, we force
to disable it as short-term workaround.
  • Loading branch information
takahirox committed Mar 24, 2022
1 parent 6d39ba0 commit 3e9f592
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/update-audio-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
AvatarAudioDefaults,
TargetAudioDefaults
} from "./components/audio-params";
import { isAndroid } from "./utils/detect-android";
import { isSafari } from "./utils/detect-safari";

const defaultSettingsForSourceType = Object.freeze(
Expand Down Expand Up @@ -38,6 +39,10 @@ export function getCurrentAudioSettings(el) {
const preferencesOverrides = APP.store.state.preferences.disableLeftRightPanning
? { audioType: AudioType.Stereo }
: {};
// Android has PannerNode audio problem. We already reported it.
// Until it will be fixed, we force to disable panner audio
// as short-term workaround. See #5057
const androidOverrides = isAndroid() ? { audioType: AudioType.Stereo } : {};
const safariOverrides = isSafari() ? { audioType: AudioType.Stereo } : {};
const settings = Object.assign(
{},
Expand All @@ -47,6 +52,7 @@ export function getCurrentAudioSettings(el) {
audioDebugPanelOverrides,
zoneSettings,
preferencesOverrides,
androidOverrides,
safariOverrides
);

Expand Down
6 changes: 6 additions & 0 deletions src/utils/detect-android.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { detect } from "detect-browser";

export function isAndroid() {
const browser = detect();
return ["Android OS"].includes(browser.os);
}

0 comments on commit 3e9f592

Please sign in to comment.