From e41b484e5867886be89f31b630b5aa19168a9fb6 Mon Sep 17 00:00:00 2001 From: Brahim Hadriche Date: Wed, 4 Jan 2023 09:55:40 -0500 Subject: [PATCH] Add hls proxied url --- src/components/VideoPlayer/VideoPlayer.bs | 10 +++++++++- src/components/VideoPlayer/VideoPlayerSponsorBlock.bs | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/components/VideoPlayer/VideoPlayer.bs b/src/components/VideoPlayer/VideoPlayer.bs index e16c03d0..1c33822e 100644 --- a/src/components/VideoPlayer/VideoPlayer.bs +++ b/src/components/VideoPlayer/VideoPlayer.bs @@ -105,7 +105,15 @@ function OnVideoDetailsTaskResults(output as object) as void playletStreamUrls = [] if metadata.hlsUrl <> invalid - playletStreamUrls.push(metadata.hlsUrl) + hlsUrl = metadata.hlsUrl + playletStreamUrls.push(hlsUrl) + + if hlsUrl.InStr("?") = -1 + hlsUrlLocal = hlsUrl + "?local=true" + else + hlsUrlLocal = hlsUrl + "&local=true" + end if + playletStreamUrls.push(hlsUrlLocal) else if metadata.dashUrl <> invalid diff --git a/src/components/VideoPlayer/VideoPlayerSponsorBlock.bs b/src/components/VideoPlayer/VideoPlayerSponsorBlock.bs index e08899d2..1e7d5667 100644 --- a/src/components/VideoPlayer/VideoPlayerSponsorBlock.bs +++ b/src/components/VideoPlayer/VideoPlayerSponsorBlock.bs @@ -122,7 +122,7 @@ function OnPositionChangeSkipSponsorBlockSections() as void if (segmentStart < currentPosition) and ((segmentEnd - 1) > currentPosition) ' TODO: if segmentEnd is at the end of the video, close video m.top.seek = segmentEnd - print("Skiping section:" + segment["category"]) + print("Skipping section:" + segment["category"]) SendSkippedSectionEvent(segment.UUID) return end if