diff --git a/lib/hls/hls_parser.js b/lib/hls/hls_parser.js index d0c62cc3b5..21b07f0db8 100644 --- a/lib/hls/hls_parser.js +++ b/lib/hls/hls_parser.js @@ -1195,6 +1195,8 @@ shaka.hls.HlsParser = class { } }); + const type = shaka.util.ManifestParserUtils.ContentType.TEXT; + // Set the codecs for text streams. for (const tag of subtitleTags) { const groupId = tag.getRequiredAttrValue('GROUP-ID'); @@ -1204,6 +1206,9 @@ shaka.hls.HlsParser = class { if (textStreamInfos) { for (const textStreamInfo of textStreamInfos) { textStreamInfo.stream.codecs = codecs; + textStreamInfo.stream.mimeType = + this.guessMimeTypeBeforeLoading_(type, codecs) || + this.guessMimeTypeFallback_(type); } } }