# StereoPlugin

API Documentation

Adds stereo view on mobile devices. Requires the Gyroscope plugin.

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

# Usage

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

The plugin uses the WakeLock API to prevent the display from dimming or shuting down. As of August 2020 this API is only available on Chrome and Edge, for others browsers you can install NoSleep.js (opens new window) (no further configuration is needed, just make it available in your page).

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

# Configuration

# lang

  • type: object
  • default:
lang: {
    stereo : 'Stereo view',
    stereoNotification : 'Click anywhere to exit stereo view.',
    pleaseRotate : ['Please rotate your device', '(or tap to continue)'],
}

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

# Buttons

This plugin adds buttons to the default navbar:

  • stereo allows to start the stereo view

If you use a custom navbar you will need to manually add the buttons to the list.