Make vimeo workaround respect default quality option

This commit is contained in:
Calvin Montgomery 2014-05-16 00:46:30 -05:00
parent 03a188e8f2
commit d16482b863
2 changed files with 27 additions and 4 deletions

View File

@ -67,7 +67,7 @@ mixin us-playback
mixin rcheckbox("us-playlistbuttons", "Hide playlist buttons by default") mixin rcheckbox("us-playlistbuttons", "Hide playlist buttons by default")
mixin rcheckbox("us-oldbtns", "Old style playlist buttons") mixin rcheckbox("us-oldbtns", "Old style playlist buttons")
.form-group .form-group
label.control-label.col-sm-4(for="#us-default-quality") Default YouTube/Dailymotion quality label.control-label.col-sm-4(for="#us-default-quality") Default YouTube/Vimeo/Dailymotion quality
.col-sm-8 .col-sm-8
select#us-default-quality.form-control select#us-default-quality.form-control
option(value="auto") Auto option(value="auto") Auto

View File

@ -858,9 +858,32 @@ Callbacks = {
} else { } else {
data.type = "rv"; data.type = "rv";
} }
// Right now only plays standard definition.
// In the future, I may add a quality selector for mobile/standard/HD /* Convert youtube-style quality key to vimeo workaround quality */
data.url = data.direct.sd.url; var q = {
small: "mobile",
medium: "sd",
large: "sd",
hd720: "hd",
hd1080:"hd",
highres: "hd"
}[USEROPTS.default_quality] || "sd";
var fallback = {
hd: "sd",
sd: "mobile",
mobile: false
};
while (!(q in data.direct) && q != false) {
q = fallback[q];
}
if (!q) {
q = "sd";
}
data.url = data.direct[q].url;
} }
if (data.type === "rt") { if (data.type === "rt") {