Fix an issue with quality selection
This commit is contained in:
parent
83ae835bed
commit
ecca806a58
2 changed files with 13 additions and 10 deletions
|
|
@ -2749,15 +2749,18 @@ function googlePlusSimulator2014(data) {
|
|||
var fallbacks = ["hd1080", "hd720", "large", "medium", "small"];
|
||||
var i = fallbacks.indexOf(q);
|
||||
if (i < 0) {
|
||||
// Default to 360p because 480p is Flash
|
||||
i = fallbacks.indexOf("medium");
|
||||
}
|
||||
|
||||
while (!(q in data.meta.gpdirect) && i < fallbacks.length) {
|
||||
q = fallbacks[i++];
|
||||
}
|
||||
|
||||
if (i === fallbacks.length) {
|
||||
q = "medium";
|
||||
var hasCodecs = Object.keys(data.meta.gpdirect);
|
||||
if (hasCodecs.length > 0) {
|
||||
q = hasCodecs[0];
|
||||
}
|
||||
}
|
||||
|
||||
data.url = data.meta.gpdirect[q];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue