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

Fix parsing subtitle timestamps with no hour component #491

Merged
merged 2 commits into from
May 21, 2021

Conversation

trms-alex
Copy link
Contributor

@trms-alex trms-alex commented May 19, 2021

While working on my own implementation of #486, I discovered that the library already reads in every VTT segment file and should be rendering the subtitles just fine. The only problem with our example is actually that the timestamps aren't being parsed correctly due to a missing hour component (01:23.456 rather than 00:01:23.456 like the plugin currently expects).

Since both formats appear to be valid, I went ahead and added some code to interpret a missing hour component as 0 hours.

This small change allows the plugin to correctly render the captions in our example, but we've still yet to test segmented captions in a live stream (constantly-changing manifest).

As an aside, some of our segment VTT files are empty (except for the WEBVTT header) and throw (harmless) exceptions within the parsing code. I'm going to submit another PR (#492) that will filter out empty segments and cut down on the thrown/logged exceptions because this kind of file is also valid.

@jhomlala
Copy link
Owner

@trms-alex Thanks for detailed explantation. I'll merge it with next release.

@jhomlala jhomlala changed the base branch from master to feature/may_changes_3 May 21, 2021 20:14
@jhomlala jhomlala merged commit 20c5fc8 into jhomlala:feature/may_changes_3 May 21, 2021
jhomlala added a commit that referenced this pull request May 22, 2021
* Segmented ASMS subtitles loading

* Skip parsing subtitle files with no cues (#492)

* Fix parsing subtitle timestamps with no hour component (#491)

Co-authored-by: Jakub <jhomlala@gmail.com>

* General refactor, updated documentation and changelog

* General refactor, updated documentation and changelog

* Added spanish translation (#494)

* Added spanish translation

* Changed "EN VIVO" for "EN DIRECTO"

Co-authored-by: Koldo <kolod@byvapps.com>

* Lint fix, format, updated dependencies, general refactor

* Lint fix, format, updated dependencies, general refactor

* Updated changelog and normal player page

* Updated iOS example configuration, updated changelog

* Updated iOS example configuration, updated changelog

* Fixed iOS Picture in Picture play/pause state

* Format

* Readme and changelog update

Co-authored-by: Alex Page <50582909+trms-alex@users.noreply.github.com>
Co-authored-by: Koldo <koldoru92@gmail.com>
Co-authored-by: Koldo <kolod@byvapps.com>
geriby23 pushed a commit to threadable/betterplayer that referenced this pull request Jul 16, 2024
* Segmented ASMS subtitles loading

* Skip parsing subtitle files with no cues (jhomlala#492)

* Fix parsing subtitle timestamps with no hour component (jhomlala#491)

Co-authored-by: Jakub <jhomlala@gmail.com>

* General refactor, updated documentation and changelog

* General refactor, updated documentation and changelog

* Added spanish translation (jhomlala#494)

* Added spanish translation

* Changed "EN VIVO" for "EN DIRECTO"

Co-authored-by: Koldo <kolod@byvapps.com>

* Lint fix, format, updated dependencies, general refactor

* Lint fix, format, updated dependencies, general refactor

* Updated changelog and normal player page

* Updated iOS example configuration, updated changelog

* Updated iOS example configuration, updated changelog

* Fixed iOS Picture in Picture play/pause state

* Format

* Readme and changelog update

Co-authored-by: Alex Page <50582909+trms-alex@users.noreply.github.com>
Co-authored-by: Koldo <koldoru92@gmail.com>
Co-authored-by: Koldo <kolod@byvapps.com>
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.

2 participants