feat(media): forward WMV live transcode options to CarrierNode

streamMediaIdentifier now forwards only the quality and start query parameters to CarrierNode, so browser-unplayable WMV/ASF video can stream as a seekable live H.264 copy. Other query parameters are not forwarded, and audio-only playback is unchanged.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
Claude Code committed 2026-11-18 13:51:54 +01:00
1 parent 7f21bb9073
commit 9e58b6db01
2 files changed
+35 -1

No files matched your search

+17 -1
View File
@@ -135,7 +135,23 @@ func (c *Service) streamMediaIdentifier(w http.ResponseWriter, r *http.Request,
writeError(w, http.StatusNotFound, "media not found")
return
}
c.carrierNode.Proxy(w, r, "/media/"+upstream)
c.carrierNode.Proxy(w, r, streamUpstreamPath(upstream, r.URL.Query()))
}
// streamUpstreamPath is the CarrierNode request path for a stream. CarrierNode answers with a live
// H.264 copy when the query carries quality (a height) and start (seconds), which is how browsers get
// containers they cannot decode. Those two parameters are the only ones forwarded.
func streamUpstreamPath(upstream string, query url.Values) string {
forward := url.Values{}
for _, key := range []string{"quality", "start"} {
if value := strings.TrimSpace(query.Get(key)); value != "" {
forward.Set(key, value)
}
}
if len(forward) == 0 {
return "/media/" + upstream
}
return "/media/" + upstream + "?" + forward.Encode()
}
func (c *Service) thumbnailMediaByQuery(w http.ResponseWriter, r *http.Request) {