Skip to content

Commit

Permalink
[domains] imdb.com add width param to player url
Browse files Browse the repository at this point in the history
  • Loading branch information
nleush committed Mar 30, 2015
1 parent 19f2753 commit bf52840
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
1 change: 1 addition & 0 deletions config.js
Expand Up @@ -18,6 +18,7 @@
CACHE_TTL: 24 * 60 * 60,

CACHE_TTL_PAGE_TIMEOUT: 10 * 60,
CACHE_TTL_PAGE_404: 10 * 60,

CLUSTER_WORKER_RESTART_ON_MEMORY_USED: 500 * 1024 * 1024, // 500 MB.
CLUSTER_MAX_CPU_LOAD_TIME_IN_SECONDS: 20, // if 20 seconds load over 95% - restart worker.
Expand Down
16 changes: 11 additions & 5 deletions plugins/domains/imdb.com.js
Expand Up @@ -13,15 +13,21 @@ module.exports = {
"og-title"
],

getLink: function(urlMatch) {
getLink: function(urlMatch, options) {

var width = options.maxWidth || 480;

if (width < 400) {
width = 400;
}

return {
href: "http://www.imdb.com/video/imdb/vi" + urlMatch[1] + "/imdb/embed?autoplay=false&width=480",
href: "http://www.imdb.com/video/imdb/vi" + urlMatch[1] + "/imdb/embed?autoplay=false&width=" + width,
type: CONFIG.T.text_html,
rel: [CONFIG.R.player, CONFIG.R.html5],
width: 480,
height: 270
}
width: width,
height: width / (16/9) + 40 // 40px body margin
};
},

tests: [
Expand Down

0 comments on commit bf52840

Please sign in to comment.