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) Subtitles are shown stacked #3152

Merged
merged 1 commit into from
Feb 10, 2021
Merged

(fix) Subtitles are shown stacked #3152

merged 1 commit into from
Feb 10, 2021

Conversation

adgllorente
Copy link
Contributor

This PR solves issue #3151.

We've seen some SmartTVs show one subtitle without removing the previous one.

I think this is happening because two different subtitles may meet the condition of "greater or equal than" and "lower or equal than" at the same time. After changing the greater than or equal with a greater than subtitles were fixed.

Copy link
Member

@joeyparrish joeyparrish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks! I'm going to add a regression test to our screenshot-based UI layout tests after this is merged.

@shaka-bot
Copy link
Collaborator

All tests passed!

@joeyparrish joeyparrish merged commit d97b09f into shaka-project:master Feb 10, 2021
shaka-bot pushed a commit that referenced this pull request Feb 12, 2021
In issue #3151, some TVs showed subtitles stacked on one another when
one should have expired.  This only occurred on some platforms because
it required very specific values for video.currentTime at the exact
moment the UI text displayer calculated visibility.  Limited precision
on video.currentTime on some platforms may have exposed the edge case,
but it was always possible.

PR #3152 fixed the issue by correcting the visibility calculation.
Cue end times should be excluded from their visibility range, i.e.
(start, end].

This adds a new regression test for this edge case using our
screenshot-based layout tests.  Note that the behavior can only be
controlled when we control text display through the UI.  When using
native text display from the browser, the exact visibility and
interpretation of timing is entirely up to the browser.  As of Feb
2021, Chrome, Edge, and Safari all do it wrong, and Firefox does it
right.

Change-Id: I2cdb8a2a759960d5ed8ce8790bf9daaeb2a335eb
@joeyparrish
Copy link
Member

joeyparrish commented Feb 13, 2021

JFYI, Chrome, Edge, and Safari all get this wrong in their native cue rendering. FF & IE/legacy Edge get it right.

I filed these issues with the browser vendors to make the same/similar fix in the browser for native cue display:

joeyparrish pushed a commit that referenced this pull request Feb 25, 2021
We've seen some SmartTVs show one subtitle without removing the previous one.

I think this is happening because two different subtitles may meet the condition of "greater or equal than" and "lower or equal than" at the same time. After changing the greater than or equal with a greater than subtitles were fixed.

@joeyparrish will add a regression test after this fix.

Closes #3151
joeyparrish added a commit that referenced this pull request Feb 25, 2021
In issue #3151, some TVs showed subtitles stacked on one another when
one should have expired.  This only occurred on some platforms because
it required very specific values for video.currentTime at the exact
moment the UI text displayer calculated visibility.  Limited precision
on video.currentTime on some platforms may have exposed the edge case,
but it was always possible.

PR #3152 fixed the issue by correcting the visibility calculation.
Cue end times should be excluded from their visibility range, i.e.
(start, end].

This adds a new regression test for this edge case using our
screenshot-based layout tests.  Note that the behavior can only be
controlled when we control text display through the UI.  When using
native text display from the browser, the exact visibility and
interpretation of timing is entirely up to the browser.  As of Feb
2021, Chrome, Edge, and Safari all do it wrong, and Firefox does it
right.

Backported to v3.0.x

Change-Id: I2cdb8a2a759960d5ed8ce8790bf9daaeb2a335eb
joeyparrish pushed a commit that referenced this pull request Mar 10, 2021
We've seen some SmartTVs show one subtitle without removing the previous one.

I think this is happening because two different subtitles may meet the condition of "greater or equal than" and "lower or equal than" at the same time. After changing the greater than or equal with a greater than subtitles were fixed.

@joeyparrish will add a regression test after this fix.

Closes #3151
@github-actions github-actions bot added the status: archived Archived and locked; will not be updated label Jul 25, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: archived Archived and locked; will not be updated
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants