Skip to content

Commit

Permalink
fix(WebVTT): Fix text displayed out of picture and with overlapping l…
Browse files Browse the repository at this point in the history
…ines (#5662)

This reverts commit 56a4cea, PR #5641

Fixes #5661
  • Loading branch information
avelad authored and joeyparrish committed Sep 21, 2023
1 parent 971b2a0 commit 580b3f7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 19 deletions.
4 changes: 2 additions & 2 deletions lib/text/vtt_text_parser.js
Expand Up @@ -417,6 +417,8 @@ shaka.text.VttTextParser = class {
cue = new shaka.text.Cue(start, end, '');
}

VttTextParser.parseCueStyles(payload, cue, styles);

// Parse optional settings.
parser.skipWhitespace();
let word = parser.readWord();
Expand All @@ -430,8 +432,6 @@ shaka.text.VttTextParser = class {
word = parser.readWord();
}

VttTextParser.parseCueStyles(payload, cue, styles);

if (id != null) {
cue.id = id;
}
Expand Down
19 changes: 2 additions & 17 deletions test/text/vtt_text_parser_unit.js
Expand Up @@ -198,30 +198,15 @@ describe('VttTextParser', () => {
{
startTime: 40,
endTime: 50,
payload: '',
payload: 'Test2',
writingMode: Cue.writingMode.VERTICAL_LEFT_TO_RIGHT,
nestedCues: [
{
startTime: 40,
endTime: 50,
payload: 'Test',
writingMode: Cue.writingMode.VERTICAL_LEFT_TO_RIGHT,
},
{
startTime: 40,
endTime: 50,
payload: '2',
fontWeight: Cue.fontWeight.BOLD,
writingMode: Cue.writingMode.VERTICAL_LEFT_TO_RIGHT,
},
],
},
],
'WEBVTT\n\n' +
'00:00:20.000 --> 00:00:40.000 vertical:rl\n' +
'Test\n\n' +
'00:00:40.000 --> 00:00:50.000 vertical:lr\n' +
'Test<b>2</b>',
'Test2',
{periodStart: 0, segmentStart: 0, segmentEnd: 0, vttOffset: 0});
});

Expand Down

0 comments on commit 580b3f7

Please sign in to comment.