demos/device-orientation/DeviceOrientationControlMethod.js
function DeviceOrientationControlMethod() {
  this._dynamics = {
    yaw: new Marzipano.Dynamics(),
    pitch: new Marzipano.Dynamics()
  };

  this._deviceOrientationHandler = this._handleData.bind(this);

  if (window.DeviceOrientationEvent) {
    window.addEventListener('deviceorientation', this._deviceOrientationHandler);
  }

  this._previous = {};
  this._current = {};
  this._tmp = {};

  this._getPitchCallbacks = [];
}
function DeviceOrientationControlMethod() {
  this._dynamics = {
    yaw: new Marzipano.Dynamics(),
    pitch: new Marzipano.Dynamics()
  };

  this._deviceOrientationHandler = this._handleData.bind(this);

  if (window.DeviceOrientationEvent) {
    window.addEventListener('deviceorientation', this._deviceOrientationHandler);
  }

  this._previous = {};
  this._current = {};
  this._tmp = {};

  this._getPitchCallbacks = [];
}
function DeviceOrientationControlMethod ( ) { this . _dynamics = { yaw : new Marzipano . Dynamics ( ) , pitch : new Marzipano . Dynamics ( ) } ; this . _deviceOrientationHandler = this . _handleData . bind ( this ) ; if ( window . DeviceOrientationEvent ) { window . addEventListener ( 'deviceorientation' , this . _deviceOrientationHandler ) ; } this . _previous = { } ; this . _current = { } ; this . _tmp = { } ; this . _getPitchCallbacks = [ ] ; }
Custom control method to alter the view according to the device orientation.
Custom control method to alter the view according to the device orientation .