Skip to content

Commit

Permalink
KJSL: Adding XR Layers
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Staunton-Lambert committed Jun 20, 2024
1 parent 557cba5 commit cdc2c32
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 20 deletions.
28 changes: 16 additions & 12 deletions examples/180-mono.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,26 @@

var vr = window.vr = player.vr({projection: '180_MONO', debug: true, forceCardboard: false});

const videoElement = document.getElementById('videojs-vr-player');
const videoSourceParam = window.location.search.substring(1);

if (videoSourceParam) {

player.src({
type: 'application/dash+xml',
src: videoSourceParam
});
console.log("KJSL: opening " + videoSourceParam);
} else {
document.write('No video source provided in the query string e.g. add ?https://foo/manifest.mpd to the address above');
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>
19 changes: 19 additions & 0 deletions examples/180-tb.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,25 @@
player.mediainfo.projection = '180_TB';

var vr = window.vr = player.vr({projection: '180_TB', debug: true, forceCardboard: false});
const videoSourceParam = window.location.search.substring(1);
if (videoSourceParam) {
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>
Expand Down
8 changes: 2 additions & 6 deletions examples/180.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
var vr = window.vr = player.vr({projection: '180', debug: true, forceCardboard: false});

const videoSourceParam = window.location.search.substring(1);
if (videoSourceParam && videoSourceParam.startsWith("http")) {
if (videoSourceParam) {
if (videoSourceParam.indexOf(".mpd") !== -1) {
player.src({
type: 'application/dash+xml',
Expand All @@ -42,11 +42,7 @@
});
}
}
(window, window.videojs)
)
;


}(window, window.videojs));
</script>
</body>
</html>
5 changes: 3 additions & 2 deletions examples/360.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@

// 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) {
if (videoSourceParam.indexOf(".mpd") !== -1) {
player.src({
type: 'application/dash+xml',
Expand All @@ -47,3 +47,4 @@
</script>
</body>
</html>

0 comments on commit cdc2c32

Please sign in to comment.