From 357019d74b96656e3ac44f00d6aa49e2c08b67ad Mon Sep 17 00:00:00 2001 From: Brahim Hadriche Date: Thu, 12 Dec 2024 19:26:45 -0500 Subject: [PATCH] Improvements for very long HLS playlists --- CHANGELOG.md | 4 ++++ playlet-lib/src/components/VideoPlayer/VideoContentTask.bs | 4 ++++ .../components/Web/PlayletWebServer/Middleware/HlsRouter.bs | 6 +++++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1423a04e..d2c92dbc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Support for age restrcited videos and private videos when cast from YouTube app (logged in) - Note: it works when the video is explicitely cast. If it was added to queue, or added as part of a playlist, this might not work. +### Fixed + +- Improved on issue with long videos (10+ hours) showing as 2:30 only. They now show about 5 hours. + ## [0.32.1] - 2024-12-03 ### Fixed diff --git a/playlet-lib/src/components/VideoPlayer/VideoContentTask.bs b/playlet-lib/src/components/VideoPlayer/VideoContentTask.bs index c260de09..63a34de6 100644 --- a/playlet-lib/src/components/VideoPlayer/VideoContentTask.bs +++ b/playlet-lib/src/components/VideoPlayer/VideoContentTask.bs @@ -64,6 +64,10 @@ function VideoContentTask(input as object) as object end if streamUrls = CreateStreamUrls(metadata, service, preferencesNode, backend, playletServerPort) + ' Forwarding query params to HLS playlists is not needed. In fact, it can cause issues + ' because the playlist is limited to 4MB, and on large playlists the query params + ' significantly increase the size of the playlist, making it cropped. + contentNode.ForwardQueryStringParams = false contentNode.addFields({ metadata: metadata ' StreamUrls is taken diff --git a/playlet-lib/src/components/Web/PlayletWebServer/Middleware/HlsRouter.bs b/playlet-lib/src/components/Web/PlayletWebServer/Middleware/HlsRouter.bs index 7fe04e10..2cf6217e 100644 --- a/playlet-lib/src/components/Web/PlayletWebServer/Middleware/HlsRouter.bs +++ b/playlet-lib/src/components/Web/PlayletWebServer/Middleware/HlsRouter.bs @@ -24,6 +24,7 @@ namespace Http hlsRequest = HttpClient.Get(url) headers = request.headers + ' Host is probably 127.0.0.1 so we should remote it before hitting the server headers.Delete("Host") hlsRequest.Headers(headers) @@ -43,7 +44,10 @@ namespace Http hlsManifest = m.AppendStoryboardPlaylists(hlsManifest) response.http_code = hlsResponse.StatusCode() - response.headers = hlsResponse.Headers() + headers = hlsResponse.Headers() + ' We responding with uncompressed data + headers.Delete("Content-Encoding") + response.headers = headers response.SetBodyDataString(ValidString(hlsManifest)) return true