diff --git a/lib/hls/hls_parser.js b/lib/hls/hls_parser.js index a94d4753e5..63efa9a60e 100644 --- a/lib/hls/hls_parser.js +++ b/lib/hls/hls_parser.js @@ -945,6 +945,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'); @@ -954,6 +956,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); } } }