Skip to content

Commit

Permalink
fix(HLS): Fix display CEA-708 in HLS (#5694)
Browse files Browse the repository at this point in the history
Fixes #5627
  • Loading branch information
avelad authored and joeyparrish committed Oct 4, 2023
1 parent 10b03e7 commit ed1d954
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions lib/hls/hls_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -1781,7 +1781,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.
Expand All @@ -1790,7 +1796,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());
}
Expand Down

0 comments on commit ed1d954

Please sign in to comment.