feat: allow setting videojs max buffer length via config.yml (#5876)

This commit is contained in:
Fijxu
2026-08-03 15:52:50 -04:00
committed by GitHub
parent b4b6e992fc
commit cb88a805e5
5 changed files with 57 additions and 0 deletions

View File

@@ -1,6 +1,7 @@
'use strict';
var player_data = JSON.parse(document.getElementById('player_data').textContent);
var video_data = JSON.parse(document.getElementById('video_data').textContent);
const CONFIG = JSON.parse(document.getElementById('config').textContent);
var options = {
liveui: true,
@@ -54,6 +55,14 @@ videojs.Vhs.xhr.beforeRequest = function(options) {
return options;
};
// Buffer limits
if (CONFIG.videojs.goal_buffer_length) {
videojs.Vhs.GOAL_BUFFER_LENGTH = CONFIG.videojs.goal_buffer_length;
}
if (CONFIG.videojs.max_goal_buffer_length) {
videojs.Vhs.MAX_GOAL_BUFFER_LENGTH = CONFIG.videojs.max_goal_buffer_length;
}
var player = videojs('player', options);
player.on('error', function () {