Skip to content

Commit

Permalink
re-enable CEA-608 parser again (bugfix)
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephan Schreiner committed Aug 11, 2023
1 parent dfb9668 commit d0aaf3f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/dash/DashAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ function DashAdapter() {
patchManifestModel,
voPeriods,
currentMediaInfo,
constants;
constants,
cea608parser;

const context = this.context;

Expand All @@ -72,6 +73,9 @@ function DashAdapter() {
constants = config.constants;
}

if (config.cea608parser) {
cea608parser = config.cea608parser;
}
if (config.errHandler) {
dashManifestModel.setConfig({ errHandler: config.errHandler });
}
Expand Down Expand Up @@ -1031,6 +1035,9 @@ function DashAdapter() {
mediaInfo.subSegmentAlignment = dashManifestModel.getSubSegmentAlignment(realAdaptation);
mediaInfo.viewpoint = dashManifestModel.getViewpointForAdaptation(realAdaptation);
mediaInfo.accessibility = dashManifestModel.getAccessibilityForAdaptation(realAdaptation);
if (mediaInfo.accessibility.filter(function (accessibility) {
if (accessibility.schemeIdUri && (accessibility.schemeIdUri.search('cea-608') >= 0) && typeof (cea608parser) !== 'undefined') return true;
})[0]) mediaInfo.embeddedCaptions = true;
mediaInfo.audioChannelConfiguration = dashManifestModel.getAudioChannelConfigurationForAdaptation(realAdaptation);
if (mediaInfo.audioChannelConfiguration.length === 0 && realAdaptation.Representation && realAdaptation.Representation.length > 0) {
mediaInfo.audioChannelConfiguration = dashManifestModel.getAudioChannelConfigurationForRepresentation(realAdaptation.Representation[0]);
Expand Down
2 changes: 2 additions & 0 deletions test/unit/dash.DashAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,8 @@ describe('DashAdapter', function () {
expect(mediaInfoArray[0].accessibility[0]).to.be.instanceOf(DescriptorType);
expect(mediaInfoArray[0].accessibility[0].schemeIdUri).equals('urn:scte:dash:cc:cea-608:2015');
expect(mediaInfoArray[0].accessibility[0].value).equals('CC1=eng;CC3=swe');
expect(mediaInfoArray[0].embeddedCaptions).equals(true);

expect(mediaInfoArray[1].accessibility.length).equals(0);
});

Expand Down

0 comments on commit d0aaf3f

Please sign in to comment.