Skip to content

fix(subtitle): handle VTT positioning directives in subtitle parsing#19

Open
abdelaziz-mahdy wants to merge 1 commit intodsc-uob:masterfrom
abdelaziz-mahdy:extra-fix-for-vtt
Open

fix(subtitle): handle VTT positioning directives in subtitle parsing#19
abdelaziz-mahdy wants to merge 1 commit intodsc-uob:masterfrom
abdelaziz-mahdy:extra-fix-for-vtt

Conversation

@abdelaziz-mahdy
Copy link
Contributor

This pull request improves the handling of VTT subtitle parsing in the SubtitleParser class to better support VTT-specific directives. The main change is to ensure that positioning and styling directives in VTT subtitle lines are skipped, so only the actual subtitle text is extracted.

Subtitle parsing improvements:

  • Updated SubtitleParser logic to detect VTT directives (e.g., line, align, position, etc.) in group 10 and, when present, extract subtitle text from group 11 instead. This prevents directives from being misinterpreted as subtitle text.

Test case update:

  • Modified the VTT subtitle test input to include a line: 20% directive, ensuring the parser correctly skips the directive and extracts only the subtitle text.

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