Skip to content

Commit 465c64f

Browse files
iparamonaunleush
authored andcommitted
[Vimeo] Return an option to modify player parameters through direct URL query (#605)
1 parent f812388 commit 465c64f

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

plugins/domains/vimeo.com.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ export default {
1414
"oembed-duration",
1515
"oembed-site",
1616
"oembed-description",
17-
"domain-icon"
17+
"domain-icon",
18+
"query"
1819
],
1920

2021
getMeta: function(oembed) {
@@ -24,14 +25,17 @@ export default {
2425
};
2526
},
2627

27-
getLink: function(oembed, options) {
28+
getLink: function(oembed, query, url, options) {
2829
const iframe = oembed.getIframe();
2930

3031
const get_params = querystring.parse(options.getProviderOptions('vimeo.get_params', '').replace(/^\?/, ''));
3132
var providerOptions = options.getProviderOptions('_vimeo') || {};
3233
delete providerOptions.showinfo;
3334

34-
const params = {...get_params, ...providerOptions};
35+
const queryOptions = /^https?:\/\/player\.vimeo\.com\/video\/(\d+)/i.test(url)
36+
&& options.getProviderOptions('vimeo.allow_url_options', false) ? query : {};
37+
38+
const params = {...get_params, ...providerOptions, ...queryOptions};
3539

3640
if (!options.getProviderOptions('_vimeo.showinfo', options.getProviderOptions('players.showinfo', true))) {
3741
params.title = 0;
@@ -107,6 +111,7 @@ export default {
107111
"https://vimeo.com/141567420",
108112
"https://vimeo.com/76979871", // Captions
109113
"https://vimeo.com/216098214", // Portrait
114+
"https://player.vimeo.com/video/65836516?&autoplay=1&loop=1",
110115
{
111116
skipMixins: ["oembed-description"],
112117
skipMethods: ["getData"]

0 commit comments

Comments
 (0)