Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

revert: "fix(WebVTT): Fix wrong writing-mode in nested cues (#5641)" #5662

Merged
merged 1 commit into from
Sep 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/text/vtt_text_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,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 @@ -434,8 +436,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
Original file line number Diff line number Diff line change
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
Loading