Skip to content

Commit

Permalink
VR180 monoscope/sterescope switcher
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Staunton-Lambert committed Jul 2, 2024
1 parent cdc2c32 commit a1ff459
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
19 changes: 19 additions & 0 deletions examples/180-mono.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,27 @@
<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">
<script>
function switchMonoStereoscope() {
let swappedURL = window.location.href;
if (swappedURL.indexOf("180.html") >= 0)
{
swappedURL = swappedURL.replace("180.html", "180-mono.html");
} else {
swappedURL = swappedURL.replace("180-mono.html", "180.html");
}
if (swappedURL.indexOf("360.html") >= 0)
{
swappedURL = swappedURL.replace("360.html", "360-mono.html");
} else {
swappedURL = swappedURL.replace("360-mono.html", "360.html");
}
window.location.href = swappedURL;
}
</script>
</head>
<body>
<a href="javascript:switchMonoStereoscope()">switch to stereoscopic</a>
<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>
Expand Down
19 changes: 19 additions & 0 deletions examples/180.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,27 @@
<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">
<script>
function switchMonoStereoscope() {
let swappedURL = window.location.href;
if (swappedURL.indexOf("180.html") >= 0)
{
swappedURL = swappedURL.replace("180.html", "180-mono.html");
} else {
swappedURL = swappedURL.replace("180-mono.html", "180.html");
}
if (swappedURL.indexOf("360.html") >= 0)
{
swappedURL = swappedURL.replace("360.html", "360-mono.html");
} else {
swappedURL = swappedURL.replace("360-mono.html", "360.html");
}
window.location.href = swappedURL;
}
</script>
</head>
<body>
<a href="javascript:switchMonoStereoscope()">switch to monoscopic</a>
<video width="640" height="640" id="videojs-vr-player" class="video-js vjs-default-skin" controls playsinline>
<source src="../samples/video_180.mp4" type="video/mp4">
</video>
Expand Down

0 comments on commit a1ff459

Please sign in to comment.