Skip to content

Commit

Permalink
domains: support direct links to custom Dailymotion players
Browse files Browse the repository at this point in the history
  • Loading branch information
iparamonau committed Jul 8, 2024
1 parent 3437db5 commit b0fa073
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
22 changes: 13 additions & 9 deletions plugins/domains/dailymotion.com/dailymotion.com.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,27 @@ export default {
"video"
],

/**
* Values for `get_params`:
* - queue-enable=false - https://faq.dailymotion.com/hc/en-us/articles/360000713928-Disabling-the-Up-Next-Queue
* - ui-start-screen-info=0 - hide title amontg other things - https://nextgenthemes.com/how-to-hide-titles-and-change-other-setting-for-youtube-vimeo-embeds-in-wordpress-with-arve/
*/
getLink: function (url, iframe, options) {
var playlistParams = querystring.parse(options.getProviderOptions('dailymotion.get_params', '').replace(/^\?/, ''));

if (iframe.src && iframe.height) {
return {
var player = {
href: iframe.replaceQuerystring(playlistParams),
type: CONFIG.T.text_html,
"rel": [CONFIG.R.player, CONFIG.R.oembed],
"aspect-ratio": iframe.width / iframe.height,
scrolling: 'no',
autoplay: "autoplay=1"
};

// Do not replace direct link to custom players
if (options.redirectsHistory
&& /^https?:\/\/(?:geo\.)?dailymotion\.com\/player\/[a-zA-Z0-9]+\.html\?video=([a-zA-Z0-9]+)/i.test(options.redirectsHistory[0])) {
player.href = options.redirectsHistory[0];
delete player.autoplay;
}

return player;
}
},

Expand Down Expand Up @@ -69,9 +73,9 @@ export default {
skipMixins: ["video", "og-description", "canonical"],
skipMethods: ["getData"]
},
"http://www.dailymotion.com/video/x10bix2_ircam-mani-feste-2013-du-29-mai-au-30-juin-2013_creation#.Uaac62TF1XV",
"http://www.dailymotion.com/swf/video/xcv6dv_pixels-by-patrick-jean_creation",
"http://www.dailymotion.com/embed/video/xcv6dv_pixels-by-patrick-jean_creation",
"https://www.dailymotion.com/video/x10bix2_ircam-mani-feste-2013-du-29-mai-au-30-juin-2013_creation#.Uaac62TF1XV",
"https://www.dailymotion.com/swf/video/xcv6dv_pixels-by-patrick-jean_creation",
"https://www.dailymotion.com/embed/video/xcv6dv_pixels-by-patrick-jean_creation",
"https://dailymotion.com/embed/video/x5yiamz?queue-enable=false"
]
};
2 changes: 1 addition & 1 deletion plugins/domains/dailymotion.com/dailymotion.swf.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export default {

re: [
/^https?:\/\/www\.dailymotion\.com\/(?:swf|embed)\/video\/([a-zA-Z0-9]+)/i,
/^https?:\/\/(?:geo\.)?dailymotion\.com\/player\.html\?video=([a-zA-Z0-9]+)/i
/^https?:\/\/(?:geo\.)?dailymotion\.com\/player(?:\/[a-zA-Z0-9]+)?\.html\?video=([a-zA-Z0-9]+)/i
],

listed: false,
Expand Down

0 comments on commit b0fa073

Please sign in to comment.