Skip to content

Commit

Permalink
fix: Fix handling of CC when switching between codecs (shaka-project#…
Browse files Browse the repository at this point in the history
  • Loading branch information
avelad committed Apr 19, 2023
1 parent bd9df5a commit 6937325
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/media/media_source_engine.js
Expand Up @@ -739,7 +739,8 @@ shaka.media.MediaSourceEngine = class {
}
if (hasClosedCaptions && contentType == ContentType.VIDEO) {
if (!this.textEngine_) {
this.reinitText('text/vtt', this.sequenceMode_);
this.reinitText(shaka.util.MimeUtils.CEA608_CLOSED_CAPTION_MIMETYPE,
this.sequenceMode_);
}
if (!this.captionParser_) {
this.captionParser_ = this.getCaptionParser(mimeType);
Expand Down
1 change: 1 addition & 0 deletions lib/text/text_engine.js
Expand Up @@ -139,6 +139,7 @@ shaka.text.TextEngine = class {
// into TextEngine and TextDisplayer.
if (mimeType == shaka.util.MimeUtils.CEA608_CLOSED_CAPTION_MIMETYPE ||
mimeType == shaka.util.MimeUtils.CEA708_CLOSED_CAPTION_MIMETYPE) {
this.parser_ = null;
return;
}

Expand Down

0 comments on commit 6937325

Please sign in to comment.