Skip to content

Commit

Permalink
update deps + fix videojs-contrib-quality-menu quality selection
Browse files Browse the repository at this point in the history
  • Loading branch information
unixfox committed Apr 28, 2024
1 parent e975c8a commit 44df12f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 14 deletions.
2 changes: 1 addition & 1 deletion assets/css/quality-selector.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 4 additions & 6 deletions assets/js/player.js
Expand Up @@ -43,7 +43,7 @@ embed_url = location.origin + '/embed/' + video_data.id + embed_url.search;

var save_player_pos_key = 'save_player_pos';

videojs.Vhs.xhr.beforeRequest = function(options) {
videojs.Vhs.xhr.onRequest = function(options) {
// set local if requested not videoplayback
if (!options.uri.includes('videoplayback')) {
if (!options.uri.includes('local=true'))
Expand Down Expand Up @@ -398,7 +398,6 @@ if (video_data.params.autoplay) {
}

if (!video_data.params.listen && video_data.params.quality === 'dash') {
var qualityMenuOptions = {}

if (video_data.params.quality_dash !== 'auto') {
player.ready(function () {
Expand All @@ -421,13 +420,12 @@ if (!video_data.params.listen && video_data.params.quality === 'dash') {
break;
}
}
qualityMenuOptions.defaultResolution = (qualityLevels[targetQualityLevel].height + "p");
player.qualityMenu({
defaultResolution: qualityLevels[targetQualityLevel].height
});
});
});
}

console.log(qualityMenuOptions)
player.qualityMenu(qualityMenuOptions);
}

player.vttThumbnails({
Expand Down

0 comments on commit 44df12f

Please sign in to comment.