Skip to content

Commit

Permalink
KJSL: separate params not needed
Browse files Browse the repository at this point in the history
  • Loading branch information
kevleyski committed Jun 19, 2024
1 parent 8680985 commit d5f1336
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 19 deletions.
1 change: 1 addition & 0 deletions examples/180-mono.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
</head>
<body>
<video width="640" height="640" id="videojs-vr-player" class="video-js vjs-default-skin" controls playsinline>
<source src="../samples/video_180_lefteyeonly.mp4" type="video/mp4">
</video>
<ul>
<li><a href="../">return to main example</a></li>
Expand Down
58 changes: 39 additions & 19 deletions examples/360.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,47 @@
<head>
<meta charset="utf-8">
<title>videojs-vr Demo</title>
<link href="../node_modules/video.js/dist/video-js.css" rel="stylesheet">
<link href="../dist/videojs-vr.css" rel="stylesheet">
<link href="../node_modules/video.js/dist/video-js.css" rel="stylesheet">
<link href="../dist/videojs-vr.css" rel="stylesheet">
</head>
<body>
<video width="640" height="640" id="videojs-vr-player" class="video-js vjs-default-skin" controls playsinline>
<source src="../samples/eagle-360.mp4" type="video/mp4">
</video>
<ul>
<li><a href="../">return to main example</a></li>
</ul>
<script src="../node_modules/video.js/dist/video.js"></script>
<script src="../dist/videojs-vr.js"></script>
<script>
(function(window, videojs) {
var player = window.player = videojs('videojs-vr-player');
player.mediainfo = player.mediainfo || {};
player.mediainfo.projection = '360';
<video width="640" height="640" id="videojs-vr-player" class="video-js vjs-default-skin" controls playsinline>
<source src="../samples/eagle-360.mp4" type="video/mp4">
</video>
<ul>
<li><a href="../">return to main example</a></li>
</ul>
<script src="../node_modules/video.js/dist/video.js"></script>
<script src="../dist/videojs-vr.js"></script>
<script>
(function (window, videojs) {
var player = window.player = videojs('videojs-vr-player');
player.mediainfo = player.mediainfo || {};
player.mediainfo.projection = '360';

// AUTO is the default and looks at mediainfo
var vr = window.vr = player.vr({projection: 'AUTO', debug: true, forceCardboard: false});
}(window, window.videojs));
</script>
// AUTO is the default and looks at mediainfo
var vr = window.vr = player.vr({projection: 'AUTO', debug: true, forceCardboard: false});

const videoSourceParam = window.location.search.substring(1);
if (videoSourceParam && videoSourceParam.startsWith("http")) {
if (videoSourceParam.indexOf(".mpd") !== -1) {
player.src({
type: 'application/dash+xml',
src: videoSourceParam
});
} else if (videoSourceParam.indexOf(".m3u8") !== -1) {
player.src({
type: 'application/vnd.apple.mpegurl',
src: videoSourceParam
});
} else {
player.src({
type: 'video/mp4',
src: videoSourceParam
});
}
}
}(window, window.videojs));
</script>
</body>
</html>

0 comments on commit d5f1336

Please sign in to comment.