Skip to content

fix: parse WebVTT cues with settings - #243

Open
itboy87 wants to merge 1 commit into
kdroidFilter:masterfrom
itboy87:fix/webvtt-cue-settings
Open

fix: parse WebVTT cues with settings#243
itboy87 wants to merge 1 commit into
kdroidFilter:masterfrom
itboy87:fix/webvtt-cue-settings

Conversation

@itboy87

@itboy87 itboy87 commented Aug 5, 2026

Copy link
Copy Markdown

Summary

  • allow WebVTT cue timing lines to contain standard cue settings
  • preserve existing parsing behavior for timing and subtitle text
  • add regression coverage for STYLE metadata and line/vertical settings

Previously, the parser required the first timing line to fully match a timestamp-only regex. Valid lines such as:

00:00:01.000 --> 00:00:03.000 line:0

were skipped, resulting in an empty cue list.

Testing

  • ./gradlew :mediaplayer:jvmTest --tests 'io.github.kdroidfilter.composemediaplayer.subtitle.WebVttParserTest'
  • ./gradlew :mediaplayer:ktlintCheck

Reproduction samples

These public WebVTT files reproduce the issue:

They contain valid cue settings such as line:0, line:-1, and vertical:rl. Previously, the parser skipped the first timing line because it required the timestamp-only pattern to match the entire line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant