From f32085a1dd45ce8c6efebea5aa05062e00131d69 Mon Sep 17 00:00:00 2001 From: mister-ben Date: Wed, 20 Dec 2023 17:29:49 +0100 Subject: [PATCH] Use three.js's button only --- src/plugin.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/plugin.js b/src/plugin.js index e7e58d3..09bc6a9 100644 --- a/src/plugin.js +++ b/src/plugin.js @@ -806,7 +806,7 @@ void main() { if (supportsImmersiveVR) { // We support WebXR show the enter VRButton this.vrButton = VRButton.createButton(this.renderer); - document.body.appendChild(this.vrButton); + this.player_.el_.appendChild(this.vrButton); this.initImmersiveVR(); this.initXRPolyfill(displays); @@ -1247,9 +1247,10 @@ void main() { } addCardboardButton_() { - if (!this.player_.controlBar.getChild('CardboardButton')) { - this.player_.controlBar.addChild('CardboardButton', {}); - } + // Not using the cardboard button in favour of three.js's vrbutton. + // if (!this.player_.controlBar.getChild('CardboardButton')) { + // this.player_.controlBar.addChild('CardboardButton', {}); + // } } getVideoEl_() {