Skip to content

Commit

Permalink
v2.23.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bdougherty committed Apr 24, 2024
1 parent 2c50226 commit 551df46
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 13 deletions.
17 changes: 13 additions & 4 deletions dist/player.es.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! @vimeo/player v2.22.0 | (c) 2024 Vimeo | MIT License | https://github.com/vimeo/player.js */
/*! @vimeo/player v2.23.0 | (c) 2024 Vimeo | MIT License | https://github.com/vimeo/player.js */
function ownKeys(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
Expand Down Expand Up @@ -569,7 +569,7 @@ function isInteger(value) {
* @return {boolean}
*/
function isVimeoUrl(url) {
return /^(https?:)?\/\/((player|www)\.)?vimeo\.com(?=$|\/)/.test(url);
return /^(https?:)?\/\/((((player|www)\.)?vimeo\.com)|((player\.)?[a-zA-Z0-9-]+\.videoji\.hk))(?=$|\/)/.test(url);
}

/**
Expand All @@ -579,9 +579,17 @@ function isVimeoUrl(url) {
* @return {boolean}
*/
function isVimeoEmbed(url) {
var expr = /^https:\/\/player\.vimeo\.com\/video\/\d+/;
var expr = /^https:\/\/player\.((vimeo\.com)|([a-zA-Z0-9-]+\.videoji\.hk))\/video\/\d+/;
return expr.test(url);
}
function getOembedDomain(url) {
var match = (url || '').match(/^(?:https?:)?(?:\/\/)?([^/?]+)/);
var domain = (match && match[1] || '').replace('player.', '');
if (domain.endsWith('.videoji.hk')) {
return domain;
}
return 'vimeo.com';
}

/**
* Get the Vimeo URL from an element.
Expand Down Expand Up @@ -1332,7 +1340,8 @@ function getOEmbedData(videoUrl) {
if (!isVimeoUrl(videoUrl)) {
throw new TypeError("\u201C".concat(videoUrl, "\u201D is not a vimeo.com url."));
}
var url = "https://vimeo.com/api/oembed.json?url=".concat(encodeURIComponent(videoUrl));
var domain = getOembedDomain(videoUrl);
var url = "https://".concat(domain, "/api/oembed.json?url=").concat(encodeURIComponent(videoUrl));
for (var param in params) {
if (params.hasOwnProperty(param)) {
url += "&".concat(param, "=").concat(encodeURIComponent(params[param]));
Expand Down
17 changes: 13 additions & 4 deletions dist/player.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/player.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/player.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/player.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vimeo/player",
"version": "2.22.0",
"version": "2.23.0",
"description": "Interact with and control an embedded Vimeo Player.",
"license": "MIT",
"author": "Vimeo <https://vimeo.com>",
Expand Down

0 comments on commit 551df46

Please sign in to comment.