Browse Source

hls muxer: change m3u8 Content-Type to application/x-mpegURL

pull/1198/head
aler9 3 years ago
parent
commit
680b348902
  1. 2
      internal/core/hls_source_test.go
  2. 2
      internal/hls/client_test.go
  3. 2
      internal/hls/muxer_primary_playlist.go
  4. 4
      internal/hls/muxer_variant_fmp4_playlist.go
  5. 2
      internal/hls/muxer_variant_mpegts_playlist.go

2
internal/core/hls_source_test.go

@ -54,7 +54,7 @@ func (ts *testHLSServer) onPlaylist(ctx *gin.Context) { @@ -54,7 +54,7 @@ func (ts *testHLSServer) onPlaylist(ctx *gin.Context) {
segment.ts
`
ctx.Writer.Header().Set("Content-Type", `audio/mpegURL`)
ctx.Writer.Header().Set("Content-Type", `application/x-mpegURL`)
io.Copy(ctx.Writer, bytes.NewReader([]byte(cnt)))
}

2
internal/hls/client_test.go

@ -122,7 +122,7 @@ func newTestHLSServer(ca string) (*testHLSServer, error) { @@ -122,7 +122,7 @@ func newTestHLSServer(ca string) (*testHLSServer, error) {
#EXTINF:2,
` + segment + "\n"
ctx.Writer.Header().Set("Content-Type", `audio/mpegURL`)
ctx.Writer.Header().Set("Content-Type", `application/x-mpegURL`)
io.Copy(ctx.Writer, bytes.NewReader([]byte(cnt)))
})

2
internal/hls/muxer_primary_playlist.go

@ -33,7 +33,7 @@ func (p *muxerPrimaryPlaylist) file() *MuxerFileResponse { @@ -33,7 +33,7 @@ func (p *muxerPrimaryPlaylist) file() *MuxerFileResponse {
return &MuxerFileResponse{
Status: http.StatusOK,
Header: map[string]string{
"Content-Type": `audio/mpegURL`,
"Content-Type": `application/x-mpegURL`,
},
Body: func() io.Reader {
var codecs []string

4
internal/hls/muxer_variant_fmp4_playlist.go

@ -221,7 +221,7 @@ func (p *muxerVariantFMP4Playlist) playlistReader(msn string, part string, skip @@ -221,7 +221,7 @@ func (p *muxerVariantFMP4Playlist) playlistReader(msn string, part string, skip
return &MuxerFileResponse{
Status: http.StatusOK,
Header: map[string]string{
"Content-Type": `audio/mpegURL`,
"Content-Type": `application/x-mpegURL`,
},
Body: p.fullPlaylist(isDeltaUpdate),
}
@ -247,7 +247,7 @@ func (p *muxerVariantFMP4Playlist) playlistReader(msn string, part string, skip @@ -247,7 +247,7 @@ func (p *muxerVariantFMP4Playlist) playlistReader(msn string, part string, skip
return &MuxerFileResponse{
Status: http.StatusOK,
Header: map[string]string{
"Content-Type": `audio/mpegURL`,
"Content-Type": `application/x-mpegURL`,
},
Body: p.fullPlaylist(isDeltaUpdate),
}

2
internal/hls/muxer_variant_mpegts_playlist.go

@ -101,7 +101,7 @@ func (p *muxerVariantMPEGTSPlaylist) playlistReader() *MuxerFileResponse { @@ -101,7 +101,7 @@ func (p *muxerVariantMPEGTSPlaylist) playlistReader() *MuxerFileResponse {
return &MuxerFileResponse{
Status: http.StatusOK,
Header: map[string]string{
"Content-Type": `audio/mpegURL`,
"Content-Type": `application/x-mpegURL`,
},
Body: p.playlist(),
}

Loading…
Cancel
Save