mirror of
https://github.com/iv-org/invidious.git
synced 2026-08-04 14:22:04 +00:00
feat: allow setting videojs max buffer length via config.yml (#5876)
This commit is contained in:
@@ -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 () {
|
||||
|
||||
Reference in New Issue
Block a user