diff --git a/README.md b/README.md index 4c272424..cddbb6b6 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,7 @@ Maintenance Status: Stable - [Accessing THREE.js objects](#accessing-threejs-objects) - [Options](#options) - [`forceCardboard`](#forcecardboard) + - [`motionControls`](#motioncontrols) - [`projection`](#projection) - [`'360'`, `'Sphere'`, or `'equirectangular'`](#360-sphere-or-equirectangular) - [`'Cube'` or `'360_CUBE'`](#cube-or-360_cube) @@ -184,6 +185,11 @@ player.vr().rendeer; Force the cardboard button to display on all devices even if we don't think they support it. +### `motionControls` +> Type: `boolean`, default: `true on ios and andriod` + +Whether motion/gyro controls should be enabled. + ### `projection` > Type `string`, default: `'auto'` diff --git a/src/plugin.js b/src/plugin.js index a83b33b8..77622a20 100644 --- a/src/plugin.js +++ b/src/plugin.js @@ -508,11 +508,17 @@ class VR extends Plugin { if (!this.controls3d) { this.log('no HMD found Using Orbit & Orientation Controls'); - this.controls3d = new OrbitOrientationContols({ + const options = { camera: this.camera, canvas: this.renderedCanvas, orientation: videojs.browser.IS_IOS || videojs.browser.IS_ANDROID || false - }); + }; + + if (this.options_.motionControls === false) { + options.orientation = false; + } + + this.controls3d = new OrbitOrientationContols(options); this.canvasPlayerControls = new CanvasPlayerControls(this.player_, this.renderedCanvas); }