From 37baa33fc8f3c9e73bc04a7904fb940ba93e32f3 Mon Sep 17 00:00:00 2001 From: aler9 <46489434+aler9@users.noreply.github.com> Date: Thu, 29 Dec 2022 20:39:38 +0100 Subject: [PATCH] hls muxer: add workaround for bug on latest iPhone iOS In iPhone iOs 16.1.1, the EXT-X-PRELOAD-HINT file is requested without the last character, and "partXX.mp4" becomes "partXX.mp" --- internal/core/hls_server.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/internal/core/hls_server.go b/internal/core/hls_server.go index 7aec08c8..ba381b7d 100644 --- a/internal/core/hls_server.go +++ b/internal/core/hls_server.go @@ -285,7 +285,8 @@ func (s *hlsServer) onRequest(ctx *gin.Context) { dir, fname := func() (string, string) { if strings.HasSuffix(pa, ".m3u8") || strings.HasSuffix(pa, ".ts") || - strings.HasSuffix(pa, ".mp4") { + strings.HasSuffix(pa, ".mp4") || + strings.HasSuffix(pa, ".mp") { return gopath.Dir(pa), gopath.Base(pa) } return pa, "" @@ -297,6 +298,10 @@ func (s *hlsServer) onRequest(ctx *gin.Context) { return } + if strings.HasSuffix(fname, ".mp") { + fname += "4" + } + dir = strings.TrimSuffix(dir, "/") hreq := &hlsMuxerRequest{