Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable panner node for Android #5291

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/update-audio-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import {
AvatarAudioDefaults,
TargetAudioDefaults
} from "./components/audio-params";
import isMobile from "./utils/is-mobile";
import { isAndroid } from "./utils/detect-android";
import { isSafari } from "./utils/detect-safari";

const defaultSettingsForSourceType = Object.freeze(
Expand Down Expand Up @@ -38,6 +40,12 @@ 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. Disable only for Android phone
// because we haven't heard the problem on VR device so far.
// See #5057
const androidOverrides = isAndroid() && isMobile() ? { audioType: AudioType.Stereo } : {};
const safariOverrides = isSafari() ? { audioType: AudioType.Stereo } : {};
const settings = Object.assign(
{},
Expand All @@ -47,6 +55,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);
}