360 / 180 VR Stereo Video Playlists

Stereo VR 360 / 180 videos in playlists

This example demonstrates of switching between 360 and 180 videos within a playlist in both 2D rendering and WebXR. While in WebXR the controlbar displays a next and previous button to control playlists. Set the projection to switch to on the playlist item.

For 180 videos a half sphere is created. The surrounding background can display a sky dome using the skyDomeURL config.

NOTE: For Quest headsets with native layers, an AR WebXR immersive mode is used. Therefore a skydome is required to hide the AR camera until VR mode can be used.
    <div class="flex w-full h-auto my-auto">
      <video class="video-js vjs-default-skin vjs-fluid " crossorigin="anonymous" controls="" id="playlists-stereo"></video>
  </div>
  <script type="text/javascript">
  	var player = videojs("playlists-stereo", {
    "plugins": {
        "vrvideo": {
            "projection": "360_TB",
            "scaleFullscreen": false,
            "scaleResize": false,
            "skyDomeURL": "../../images/front.jpg"
        }
    }
});

  
          const playlistPlugin = player.playlistPlugin(player, {});
          const PlaylistPluginClass = videojs.getPlugin('playlistPlugin');

        
          const videoList = [
    {
        "name": "Stereo 360",
        "projection": "360_TB",
        "sources": [
            {
                "src": "https://oculus-mp4.s3.amazonaws.com/immersive+video+8K+for+Oculus+Browser/everestvr_4.3k_30s_360_h264_crf23_binaural_CREDIT_JON_GRIFFITH_injected.mp4",
                "type": "video/mp4"
            }
        ]
    },
    {
        "name": "Stereo 180",
        "projection": "180_TB",
        "sources": [
            {
                "src": "https://oculus-mp4.s3.amazonaws.com/immersive+video+8K+for+Oculus+Browser/everestvr_6.2k_30s_180_TB_h264_crf27_CREDIT_JON_GRIFFITH-injected.mp4",
                "type": "video/mp4"
            }
        ]
    },
    {
        "name": "Stereo 360",
        "projection": "360_TB",
        "sources": [
            {
                "src": "https://oculus-mp4.s3.amazonaws.com/immersive+video+8K+for+Oculus+Browser/everestvr_4.3k_30s_360_h264_crf23_binaural_CREDIT_JON_GRIFFITH_injected.mp4",
                "type": "video/mp4"
            }
        ]
    }
];
          const playlist = PlaylistPluginClass.createPlaylistFrom(videoList);

          // Plugin methods
          playlistPlugin.loadPlaylist(playlist);
          player.playlistUi({playOnSelect: true});

          playlistPlugin.loadFirstItem();
          playlistPlugin.setAutoadvanceDelay(0);
  </script>