diff --git a/examples/js/controls/DeviceOrientationControls.js b/examples/js/controls/DeviceOrientationControls.js index e0623a9c9d428327e0a6e201be17cd050b45ff3f..0d1be0349f650d0f610c55fd1c9e272a26e0fa76 100644 --- a/examples/js/controls/DeviceOrientationControls.js +++ b/examples/js/controls/DeviceOrientationControls.js @@ -4,6 +4,12 @@ THREE.DeviceOrientationControls = function ( object ) { + if ( window.isSecureContext === false ) { + + console.error( 'THREE.DeviceOrientationControls: DeviceOrientationEvent is only available in secure contexts (https)' ); + + } + var scope = this; var changeEvent = { type: 'change' }; var EPS = 0.000001; diff --git a/examples/jsm/controls/DeviceOrientationControls.js b/examples/jsm/controls/DeviceOrientationControls.js index f7c716647fbbde1a2b9277013e8ebcd71d285d9e..64236d0a3f9d24e22933a6ce760c92b244af020d 100644 --- a/examples/jsm/controls/DeviceOrientationControls.js +++ b/examples/jsm/controls/DeviceOrientationControls.js @@ -12,6 +12,12 @@ import { var DeviceOrientationControls = function ( object ) { + if ( window.isSecureContext === false ) { + + console.error( 'THREE.DeviceOrientationControls: DeviceOrientationEvent is only available in secure contexts (https)' ); + + } + var scope = this; var changeEvent = { type: 'change' }; var EPS = 0.000001;