Improvements to Dailymotion player

* Hide the logo by default
    * Set the wmode based on the user's preference
    * Automatic quality as with youtube
This commit is contained in:
Calvin Montgomery 2014-05-16 00:36:33 -05:00
parent 89939682ce
commit 03a188e8f2
2 changed files with 23 additions and 2 deletions

View File

@ -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

View File

@ -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) {