Skip to main content
The Stereo plugin adds a side-by-side VR stereo view for mobile devices. It requires the Gyroscope plugin and uses the WakeLock API to prevent the screen from dimming while active.

Installation

npm install @photo-sphere-viewer/stereo-plugin

Usage

Load both the Gyroscope plugin and the Stereo plugin. The stereo button is only shown when the gyroscope API is available.
import { Viewer } from '@photo-sphere-viewer/core';
import { GyroscopePlugin } from '@photo-sphere-viewer/gyroscope-plugin';
import { StereoPlugin } from '@photo-sphere-viewer/stereo-plugin';

const viewer = new Viewer({
    panorama: 'path/to/panorama.jpg',
    plugins: [
        GyroscopePlugin,
        StereoPlugin,
    ],
});
The Stereo plugin requires the Gyroscope plugin to be loaded alongside it.

Configuration

lang
object
Localization strings merged with the main viewer lang object.
lang: {
    stereo: 'Stereo view',
    stereoNotification: 'Click anywhere to exit stereo view.',
    pleaseRotate: 'Please rotate your device',
    tapToContinue: '(or tap to continue)',
}
This plugin adds one button to the default navbar:
  • stereo — activates stereo view
If you use a custom navbar, add 'stereo' to your navbar configuration manually. The button is only shown when the device gyroscope API is available.

Build docs developers (and LLMs) love