mirror of
https://github.com/TeamPiped/Piped.git
synced 2024-08-14 23:57:27 +00:00
support path in proxyURL
This commit is contained in:
parent
78f0372707
commit
39aed28700
1 changed files with 5 additions and 3 deletions
|
@ -207,7 +207,9 @@ export default {
|
||||||
this.shaka.polyfill.installAll();
|
this.shaka.polyfill.installAll();
|
||||||
|
|
||||||
const localPlayer = new this.shaka.Player(videoEl);
|
const localPlayer = new this.shaka.Player(videoEl);
|
||||||
const proxyHost = new URL(component.video.proxyUrl).host;
|
const proxyURL = new URL(component.video.proxyUrl)
|
||||||
|
const proxyHost = proxyURL.host;
|
||||||
|
const proxyPath = proxyURL.pathname;
|
||||||
|
|
||||||
localPlayer.getNetworkingEngine().registerRequestFilter((_type, request) => {
|
localPlayer.getNetworkingEngine().registerRequestFilter((_type, request) => {
|
||||||
const uri = request.uris[0];
|
const uri = request.uris[0];
|
||||||
|
@ -220,13 +222,13 @@ export default {
|
||||||
) {
|
) {
|
||||||
url.searchParams.set("host", url.host);
|
url.searchParams.set("host", url.host);
|
||||||
url.host = proxyHost;
|
url.host = proxyHost;
|
||||||
request.uris[0] = url.toString();
|
request.uris[0] = proxyPath + url.toString();
|
||||||
}
|
}
|
||||||
if (url.pathname === "/videoplayback") {
|
if (url.pathname === "/videoplayback") {
|
||||||
if (headers.Range) {
|
if (headers.Range) {
|
||||||
url.searchParams.set("range", headers.Range.split("=")[1]);
|
url.searchParams.set("range", headers.Range.split("=")[1]);
|
||||||
request.headers = {};
|
request.headers = {};
|
||||||
request.uris[0] = url.toString();
|
request.uris[0] = proxyPath + url.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue