Skip to content

Commit

Permalink
revert last commit
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkejN committed Mar 27, 2020
1 parent 4732ab9 commit d91c2af
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/Resources/public/js/qualityselection.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ Object.assign(MediaElementPlayer.prototype, {
const src = sources[i];
if (src.mediaType === "video") {
if (src.qualityIndex === dashPlayer.getQualityFor("video") && !dashPlayer.getSettings().streaming.abr.autoSwitchBitrate.video) var isCurrent = true;
t.addQualityButton(src.width, src.qualityIndex, isCurrent);
t.addQualityButton(src.height + "p", src.qualityIndex, isCurrent);
}
}
t.addQualityButton("Automatisch", "auto", dashPlayer.getSettings().streaming.abr.autoSwitchBitrate.video);
Expand All @@ -113,7 +113,7 @@ Object.assign(MediaElementPlayer.prototype, {
for (let i = 0, total = sources.length; i < total; i++) {
const src = sources[i];
if (i === hlsPlayer.firstLevel && !hlsPlayer.autoLevelEnabled) isCurrent = true;
t.addQualityButton(src.width, sources.length - (1 + i), isCurrent);
t.addQualityButton(src.height + "p", sources.length - (1 + i), isCurrent);
}
t.addQualityButton("Automatisch", "auto", hlsPlayer.autoLevelEnabled);
return 0;
Expand Down Expand Up @@ -234,19 +234,13 @@ Object.assign(MediaElementPlayer.prototype, {

/**
*
* @param {String} width
* @param {String} height
* @param {String} qualityIndex
* @param {Boolean} isCurrent
*/
addQualityButton(width, qualityIndex, isCurrent) {
addQualityButton(height, qualityIndex, isCurrent) {
const t = this;

if (width != "Automatisch") {
width = width * 9/16 + "p";
}

const height = width;

t.qualityselectionButton.querySelector('ul').innerHTML += `<li>` +
`<input type="radio" name="${t.id}_qualityselectionchooser" id="${t.id}_qualityselectionchooser_${height}" ` +
`role="menuitemradio" value="${qualityIndex}" ${(isCurrent ? 'checked="checked"' : '')} aria-selected="${isCurrent}"/>` +
Expand Down

0 comments on commit d91c2af

Please sign in to comment.