PSV Cubemap Video Demo

by mistic100

HTML

<script src="https://cdn.jsdelivr.net/npm/uevent@2/browser.js"></script>
<script src="https://cdn.jsdelivr.net/npm/three/build/three.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/photo-sphere-viewer@4/dist/photo-sphere-viewer.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/photo-sphere-viewer@4/dist/photo-sphere-viewer.css">
<script src="https://cdn.jsdelivr.net/npm/photo-sphere-viewer@4/dist/adapters/cubemap-video.js"></script>
<script src="https://cdn.jsdelivr.net/npm/photo-sphere-viewer@4/dist/plugins/video.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/photo-sphere-viewer@4/dist/plugins/video.css">
<script src="https://cdn.jsdelivr.net/npm/photo-sphere-viewer@4/dist/plugins/settings.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/photo-sphere-viewer@4/dist/plugins/settings.css">
<script src="https://cdn.jsdelivr.net/npm/photo-sphere-viewer@4/dist/plugins/resolution.js"></script>
<div id="photosphere"></div>

CSS

html, body, #photosphere {
  margin: 0;
  width: 100%;
  height: 100%;
}

JavaScript

const base = 'https://photo-sphere-viewer-data.netlify.app/assets/cubemap-video/';

new PhotoSphereViewer.Viewer({
  container: 'photosphere',
  adapter   : [PhotoSphereViewer.CubemapVideoAdapter, {
    muted   : true,
  }],
  panorama  : { source: base + 'DreamOfDali_HD.webm' },
  caption: 'Dreams of Dalí <b>&copy; The Dalí Museum</b>',
  loadingImg: 'https://photo-sphere-viewer.js.org/assets/photosphere-logo.gif',
  touchmoveTwoFingers: true,
  mousewheelCtrlKey: true,
  navbar: 'video autorotate caption settings fullscreen',
  plugins   : [
    PhotoSphereViewer.VideoPlugin,
    PhotoSphereViewer.SettingsPlugin,
    [PhotoSphereViewer.ResolutionPlugin, {
      resolutions: [
        {
          id      : 'UHD',
          label   : 'Ultra high',
          panorama: { source: base + 'DreamOfDali_UHD.webm' },
        },
        {
          id      : 'FHD',
          label   : 'High',
          panorama: { source: base + 'DreamOfDali_FHD.webm' },
        },
        {
          id      : 'HD',
          label   : 'Standard',
          panorama: { source: base + 'DreamOfDali_HD.webm' },
        },
      ]
    }]
  ],
});