Photo Sphere Viewer API

website·Indexed 29 days ago

https://photo-sphere-viewer.netlify.app/

API documentation for Photo Sphere Viewer, featuring core constants, type aliases, and event classes for plugins including VirtualTour, Video, Markers, Plan, Resolution, Stereo, Gyroscope, and Settings.

Tokens
91.4K
Snippets
616
Records
871
Agent score
75%

What's inside Photo Sphere Viewer

  1. Overview of AutorotatePlugin

    The AutorotatePlugin adds automatic rotation to a panorama. Rotation can be triggered automatically when the user is idle or manually via a navbar button. It supports rotating at a specific pitch and zoom level, and can be configured to visit a sequence of specific keypoints.
    npm install @photo-sphere-viewer/autorotate-plugin
  2. Install and use the Photo Sphere Viewer VideoPlugin

    The VideoPlugin allows for video integration within Photo Sphere Viewer. It is distributed as a separate NPM package and provides functionality for managing video playback and keypoints within a panoramic view.
    npm install @photo-sphere-viewer/video-plugin
  3. Handle node changes in VirtualTourPlugin using NodeChangedEvent

    The NodeChangedEvent is triggered whenever the current node in a virtual tour changes. It provides details about the new node and the transition from the previous node.
    // Example of listening for the node-changed event
    virtualTourPlugin.addEventListener('node-changed', (event) => {
        const nodeChangedEvent = event as NodeChangedEvent;
        console.log('New node:', nodeChangedEvent.node);
        console.log('Transition data:', nodeChangedEvent.data);
    });
  4. Supported panorama formats in Photo Sphere Viewer

    Photo Sphere Viewer supports two primary types of panoramic imagery: standard equirectangular panoramas and cubemaps.
  5. Understand and select a panorama adapter for Photo Sphere Viewer

    Adapters are components responsible for loading panorama textures into the Three.js scene. Depending on the source format of your panorama, you must choose the appropriate adapter:

    • equirectangular: Default adapter for full or partial equirectangular panoramas.
    • equirectangular tiles: For tiled equirectangular panoramas.
    • equirectangular video: For equirectangular videos.
    • cubemap: For cubemap projections consisting of six textures.
    • cubemap tiles: For tiled cubemap panoramas.
    • cubemap video: For cubemap videos.
    • dual fisheye: For raw files from 360 cameras (e.g., Ricoh Theta, Insta360), supporting both stills and videos.