Photo Sphere Viewer is a JavaScript library that allows you to display 360-degree panoramas taken with Photo Sphere, the camera mode brought by Android 4.2 Jelly Bean.
Photo Sphere Viewer uses the Three.js library (http://threejs.org), so nothing is required for your visitors except for a browser compatible with canvas or, better, WebGL.
- Include the
three.min.js
andphoto-sphere-viewer.js
files into your page. - Create a
div
in the size you want for your panorama. - In JavaScript, create a new
PhotoSphereViewer
object. You must pass it an object containing at least two parameters for the panorama:- panorama (required): the path to the panorama,
- container (required): the
div
in which the panorama will be displayed, - time_anim (optional, default to 2000): the panorama will be automatically animated after time_anim milliseconds ; indicate -1 to deactivate it,
- theta_offset (optional, default to 1440): the horizontal speed during the automatic animation ; we add PI / theta_offset to the angle,
- loading_img (optional, default to null): the path to the image shown during the loading.
This library is available under the MIT license.