Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix video-quality switch #229

Merged
merged 2 commits into from
Nov 17, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/quality/quality.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ Object.assign(MediaElementPlayer.prototype, {
t.updateQualityButton(this, player, currentQuality);
t.switchHLSQuality(player, media);
} else {
t.updateQualityButton(this, player, currentQuality);
currentQuality = t.updateQualityButton(this, player, currentQuality);

let currentTime = media.currentTime;
const paused = media.paused;
Expand Down Expand Up @@ -442,12 +442,13 @@ Object.assign(MediaElementPlayer.prototype, {
}

player.qualitiesContainer.querySelector('button').innerHTML = newQuality;
return newQuality;
},

/**
* Returns the quality represnetaion base on the height of the loaded video
* @param {Number} height the pixel height of the video
**/
* Returns the quality represnetaion base on the height of the loaded video
* @param {Number} height the pixel height of the video
**/
getQualityFromHeight (height) {
if (height >= 4320) {
return "8K UHD";
Expand Down