Skip to content

Commit faf5932

Browse files
Danjadigitas-git
authored andcommitted
fix video-quality switch
1 parent 5a85464 commit faf5932

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

src/quality/quality.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ Object.assign(MediaElementPlayer.prototype, {
242242
t.updateQualityButton(this, player, currentQuality);
243243
t.switchHLSQuality(player, media);
244244
} else {
245-
t.updateQualityButton(this, player, currentQuality);
245+
currentQuality = t.updateQualityButton(this, player, currentQuality);
246246

247247
let currentTime = media.currentTime;
248248
const paused = media.paused;
@@ -442,12 +442,14 @@ Object.assign(MediaElementPlayer.prototype, {
442442
}
443443

444444
player.qualitiesContainer.querySelector('button').innerHTML = newQuality;
445+
return newQuality;
445446
},
446447

447448
/**
448-
* Returns the quality represnetaion base on the height of the loaded video
449-
* @param {Number} height the pixel height of the video
450-
**/
449+
* Returns the quality represnetaion base on the height of the loaded video
450+
* @param {Number} height the pixel height of the video
451+
* @param {Number} height the pixel height of the video
452+
**/
451453
getQualityFromHeight (height) {
452454
if (height >= 4320) {
453455
return "8K UHD";

0 commit comments

Comments
 (0)