diff --git a/lib/hls/hls_parser.js b/lib/hls/hls_parser.js index f86d90bf21..a4470743d1 100644 --- a/lib/hls/hls_parser.js +++ b/lib/hls/hls_parser.js @@ -1793,7 +1793,13 @@ shaka.hls.HlsParser = class { goog.asserts.assert(tag.name == 'EXT-X-MEDIA', 'Should only be called on media tags!'); const languageValue = tag.getAttributeValue('LANGUAGE'); - const language = this.getLanguage_(languageValue); + let language = this.getLanguage_(languageValue); + if (!languageValue) { + const nameValue = tag.getAttributeValue('NAME'); + if (nameValue) { + language = nameValue; + } + } // The GROUP-ID value is a quoted-string that specifies the group to which // the Rendition belongs. @@ -1802,7 +1808,9 @@ shaka.hls.HlsParser = class { // The value of INSTREAM-ID is a quoted-string that specifies a Rendition // within the segments in the Media Playlist. This attribute is REQUIRED // if the TYPE attribute is CLOSED-CAPTIONS. - const instreamId = tag.getRequiredAttrValue('INSTREAM-ID'); + // We need replace SERVICE string by our internal svc string. + const instreamId = tag.getRequiredAttrValue('INSTREAM-ID') + .replace('SERVICE', 'svc'); if (!this.groupIdToClosedCaptionsMap_.get(groupId)) { this.groupIdToClosedCaptionsMap_.set(groupId, new Map()); }