mirror of https://github.com/calzoneman/sync.git
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:
parent
89939682ce
commit
03a188e8f2
|
@ -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
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue