# GyroscopePlugin

API Documentation

Adds gyroscope controls on mobile devices.

This plugin is available in the core photo-sphere-viewer package in dist/plugins/gyroscope.js.

# Usage

Once enabled the plugin will add a new "Gyroscope" button only shown when the gyroscope API is available.

const viewer = new PhotoSphereViewer.Viewer({
  plugins: [
    PhotoSphereViewer.GyroscopePlugin,
  ],
});

# Configuration

# absolutePosition

  • type: boolean
  • default: false

By default the camera will keep its current horizontal position when the gyroscope is enabled. Turn this option true to enable absolute positionning and only use the device orientation.

# lang

  • type: object
  • default:
lang: {
    gyroscope : 'Gyroscope',
}

Note: this option is not part of the plugin but is merged with the main lang object.