This pattern currently is not fully supported by all browsers so it should be used for non-critical purposes only. It will degrade to a static image for those browsers that do not support the 360° scrolling.
A photosphere is used to showcase a 360° image using Google VR view. This is done via a JavaScript API to manipulate the contents of an <iframe>.
A link to the following file is required for a photosphere to work. Put the code at the bottom of the body section.
Use the following code to ensure that the photosphere is responsive and work on all sizes of devices:
Add the following code to the page and amend the following parameters:
<div> where the photosphere will be displayed, change this to match the Photosphere-ID you specified in the HTML.path/to/IMAGE/ with the desired URL.window.addEventListener('load', onVrViewLoad)
function onVrViewLoad() {
var vrView = new VRView.Player('#Photosphere-ID', {
image: 'path/to/IMAGE/'
});
}