Proxy: pass range as URL parameter to avoid throttling

This commit is contained in:
Samantaz Fox 2023-03-05 13:43:13 +01:00
parent e62d61abc1
commit 3474744f57
No known key found for this signature in database
GPG key ID: F42821059186176E
3 changed files with 86 additions and 33 deletions

View file

@ -43,6 +43,14 @@ 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) {
// Pass range as an URL parameter, not as a header
if (options.headers){
if (options.headers.Range) {
options.uri = options.uri + '&range=' + options.headers.Range.split("=")[1];
delete options.headers.Range;
}
}
// set local if requested not videoplayback
if (!options.uri.includes('videoplayback')) {
if (!options.uri.includes('local=true'))