Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding WebXR Layers #288

Open
wants to merge 80 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
d742fd1
Updating node-sass version (to remove python2 dependency)
Dec 2, 2022
d3fba93
Husky update
Dec 2, 2022
139f797
[KJSL] Swap webvr ro webxr polyfill packages
Dec 5, 2022
a46b98d
Example of having both polyfills - rewritting plugin.js to use the ne…
kevleyski Dec 5, 2022
dc28b05
[KJSL] Swap webvr ro webxr polyfill packages
Dec 6, 2022
f41dc2a
Merge pull request #1 from kevleyski/main
kevleyski Dec 6, 2022
dbc1073
[KJSL] Swap webvr ro webxr polyfill packages
Dec 6, 2022
cd30806
[KJSL] Swap webvr ro webxr polyfill packages
Dec 6, 2022
eecdbba
Merge pull request #2 from kevleyski/main
kevleyski Dec 6, 2022
d6821ab
[KJSL] Swap webvr ro webxr polyfill packages
Dec 7, 2022
842abed
Merge pull request #3 from kevleyski/main
kevleyski Dec 7, 2022
6de443d
[KJSL] Swap webvr ro webxr polyfill packages
Dec 7, 2022
b318d28
[KJSL] Swap webvr ro webxr polyfill packages
Dec 7, 2022
6d4ff0a
[KJSL] Swap webvr ro webxr polyfill packages
Dec 11, 2022
e02ce1d
Merge pull request #4 from kevleyski/main
kevleyski Dec 11, 2022
70a1611
chore: Swap webvr ro webxr polyfill packages
Dec 11, 2022
e0d1c48
Merge pull request #5 from kevleyski/main
kevleyski Dec 11, 2022
36e7cdc
chore: Swap webvr ro webxr polyfill packages (continue to use webvr p…
Dec 12, 2022
c8330f7
Merge pull request #6 from kevleyski/main
kevleyski Dec 12, 2022
56ad5f3
chore: Swap webvr ro webxr polyfill packages (adding basic controller…
Dec 14, 2022
a8d1459
Merge pull request #7 from kevleyski/main
kevleyski Dec 14, 2022
856a183
chore: Swap webvr ro webxr polyfill packages (add iOS permission chec…
Dec 20, 2022
8d88ec5
Merge pull request #8 from kevleyski/main
kevleyski Dec 20, 2022
7c0c62b
chore: Swap webvr ro webxr polyfill packages (add iOS permission chec…
Dec 20, 2022
46c7207
Merge pull request #9 from kevleyski/main
kevleyski Dec 20, 2022
7bf68a5
Update src/big-vr-play-button.js
kevleyski Dec 20, 2022
1cc47ef
Update src/plugin.js
kevleyski Dec 20, 2022
13d2b02
Merge pull request #1 from MetaCDN/main
kevleyski Dec 20, 2022
2603836
chore: Swap webvr for webxr polyfill packages (PR fix ups)
Dec 20, 2022
ff858af
chore: Swap webvr for webxr polyfill packages (PR fix ups)
Dec 20, 2022
80f9e0c
chore: Swap webvr for webxr polyfill packages (PR fix ups - part reve…
Dec 20, 2022
448eb88
chore: Swap webvr for webxr polyfill packages (PR fix ups - only show…
Dec 21, 2022
cf6277d
chore: Swap webvr for webxr polyfill packages (PR fix ups - clicking …
Dec 21, 2022
07c7f54
chore: Swap webvr for webxr polyfill packages (PR fix ups - clicking …
Dec 21, 2022
35ed850
chore: Swap webvr for webxr polyfill packages (PR fix ups - testing o…
Dec 23, 2022
9ce1f15
chore: Swap webvr for webxr polyfill packages (PR fix ups - testing o…
Jan 24, 2023
a6528ac
chore: Swap webvr for webxr polyfill packages (PR fix ups - adding 18…
Jan 25, 2023
91cfea0
chore: Swap webvr for webxr polyfill packages (PR fix ups - adding 18…
Jan 25, 2023
dc23443
chore: Swap webvr for webxr polyfill packages (PR fix ups - deprecate…
Jan 25, 2023
62c45b4
three version up
kevleyski Jan 27, 2023
0e1c4a1
three version up
kevleyski Jan 27, 2023
3261832
(three.js version)
kevleyski Jan 27, 2023
b180074
three.js version API differences
kevleyski Jan 27, 2023
8adb558
three.js version API differences (part revert to allow webvr to still…
kevleyski Jan 27, 2023
f8ea3cb
three.js version revert back to v129 as 130 breaks renderer.getSize
kevleyski Jan 27, 2023
466267b
cubemap verticies
kevleyski Jan 27, 2023
da9c89c
fix up 180 mono
kevleyski Jan 27, 2023
c4bd610
Move to latest THREE.js (0.149.0)
kevleyski Jan 27, 2023
a4c12ac
Use latest THREE.js
kevleyski Jan 27, 2023
5943617
chore: Swap webvr for webxr polyfill packages (PR fix ups - fix up VR…
Jan 29, 2023
37fe825
chore: Swap webvr for webxr polyfill packages (PR fix ups - fix up 18…
Jan 30, 2023
d890f20
chore: Swap webvr for webxr polyfill packages (PR fix ups - cubemap)
Jan 31, 2023
89ab083
chore: Swap webvr for webxr polyfill packages (PR fix ups - cubemap)
Jan 31, 2023
dc27ea8
chore: Swap webvr for webxr polyfill packages (PR fix ups - cubemap)
Jan 31, 2023
a2b1aa0
chore: Swap webvr for webxr polyfill packages (PR fix ups - cubemap b…
Jan 31, 2023
204a6ff
chore: Swap webvr for webxr polyfill packages (PR fix ups - UI)
Mar 14, 2023
4d2b6be
chore: Swap webvr for webxr polyfill packages (PR fix ups - UI)
kevleyski Mar 30, 2023
db152db
chore: Swap webvr for webxr polyfill packages (PR fix ups - UI)
kevleyski Mar 30, 2023
e73f8dd
chore: Swap webvr for webxr polyfill packages (PR fix ups - UI)
kevleyski Mar 31, 2023
ef663d5
KJSL base
kevleyski May 30, 2024
3e30d44
KJSL: adding query string param as video source uri
kevleyski May 30, 2024
4a03ffd
Merge branch 'main' of https://github.com/kevleyski/videojs-vr
kevleyski May 31, 2024
a7c2ec9
KJSL mono 180 with param
kevleyski May 31, 2024
6a44da7
KJSL query string param as video source URI
kevleyski May 31, 2024
d4af887
KJSL query string param as video source URI
kevleyski May 31, 2024
7968b74
KJSL update deps
kevleyski May 31, 2024
5047667
KJSL update deps
kevleyski May 31, 2024
6889327
KJSL update deps
kevleyski May 31, 2024
4c940ee
KJSL video source as query string parameter option
kevleyski May 31, 2024
9c72559
KJSL video source as query string parameter option
kevleyski May 31, 2024
0ab4da8
KJSL video source as query string parameter option
kevleyski May 31, 2024
5fbb582
KJSL adding XRMediaBinding
kevleyski May 31, 2024
bf62945
KJSL adding XRMediaBinding
kevleyski May 31, 2024
1a7ac9b
KJSL adding XRMediaBinding
kevleyski May 31, 2024
00532c7
KJSL adding XRMediaBinding
kevleyski May 31, 2024
14bae6c
KJSL adding XRMediaBinding
kevleyski May 31, 2024
761b810
KJSL adding XRMediaBinding
kevleyski May 31, 2024
2da1fe6
KJSL adding XRMediaBinding
kevleyski May 31, 2024
cb32a44
KJSL adding XRMediaBinding
kevleyski May 31, 2024
5c8000e
KJSL adding XRMediaBinding
kevleyski Jun 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

node_modules/.bin/lint-staged
12 changes: 12 additions & 0 deletions .run/webxr start.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="webxr start" type="js.build_tools.npm">
<package-json value="$PROJECT_DIR$/package.json" />
<command value="run" />
<scripts>
<script value="start" />
</scripts>
<node-interpreter value="project" />
<envs />
<method v="2" />
</configuration>
</component>
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
<a name="1.10.2"></a>
## [1.10.2](https://github.com/videojs/videojs-vr/compare/v1.10.0...v1.10.1) (2024-05-28)

### Chores

* adding WebXR layers

<a name="1.10.1"></a>
## [1.10.1](https://github.com/videojs/videojs-vr/compare/v1.10.0...v1.10.1) (2022-08-16)

Expand Down
1 change: 0 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ When you've made your changes, push your commit(s) to your fork and issue a pull
Testing is a crucial part of any software project. For all but the most trivial changes (typos, etc) test cases are expected. Tests are run in actual browsers using [Karma][karma].

- In all available and supported browsers: `npm test`
- In a specific browser: `npm run test:chrome`, `npm run test:firefox`, etc.
- While development server is running (`npm start`), navigate to [`http://localhost:9999/test/`][local]


Expand Down
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Maintenance Status: Stable
- [`projection`](#projection)
- [`'180'`](#180)
- [`'180_LR'`](#180_lr)
- [`'180_TB'`](#180_tb)
- [`'180_MONO'`](#180_mono)
- [`'360'`, `'Sphere'`, or `'equirectangular'`](#360-sphere-or-equirectangular)
- [`'Cube'` or `'360_CUBE'`](#cube-or-360_cube)
Expand Down Expand Up @@ -73,7 +74,11 @@ The most recent versions of:
* Mobile
* Chrome on Android
* Safari on iOS

* Headsets
* Meta Quest Browser
* Rift (via Chrome browser)
* WebXR plug-in (Chrome/Firefox)

## Caveats
* HLS captions on safari will not be visible as they are located inside of the shadowRoot in the video element and we cannot get access to them.

Expand Down Expand Up @@ -218,6 +223,10 @@ The video is half sphere and the user should not be able to look behind themselv
Used for side-by-side 180 videos
The video is half sphere and the user should not be able to look behind themselves

#### `'180_TB'`
Used for top/bottom 180 videos
The video is half sphere and the user should not be able to look behind themselves

#### `'180_MONO'`
Used for monoscopic 180 videos
The video is half sphere and the user should not be able to look behind themselves
Expand Down Expand Up @@ -294,7 +303,7 @@ This project is a conglomeration of a few amazing open source libraries.

* [VideoJS](http://www.videojs.com)
* [Three.js](http://threejs.org)
* [webvr-polyfill](https://github.com/borismus/webvr-polyfill)
* [webxr-polyfill](https://github.com/immersive-web/webxr-polyfill)
* [Omnitone](https://googlechrome.github.io/omnitone)

## Support ##
Expand Down
56 changes: 38 additions & 18 deletions examples/180-mono.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,46 @@
<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="300" 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>
</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';
<video width="640" height="300" 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>
</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>
var vr = window.vr = player.vr({projection: '180_MONO', 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>
48 changes: 48 additions & 0 deletions examples/180-tb.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<!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="../samples/video_180_TB.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 = '180_TB';

var vr = window.vr = player.vr({projection: '180_TB', 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>
56 changes: 38 additions & 18 deletions examples/180.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,46 @@
<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="300" id="videojs-vr-player" class="video-js vjs-default-skin" controls playsinline>
<source src="../samples/video_180.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 = '180';
<video width="640" height="300" id="videojs-vr-player" class="video-js vjs-default-skin" controls playsinline>
<source src="../samples/video_180.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 = '180';

var vr = window.vr = player.vr({projection: '180', debug: true, forceCardboard: false});
}(window, window.videojs));
</script>
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.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>
58 changes: 39 additions & 19 deletions examples/360-cube.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="300" id="videojs-vr-player" class="video-js vjs-default-skin" controls playsinline>
<source src="../samples/doisethup_cubemap.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_CUBE';
<video width="640" height="300" id="videojs-vr-player" class="video-js vjs-default-skin" controls playsinline>
<source src="../samples/doisethup_cubemap.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_CUBE';

// 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>
Loading