-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
From 95576555d18669521799289f990aeeaa7cc72220 Mon Sep 17 00:00:00 2001 | ||
From: Emilien <[email protected]> | ||
Date: Wed, 20 Nov 2024 15:21:45 +0100 | ||
Subject: [PATCH] send query string instead of range http header | ||
|
||
--- | ||
assets/js/player.js | 9 +++++++++ | ||
1 file changed, 9 insertions(+) | ||
|
||
diff --git a/assets/js/player.js b/assets/js/player.js | ||
index 353a52963..e89232aa4 100644 | ||
--- a/assets/js/player.js | ||
+++ b/assets/js/player.js | ||
@@ -42,6 +42,15 @@ 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) { | ||
+ if (options.uri.includes("videoplayback")) { | ||
+ if (options.headers) { | ||
+ if (options.headers.Range) { | ||
+ 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')) |