Skip to content

Commit 9b34178

Browse files
Merge branch 'master' into master
2 parents 711c038 + 00c134c commit 9b34178

File tree

12 files changed

+1362
-1736
lines changed

12 files changed

+1362
-1736
lines changed

.eslintrc.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ const WARNING = 1;
55
const ERROR = 2;
66

77
module.exports = {
8-
extends: '@vimeo/eslint-config-player/es6',
8+
root: true,
9+
extends: [],
910
plugins: ['compat'],
1011
parserOptions: {
11-
ecmaVersion: 12
12+
ecmaVersion: 2021
1213
},
1314
parser: '@babel/eslint-parser',
1415
rules: {

.github/workflows/build.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ jobs:
44
run:
55
runs-on: ubuntu-latest
66
steps:
7-
- uses: actions/checkout@v3
7+
- uses: actions/checkout@v4
88

9-
- name: Set Node.js 16.x
10-
uses: actions/setup-node@v3
9+
- name: Set Node.js 18.x
10+
uses: actions/setup-node@v4
1111
with:
12-
node-version: 16.x
12+
node-version: 18.x
1313

1414
- name: Install packages
1515
uses: borales/actions-yarn@v4
1616
with:
17-
cmd: install
17+
cmd: install --frozen-lockfile
1818

1919
- name: Build production bundle
2020
uses: borales/actions-yarn@v4
@@ -37,4 +37,6 @@ jobs:
3737
cmd: report-coverage
3838

3939
- name: Upload coverage reports to Codecov
40-
uses: codecov/codecov-action@v3
40+
uses: codecov/codecov-action@v5
41+
with:
42+
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/pr-merge.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@ jobs:
77
upload:
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: actions/checkout@v3
10+
- uses: actions/checkout@v4
1111

12-
- name: Set Node.js 16.x
13-
uses: actions/setup-node@v3
12+
- name: Set Node.js 18.x
13+
uses: actions/setup-node@v4
1414
with:
15-
node-version: 16.x
15+
node-version: 18.x
1616

1717
- name: Install packages
1818
uses: borales/actions-yarn@v4
1919
with:
20-
cmd: install
20+
cmd: install --frozen-lockfile
2121

2222
- name: Test
2323
uses: borales/actions-yarn@v4
@@ -30,4 +30,6 @@ jobs:
3030
cmd: report-coverage
3131

3232
- name: Upload coverage reports to Codecov
33-
uses: codecov/codecov-action@v3
33+
uses: codecov/codecov-action@v5
34+
with:
35+
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/publish-package.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ jobs:
88
build:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v3
11+
- uses: actions/checkout@v4
1212
# Setup .npmrc file to publish to npm
13-
- uses: actions/setup-node@v3
13+
- uses: actions/setup-node@v4
1414
with:
15-
node-version: '16.x'
15+
node-version: '18.x'
1616
registry-url: 'https://registry.npmjs.org'
1717
scope: '@vimeo'
1818
- run: yarn --frozen-lockfile

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Vimeo Player API [![npm](https://img.shields.io/npm/v/@vimeo/player.svg?cacheSeconds=120)](https://www.npmjs.com/package/@vimeo/player) [![Coverage](https://img.shields.io/codecov/c/github/vimeo/player.js.svg?cacheSeconds=120)](https://codecov.io/gh/vimeo/player.js) ![Badge size](https://img.badgesize.io/https://raw.githubusercontent.com/vimeo/player.js/master/dist/player.min.js?compression=gzip&label=gzip)
1+
# Vimeo Player API [![npm](https://img.shields.io/npm/v/@vimeo/player.svg?cacheSeconds=120)](https://www.npmjs.com/package/@vimeo/player) [![Coverage](https://img.shields.io/codecov/c/github/vimeo/player.js.svg?cacheSeconds=120)](https://codecov.io/gh/vimeo/player.js) ![Badge size](https://img.badgesize.io/https://player.vimeo.com/api/player.js?compression=gzip&label=gzip)
22

33
The Vimeo Player API allows you to interact with and control an embedded Vimeo
44
Player.
@@ -57,7 +57,7 @@ You can use the library to make the embed for you. All you need is an empty
5757
element and the video id or vimeo.com url (and optional
5858
[embed options](#embed-options)).
5959

60-
**NOTE:** If the video [privacy settings](https://vimeo.zendesk.com/hc/en-us/articles/224817847-Privacy-settings-overview) are "Unlisted", instead of providing an `id` property, you will need to provide the full video URL as a `url` property and include the `h` parameter.
60+
**NOTE:** If the video [privacy settings](https://help.vimeo.com/hc/en-us/articles/12426199699985-Overview-of-video-privacy-settings) are "Unlisted", instead of providing an `id` property, you will need to provide the full video URL as a `url` property and include the `h` parameter.
6161

6262
```html
6363
<div id="made-in-ny"></div>
@@ -88,7 +88,7 @@ attributes. Each element must have at least a `data-vimeo-id` or
8888
You can also add attributes for any of the [embed options](#embed-options),
8989
prefixed with `data-vimeo` (`data-vimeo-portrait="false"`, for example).
9090

91-
**NOTE:** If the video [privacy settings](https://vimeo.zendesk.com/hc/en-us/articles/224817847-Privacy-settings-overview) are "Unlisted", instead of providing a `data-vimeo-id` attribute, you will need to provide the full video URL in a `data-vimeo-url` attribute and include the `h` parameter.
91+
**NOTE:** If the video [privacy settings](https://help.vimeo.com/hc/en-us/articles/12426199699985-Overview-of-video-privacy-settings) are "Unlisted", instead of providing a `data-vimeo-id` attribute, you will need to provide the full video URL in a `data-vimeo-url` attribute and include the `h` parameter.
9292

9393
```html
9494
<div data-vimeo-id="19231868" data-vimeo-width="640" id="handstick"></div>
@@ -122,7 +122,7 @@ for details on how to update your code to use this library.
122122

123123
## Using with a module bundler
124124

125-
If you’re using a module bundler like [webpack](https://webpack.js.org) or
125+
If you’re using a module bundler like [webpack](https://webpack.js.org/) or
126126
[rollup](https://rollupjs.org/), the exported object will be the Player
127127
constructor (unlike the browser where it is attached to `window.Vimeo`):
128128

@@ -288,7 +288,7 @@ Pass any element and an options object to the `Vimeo.Player` constructor to make
288288
an embed inside that element. The options object should consist of either an
289289
`id` or `url` and any other [embed options](#embed-options) for the embed.
290290

291-
**NOTE:** If the video [privacy settings](https://vimeo.zendesk.com/hc/en-us/articles/224817847-Privacy-settings-overview) are "Unlisted", instead of providing an `id` property, you will need to provide the full video URL as a `url` property and include the `h` parameter.
291+
**NOTE:** If the video [privacy settings](https://help.vimeo.com/hc/en-us/articles/12426199699985-Overview-of-video-privacy-settings) are "Unlisted", instead of providing an `id` property, you will need to provide the full video URL as a `url` property and include the `h` parameter.
292292

293293
```html
294294
<div id="made-in-ny"></div>
@@ -424,7 +424,7 @@ player.off('play');
424424
Load a new video into this embed. The promise will be resolved if the video is
425425
successfully loaded, or it will be rejected if it could not be loaded.
426426

427-
**NOTE:** If the video [privacy settings](https://vimeo.zendesk.com/hc/en-us/articles/224817847-Privacy-settings-overview) are "Unlisted", instead of providing an `id` argument, you will need to provide the full video URL as a `url` argument and include the `h` parameter.
427+
**NOTE:** If the video [privacy settings](https://help.vimeo.com/hc/en-us/articles/12426199699985-Overview-of-video-privacy-settings) are "Unlisted", instead of providing an `id` argument, you will need to provide the full video URL as a `url` argument and include the `h` parameter.
428428

429429
```js
430430
player.loadVideo(76979871).then(function(id) {
@@ -1255,7 +1255,7 @@ Promise.all([player.getVideoWidth(), player.getVideoHeight()]).then(function(dim
12551255

12561256
### getVideoUrl(): Promise&lt;string, (PrivacyError|Error)&gt;
12571257

1258-
Get the [vimeo.com](https://vimeo.com) url for the video.
1258+
Get the [vimeo.com](https://vimeo.com/) url for the video.
12591259

12601260
```js
12611261
player.getVideoUrl().then(function(url) {
@@ -1769,7 +1769,7 @@ Triggered when the player leaves picture-in-picture.
17691769

17701770
Triggered when the availability of remote playback changes.
17711771

1772-
Listening for this event is equivalent to the [RemotePlayback.watchAvailability() API](http://developer.mozilla.org/en-US/docs/Web/API/RemotePlayback/watchAvailability), except that there is no `cancelWatchAvailability()`. You can remove the listener for this event instead.
1772+
Listening for this event is equivalent to the [RemotePlayback.watchAvailability() API](https://developer.mozilla.org/en-US/docs/Web/API/RemotePlayback/watchAvailability), except that there is no `cancelWatchAvailability()`. You can remove the listener for this event instead.
17731773

17741774
### remoteplaybackconnecting
17751775

package.json

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -61,29 +61,27 @@
6161
"@babel/plugin-transform-runtime": "^7.21.4",
6262
"@babel/preset-env": "^7.21.5",
6363
"@babel/register": "^7.21.0",
64-
"@vimeo/eslint-config-player": "^5.0.1",
65-
"ava": "^3.15.0",
66-
"chalk": "^4.1.0",
67-
"chokidar": "^3.5.2",
64+
"ava": "5.3.1",
65+
"chalk": "4.1.2",
66+
"chokidar": "^4.0.3",
6867
"chokidar-cli": "^3.0.0",
69-
"codecov": "^3.7.2",
70-
"cross-env": "^7.0.0",
71-
"eslint": "^7.7.0",
72-
"eslint-plugin-ava": "^11.0.0",
73-
"eslint-plugin-compat": "^3.5.1",
74-
"jquery": "^3.4.1",
75-
"jsdom": "^22.0.0",
76-
"maxmin": "^3.0.0",
68+
"cross-env": "^7.0.3",
69+
"eslint": "7.32.0",
70+
"eslint-plugin-ava": "13.2.0",
71+
"eslint-plugin-compat": "^6.0.2",
72+
"jquery": "^3.7.1",
73+
"jsdom": "^26.1.0",
74+
"maxmin": "3.0.0",
7775
"npm-run-all": "^4.1.5",
78-
"nyc": "^15.1.0",
79-
"rimraf": "^3.0.2",
80-
"rollup": "^2.26.6",
76+
"nyc": "^17.1.0",
77+
"rimraf": "5.0.10",
78+
"rollup": "2.39.1",
8179
"rollup-plugin-babel": "^4.4.0",
8280
"rollup-plugin-commonjs": "^10.1.0",
83-
"rollup-plugin-node-resolve": "^5.0.0",
84-
"sinon": "^9.0.3",
85-
"uglify-js": "^3.7.7",
86-
"xhr2": "0.2.0"
81+
"rollup-plugin-node-resolve": "^5.2.0",
82+
"sinon": "^21.0.0",
83+
"uglify-js": "^3.19.3",
84+
"xhr2": "0.2.1"
8785
},
8886
"babel": {
8987
"presets": [
@@ -133,7 +131,7 @@
133131
"not ie < 11"
134132
],
135133
"volta": {
136-
"node": "16.16.0",
137-
"yarn": "1.22.19"
134+
"node": "18.20.8",
135+
"yarn": "1.22.22"
138136
}
139137
}

rollup.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* eslint-env node */
2-
const fs = require('fs');
2+
const fs = require('node:fs');
33
const uglifyJs = require('uglify-js');
44
const chalk = require('chalk');
55
const maxmin = require('maxmin');
@@ -31,6 +31,10 @@ async function generateBundle() {
3131
building = true;
3232
needsRebuild = false;
3333

34+
if (fs.existsSync('dist') === false) {
35+
fs.mkdirSync('dist');
36+
}
37+
3438
if (watch) {
3539
console.log(new Date().toString());
3640
}
@@ -104,6 +108,6 @@ generateBundle();
104108

105109
if (watch) {
106110
const chokidar = require('chokidar');
107-
const watcher = chokidar.watch('src/**/*');
111+
const watcher = chokidar.watch('./src');
108112
watcher.on('change', generateBundle);
109113
}

src/player.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,14 +174,12 @@ class Player {
174174
return new Promise((resolve, reject) => {
175175
// We are storing the resolve/reject handlers to call later, so we
176176
// can’t return here.
177-
// eslint-disable-next-line promise/always-return
178177
return this.ready().then(() => {
179178
storeCallback(this, name, {
180179
resolve,
181180
reject
182181
});
183182

184-
// eslint-disable-next-line promise/always-return
185183
if (args.length === 0) {
186184
args = {};
187185
}
@@ -205,7 +203,6 @@ class Player {
205203

206204
// We are storing the resolve/reject handlers to call later, so we
207205
// can’t return here.
208-
// eslint-disable-next-line promise/always-return
209206
return this.ready().then(() => {
210207
storeCallback(this, name, {
211208
resolve,
@@ -234,7 +231,6 @@ class Player {
234231

235232
// We are storing the resolve/reject handlers to call later, so we
236233
// can’t return here.
237-
// eslint-disable-next-line promise/always-return
238234
return this.ready().then(() => {
239235
storeCallback(this, name, {
240236
resolve,

test/.eslintrc.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,10 @@ module.exports = {
99
plugins: ['ava'],
1010
extends: 'plugin:ava/recommended',
1111
parserOptions: {
12-
'ecmaVersion': 12,
12+
'ecmaVersion': 2021,
1313
},
1414
parser: '@babel/eslint-parser',
1515
rules: {
16-
'ava/no-cb-test': ERROR,
1716
'no-restricted-syntax': OFF,
1817
'max-nested-callbacks': [WARNING, 3],
1918
}

test/player-test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@ import Player from '../src/player';
66
test('constructor accepts only Vimeo embeds', (t) => {
77
t.throws(() => {
88
void new Player(html`<div data-vimeo-initialized><iframe></iframe></div>`);
9-
}, null);
9+
});
1010

1111
t.throws(() => {
1212
void new Player('string');
13-
}, null);
13+
});
1414

1515
t.throws(() => {
1616
void new Player(html`<iframe></iframe>`);
17-
}, null);
17+
});
1818

1919
t.throws(() => {
2020
void new Player(html`<iframe src="https://www.youtube.com/embed/Uj3_KqkI9Zo"></iframe>`);
21-
}, null);
21+
});
2222
});
2323

2424
test('contructor does not throw if jquery is not present', (t) => {

0 commit comments

Comments
 (0)