Skip to content

Commit

Permalink
fix: Fix rendering of image subs when using SimpleTextDisplayer (#7258)
Browse files Browse the repository at this point in the history
This change prevents cues from being created without payload, as is the
case with subtitles in image format.
  • Loading branch information
avelad committed Sep 9, 2024
1 parent edd0b4b commit cafc7d1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/text/simple_text_displayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ shaka.text.SimpleTextDisplayer = class {
return false;
});

if (!containsCue) {
if (!containsCue && inCue.payload) {
const cue =
shaka.text.Utils.mapShakaCueToNativeCue(inCue);
if (cue) {
Expand Down
4 changes: 4 additions & 0 deletions lib/text/text_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ shaka.text.Utils = class {
}).join('');
}

if (!cue.payload) {
return cue.payload;
}

// Handle bold, italics and underline
const openStyleTags = [];
const bold = cue.fontWeight >= shaka.text.Cue.fontWeight.BOLD;
Expand Down

0 comments on commit cafc7d1

Please sign in to comment.