Browse Source

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"
pull/1342/head
aler9 3 years ago
parent
commit
37baa33fc8
  1. 7
      internal/core/hls_server.go

7
internal/core/hls_server.go

@ -285,7 +285,8 @@ func (s *hlsServer) onRequest(ctx *gin.Context) { @@ -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) { @@ -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{

Loading…
Cancel
Save