With reference to #8025, this is a partial proposal to see if this style
of extensible customisation could be favourable to the shaka-player
community:
Proposal for some accessibility options whereby an App builder can
customise subtitle/caption size, with the potential of an App offering
accessibility options for text size.
This style could be used for other text styling attributes in a similar
way, but this is just the first step.
---------
Co-authored-by: Álvaro Velad Galván <ladvan91@hotmail.com>
Also fixes a compiler error that comes up for some reason when renaming
the other tests. The compiler will accept an assignment to nestedCues,
but not pushing to it. I was unable to fix the missing type information
for this.
Related to work on PR #4767
Captions split over stream segment boundaries are repeated over more
than one segment.
Regions in which they sit maybe described the same but allocated
different ids and vice versa.
Proposal to treat internal region ids uniqely by encoding the dimensions
in the id.
fixes#4839
Reinstate previously removed region elements when next caption finds it
is not there: Detect the absence and ensure `updateDOM` is true so its
reinstated and the next caption can be shown.
Closes#4680
Co-authored-by: Joey Parrish <joeyparrish@users.noreply.github.com>
Both TTML and VTT regions should be thought of as separate elements
from the cue structures they contain. To this end, the UI text
displayer now creates separate region elements to represent CueRegion
objects, and the Cues attached to them nest inside those region
elements in the DOM.
Closes#4381
This seems to reduce flakiness in the TextDisplayer tests. The
theory is that Safari throttles timers when the system is very busy,
which it often is during full test runs across multiple browsers. By
not relying on timers and triggering an explicit update in the
TextDisplayer, the tests seem to become more reliable.
This change fixes tests on Chromecast by loading tests later in the process. Test scripts are now dynamically inserted by boot.js, rather than loaded by Karma. The bootstrapping code then awaits the completion of that before starting the Karma frameworks (Jasmine) to run the tests.
This also removes the use of goog.provide/goog.require in tests and test utils. We don't need to load test utils or library sources dynamically in each test, and this gives us more explicit control over script loading and ordering.
Closes#4094
Previously, in the updateCaptions_ method in the UI text displayer,
when trying to determine if a cue should be removed from the container,
we checked to see if it was out of the time range.
This worked in most cases, but it did have the side-effect that the
displayer would not remove the old cues if they were removed manually
via the remove() method. This was most visible if the user changed the
text language; the currently-displayed cue of the old language would
linger until it reached the point it would stop displaying normally.
This changes the UI text displayer to force an update when remove() is
called, if necessary.
Change-Id: I84a4847b67c5fb7597342a943abe13a3cc9e826e
First, the positioning of cues was incorrect. We need to explicitly
set all the position attributes when we position elements with the
"absolute" position.
Second, if we position a text <span> manually, the background will fill
the whole region. So to keep the background wrapping the text, we need
to add another <span> for the text.
Third, the background and font color should not be set on every <span>
element since it won't allow parent cues to set the inherited value.
So this moves the defaults to the top-level text element and allows
parent cue elements to override this. It also would make app CSS
easier to override. Because background color isn't inherited through
CSS, the default is set in JavaScript instead.
Fixes#3521Fixes#3600Closes#3713
Change-Id: I45fc88dcac4a0a062e1474087f24c80d98eef619
A new UI test added in a recent CL involved manually setting the
currentTime value of a videoElement in tests.
For some reason that wasn't working on Safari, so this changes that
UI test to use a fake video instead of a real one.
Closes#3689
Change-Id: I412f677f6cda49bbfc850a9102edfe3b75bca302
Previously, we added support for respecting the time constraints
of nested cues. However, the UI text displayer did not take the
time constraints of nested cues into account when determining when
and how to update the cues.
This changes the UI text displayer to also do that.
Issue #3524
Issue #3643
Change-Id: I6b643f2aa21f367a8e40a8aca2ebb62492c071c2
This uses flexbox once again to get proper positioning of cues. To
compensate for the issues that originally made us remove flexbox, this
adds a wrapper span inside the flexbox element.
Summary of screenshot changes:
- slight change to background sizing
- ui-basic-cue
- ui-cue-with-controls
- ui-duplicate-cues
- ui-end-time-edge-case
- ui-flat-cue-bg
- ui-two-basic-cues
- background fills block with literal newline in text
- ui-cue-with-newline
- region anchored without padding
- ui-region-position
- new screenshots
- *-nested-cues-with-linebreak
- *-region-with-display-alignment (regression test for this issue)
Closes#3379
Change-Id: I8c678721d96662e0f8940cda12df4f5b5e5baf1e
Old versions of Chromium, which may be found in certain versions of
Tizen and WebOS, may require the prefixed version of "writingMode":
"webkitWritingMode".
However, testing shows that Tizen 3, at least, has a "writingMode"
property, but the setter for it does nothing.
Therefore, instead of just detecting the existence of the property, we
need to additionally check if setting it had any effect. If it is
either missing or non-functional, then we fall back to the prefixed
version of the property. This fixes the functionality on Tizen 3.
We also need to change the conditions we check for in the tests, since
property existence is not enough to set the correct test expectation.
See also PR #3330
Change-Id: Ic906f3c5af956b5edd1788e95e1978eb4b3098ac
Using flex layout causes problems with the positioning of elements and
causes the borders to be wrapped over the whole parent. This changes
to use block/inline layouts instead.
This also removes any padding around the cue lines, hugging the
background around the text. This is a bit more consistent with other
renderers by having a gap between lines. This also changes a bit of
the nested cues padding.
The deeply nested cue test is different because the `background-color`
CSS attribute isn't inherited, so the default in our CSS sets the
background to black.
Fixes#3013
Change-Id: I3e4b63b1b4de1f12e69fce2460d142e0a69bfcd9
The duplicate cues check did not account for nested cues, which could
cause some inputs to be erroneously filtered out. This uses a more
detailed check that includes all properties.
Change-Id: I517be17a8f7377f8840f102d26d515baa327530a
Changes:
- Update comments on shaka.extern.Cue to clarify how fields should be
used and interpreted
- Add support for arbitrarily-deep nested cues in both text
displayers
- Stop adding whitespace between nested cues (parsers should emit
exactly what they want displayed) and update tests to match
- Remove obscure special cases from UITextDisplayer styles and make
styling consistent with the Cue docs
- Fix rendering for single line break (cue.spacer) elements
- Add a layout test for deeply-nested cues
- Remove reundant and identical set of UITextDisplayer unit tests
- Update layout test for backgrounds to reflect the clarified rules
- Update remaining UITextDisplayer unit tests to look for div instead
of span for top-level cues
- Updates screenshots for region-position, which changed slightly in
appearance due to changes in whitespace rules
- Updates screenshots for nested-cue-bg, to reflect simplified rules
for applying backgrounds
TODO:
- Temporarily breaks TTML output until the TTML parser can be updated
to conform to the clarified rules in the Cue docs
- Still more special cases around regions in UITextDisplayer
- Rendering for multiple line break elements in UITextDisplayer
- Support bold, italic, and underline in SimpleTextDisplayer
- None of the displayers will honor the wrapLine field yet
Closes#2762 (extra vertical space seen for line breaks)
Issue #2761 (deeply-nested cues)
Change-Id: I02ac8213e4de67a65fb38d596d2c59536f3722ee
This corrects/normalizes license headers in misc. files, such as
config files, docs, build tools, tests, and externs. This does not
affect the compiled output, and is only done for consistency.
Issue #2638
Change-Id: I9d8da2de55243b08d7df2b743aac73c6f15e858a
In player, SimpleTextDisplayer was set as the default TextDisplayer. In
our UI, it changes the configuration to use the UITextDisplayer, and
UITextDisplayer gets constructed with the player. Later in our demo, it
resets the config, so an extra SimpleTextDisplayer gets constructed.
This introduces an extra TextTrack created by SimpleTextDisplayer.
This change sets the UITextDisplayer as the default TextDisplayer in
player's default config.
Closes#2516
Change-Id: I3f653be9fad8b2edbc2fb9de84e8abb327dcfc51