Skip to content

Commit

Permalink
Allow passing in M3U8 or MPD as the QUERY_STRING
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Staunton-Lambert committed Aug 12, 2024
1 parent d131def commit 92f9182
Show file tree
Hide file tree
Showing 9 changed files with 72 additions and 0 deletions.
31 changes: 31 additions & 0 deletions examples/180-hls.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!doctype html>
<html>
<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">
</head>
<body>
<video width="640" height="300" id="videojs-vr-player" class="video-js vjs-default-skin" controls playsinline>
<source src="https://kevleyski.github.io/reckless_in_pyrmont/hls_fmp4_byterange/reckless_in_pyrmont.m3u8" type="application/vnd.apple.mpegurl">
</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 = '180_MONO';

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

<script src="examples.js"></script>

</body>
</html>
3 changes: 3 additions & 0 deletions examples/180-mono.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,8 @@
var vr = window.vr = player.vr({projection: '180_MONO', debug: true, forceCardboard: false});
}(window, window.videojs));
</script>

<script src="examples.js"></script>

</body>
</html>
3 changes: 3 additions & 0 deletions examples/180-tb.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,8 @@
var vr = window.vr = player.vr({projection: '180_TB', debug: true, forceCardboard: false});
}(window, window.videojs));
</script>

<script src="examples.js"></script>

</body>
</html>
3 changes: 3 additions & 0 deletions examples/180.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,8 @@
var vr = window.vr = player.vr({projection: '180', debug: true, forceCardboard: false});
}(window, window.videojs));
</script>

<script src="examples.js"></script>

</body>
</html>
3 changes: 3 additions & 0 deletions examples/360-cube.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,8 @@
var vr = window.vr = player.vr({projection: 'AUTO', debug: true, forceCardboard: false});
}(window, window.videojs));
</script>

<script src="examples.js"></script>

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

<script src="examples.js"></script>

</body>
</html>
3 changes: 3 additions & 0 deletions examples/360-two.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,8 @@
var vr = window.vr = player.vr({projection: 'AUTO', debug: true, forceCardboard: false});
}(window, window.videojs));
</script>

<script src="examples.js"></script>

</body>
</html>
3 changes: 3 additions & 0 deletions examples/360.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,8 @@
var vr = window.vr = player.vr({projection: 'AUTO', debug: true, forceCardboard: false});
}(window, window.videojs));
</script>

<script src="examples.js"></script>

</body>
</html>
20 changes: 20 additions & 0 deletions examples/examples.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/* eslint-disable */
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
});
}
}

0 comments on commit 92f9182

Please sign in to comment.