Created
November 7, 2023 17:04
-
-
Save nanocosmos-ol/8e4b93e9730386ce9ae9b1cb09d9f86e to your computer and use it in GitHub Desktop.
Video.js fullscreen 360 video
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="player-wrapper"> | |
<video id="player" class="player video-js vjs-default-skin vjs-big-play-centered" crossorigin="anonymous" preload="metadata" autoplay controls> | |
<source poster="https://raw.githubusercontent.com/Pierrinho/elephant/master/elephant.jpg" src="https://raw.githubusercontent.com/Pierrinho/elephant/master/elephant.mp4"> | |
</video> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var options = { | |
plugins: { | |
panorama: { | |
clickAndDrag: true, | |
clickToToggle: true, | |
autoMobileOrientation: true, | |
backToVerticalCenter: false, | |
backToHorizonCenter: false | |
} | |
} | |
}; | |
var player = videojs('player', options, function() { | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="https://vjs.zencdn.net/5.10.4/video.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r76/three.js"></script> | |
<script src="https://rawgit.com/yanwsh/videojs-panorama/master/dist/videojs-panorama.v5.js"></script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.player-wrapper { | |
position: relative; | |
width: 100%; | |
height: 100vh; | |
.player { | |
position: absolute; | |
top: 0; | |
left: 0; | |
height: 100%; | |
width: 100%; | |
} | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link href="https://vjs.zencdn.net/5.10.4/video-js.css" rel="stylesheet" /> | |
<link href="https://cdn.rawgit.com/yanwsh/videojs-panorama/master/dist/videojs-panorama.css" rel="stylesheet" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment