Skip to content

Commit

Permalink
fix(TTML): Show background color with image subtitles (#6967)
Browse files Browse the repository at this point in the history
  • Loading branch information
avelad committed Jul 2, 2024
1 parent ab2f8fa commit e68fd55
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/text/ui_text_displayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,10 @@ shaka.text.UITextDisplayer = class {
style.backgroundSize = 'contain';
style.backgroundPosition = 'center';

if (cue.backgroundColor) {
style.backgroundColor = cue.backgroundColor;
}

// Quoting https://www.w3.org/TR/ttml-imsc1.2/:
// "The width and height (in pixels) of the image resource referenced by
// smpte:backgroundImage SHALL be equal to the width and height expressed
Expand Down

0 comments on commit e68fd55

Please sign in to comment.