Skip to content

Commit bf97c5b

Browse files
chore: update dependencies, readme, examples, and switch to github actions ci (#242)
1 parent 7dc2684 commit bf97c5b

File tree

9 files changed

+3818
-5047
lines changed

9 files changed

+3818
-5047
lines changed

.github/workflows/ci.yml

+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: ci
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
should-skip:
7+
continue-on-error: true
8+
runs-on: ubuntu-latest
9+
# Map a step output to a job output
10+
outputs:
11+
should-skip-job: ${{steps.skip-check.outputs.should_skip}}
12+
steps:
13+
- id: skip-check
14+
uses: fkirc/[email protected]
15+
with:
16+
github_token: ${{github.token}}
17+
18+
ci:
19+
needs: should-skip
20+
if: ${{needs.should-skip.outputs.should-skip-job != 'true' || github.ref == 'refs/heads/main'}}
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
os: [ubuntu-latest]
25+
env:
26+
BROWSER_STACK_USERNAME: ${{secrets.BROWSER_STACK_USERNAME}}
27+
BROWSER_STACK_ACCESS_KEY: ${{secrets.BROWSER_STACK_ACCESS_KEY}}
28+
runs-on: ${{matrix.os}}
29+
steps:
30+
- name: checkout code
31+
uses: actions/checkout@v2
32+
33+
- name: Cache dependencies
34+
uses: actions/cache@v2
35+
with:
36+
path: |
37+
~/.npm
38+
**/node_modules
39+
key: ${{runner.os}}-npm-${{hashFiles('**/package-lock.json')}}
40+
restore-keys: |
41+
${{runner.os}}-npm-
42+
${{runner.os}}-
43+
44+
- name: read node version from .nvmrc
45+
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
46+
shell: bash
47+
id: nvm
48+
49+
- name: update apt cache on linux w/o browserstack
50+
run: sudo apt-get update
51+
if: ${{startsWith(matrix.os, 'ubuntu') && !env.BROWSER_STACK_USERNAME}}
52+
53+
- name: install ffmpeg/pulseaudio for firefox on linux w/o browserstack
54+
run: sudo apt-get install ffmpeg pulseaudio
55+
if: ${{startsWith(matrix.os, 'ubuntu') && !env.BROWSER_STACK_USERNAME}}
56+
57+
- name: start pulseaudio for firefox on linux w/o browserstack
58+
run: pulseaudio -D
59+
if: ${{startsWith(matrix.os, 'ubuntu') && !env.BROWSER_STACK_USERNAME}}
60+
61+
- name: setup node
62+
uses: actions/setup-node@v1
63+
with:
64+
node-version: '${{steps.nvm.outputs.NVMRC}}'
65+
66+
# turn off the default setup-node problem watchers...
67+
- run: echo "::remove-matcher owner=eslint-compact::"
68+
- run: echo "::remove-matcher owner=eslint-stylish::"
69+
- run: echo "::remove-matcher owner=tsc::"
70+
71+
- name: npm install
72+
run: npm i --prefer-offline --no-audit
73+
74+
- name: run npm test
75+
uses: GabrielBB/xvfb-action@v1
76+
with:
77+
run: npm run test

.nvmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
lts/*
1+
14

.travis.yml

-19
This file was deleted.

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ Maintenance Status: Stable
6060
## Installation
6161

6262
```sh
63-
npm install --save videojs-vr
63+
npm i videojs-vr
6464
```
6565

6666
## Browser Support

examples/360-sphere-detail.html

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<title>videojs-vr Demo</title>
6+
<link href="../node_modules/video.js/dist/video-js.css" rel="stylesheet">
7+
<link href="../dist/videojs-vr.css" rel="stylesheet">
8+
</head>
9+
<body>
10+
<video width="640" height="300" id="videojs-vr-player" class="video-js vjs-default-skin" controls playsinline>
11+
<source src="../samples/eagle-360.mp4" type="video/mp4">
12+
</video>
13+
<ul>
14+
<li><a href="../">return to main example</a></li>
15+
</ul>
16+
<script src="../node_modules/video.js/dist/video.js"></script>
17+
<script src="../dist/videojs-vr.js"></script>
18+
<script>
19+
(function(window, videojs) {
20+
var player = window.player = videojs('videojs-vr-player');
21+
player.mediainfo = player.mediainfo || {};
22+
player.mediainfo.projection = '360';
23+
24+
// AUTO is the default and looks at mediainfo
25+
var vr = window.vr = player.vr({
26+
projection: 'AUTO',
27+
debug: true,
28+
forceCardboard: false,
29+
sphereDetail: 64,
30+
});
31+
}(window, window.videojs));
32+
</script>
33+
</body>
34+
</html>

index.html

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
<li><a href="examples/eac-lr.html">EAC LR video example</a></li>
1919
<li><a href="examples/fluid.html">"Fluid" video size example</a></li>
2020
<li><a href="examples/spatial.html">Spatial audio example</a></li>
21+
<li><a href="examples/sphere-detail.html">360 with increased sphere detail example</a></li>
2122
</ul>
2223
</body>
2324
</html>

0 commit comments

Comments
 (0)