Improvements for very long HLS playlists

This commit is contained in:
Brahim Hadriche committed 2024-12-12 19:26:45 -05:00
1 parent bfc1439d1a
commit 357019d74b
3 files changed
+13 -1

No files matched your search

@@ -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
@@ -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