diff --git a/templates/useroptions.jade b/templates/useroptions.jade index 8a630cc0..90aa36ce 100644 --- a/templates/useroptions.jade +++ b/templates/useroptions.jade @@ -67,7 +67,7 @@ mixin us-playback mixin rcheckbox("us-playlistbuttons", "Hide playlist buttons by default") mixin rcheckbox("us-oldbtns", "Old style playlist buttons") .form-group - label.control-label.col-sm-4(for="#us-default-quality") Default YouTube quality + label.control-label.col-sm-4(for="#us-default-quality") Default YouTube/Dailymotion quality .col-sm-8 select#us-default-quality.form-control option(value="auto") Auto diff --git a/www/js/player.js b/www/js/player.js index ad92ccb0..0750d814 100644 --- a/www/js/player.js +++ b/www/js/player.js @@ -350,11 +350,32 @@ var DailymotionPlayer = function (data) { removeOld(); self.videoId = data.id; self.videoLength = data.seconds; + + var q = undefined; + if (USEROPTS.default_quality) { + /* Map youtube-style quality names to dailymotion values */ + q = { + small: 240, + medium: 380, + large: 480, + hd720: 720, + hd1080: 1080, + highres: 1080 + }[USEROPTS.default_quality]; + } + + var params = { + autoplay: 1, + wmode: USEROPTS.wmode_transparent ? "transparent" : "opaque", + quality: q, + logo: 0 + }; + self.player = DM.player("ytapiplayer", { video: data.id, width: parseInt(VWIDTH, 10), height: parseInt(VHEIGHT, 10), - params: { autoplay: 1 } + params: params }); self.player.addEventListener("apiready", function (e) {