For HLS CMAF streams with WebVTT subtitles with large timestamps, the
rollover wrapping prevents the cues from being shown at the correct
time.
By adding a check to only do the wrapping for MPEG-TS streams this
problem is eliminated.
fixes#10020
This PR:
- replaces `splice` with an index variable to avoid array shifts on every cue parse
- replaces `slice(1).join('\n')` with a manual loop to eliminate two intermediate allocations per cue
- hoists inline regex literals to static class constants, fixing unreliable literal caching in older Chromium version (helps TV devices and Xbox)
Fixes#8278
Migrates deprecated rules from `eslint-config-google` and our rules as
well to stylistic.
Additionally removes broken `eslint-disable` python check and replaces
with eslint `reportUnusedDisableDirectives` option.
This moves VTT sequence mode offset calculations into a method.
It also makes all X-TIMESTAMP-MAP usage dependent on HLS specifically,
rather than sequence mode, simplifying the conditions. Sequence mode is
typically only used with HLS, and X-TIMESTAMP-MAP is explicitly only for
HLS. So excluding X-TIMESTAMP-MAP for DASH makes sense, instead of
conflating HLS and sequence mode.
This required updating some tests to explicitly set both the manifest
type and sequence mode flag.
This does *not* change the offset calculations themselves. Changes will
be made in follow-up PRs.
Issue #6320
## Background:
The native DOM Parser can perform poorly on some older devices, this
approach is faster on newer devices but is considerably better on older
devices.
This PR replaces the usage of the DOM Parser for DASH, MSS, VTT and
TTML.
The draw back of this approach that it does not include any validation
at the cost of better performance.
Bad linebreaks will now cause cues to be skipped (with a warning),
rather than throwing an error.
Closes#2358
Co-authored-by: Álvaro Velad Galván <ladvan91@hotmail.com>
When multiple style blocks exist for the same selector, they should be
combined. For example,
::cue(b) { background: white; }
::cue(b) { color: blue; }
should set both the background and foreground of bold tags.
Subtitle timing and offsets were not calculated correctly for HLS live
streams. This issue appears to have affected all v4.x releases up to
v4.0.5, v4.1.5, and v4.2.2.
Since the transition to sequence mode for HLS in v4.0.0, VTT cue
timings were broken. This is mainly because VTT cue timing in HLS is
meant to be based on an offset from the media timestamps, and we
generally don't know those now that we use sequence mode.
To fix it, this change uses MediaSource segment mode for the very
first video segment as a way to extract the timestamp, then clears the
buffer, switches to sequence mode, and appends it again. This lets us
get the timing data we need, while avoiding major drawbacks of the
previous HLS implementation:
- We don't need to fetch segments upfront (which is high latency)
- We don't need to fetch segments twice (once for timestamps, and
once again to buffer)
- We don't need to maintain parsers (which were complex and limited
the formats we could support)
Closes#4191
This PR fixes#3242 where for some live streams using segmented VTT, text timings are relative to segment start instead of being absolute.
The PR introduces a new setting: `manifest.segmentRelativeVttTiming: boolean` allowing such alternative timing offset calculation.
The setting is off by default, preserving the current player behaviour.
Co-authored-by: Joey Parrish <joeyparrish@users.noreply.github.com>
When running in sequence mode, we ignore the normal timestamps
of video and audio segments. This lead to problems in some Apple-
encoded webvtt content, which used the X-TIMESTAMP-MAP tag to account
for the timestamp offsets in their video. Thus, those subtitles would
end up 10 seconds offset.
This changes the webvtt parser to ignore the X-TIMESTAMP-MAP when in
sequence mode.
Issue #2337
1. Add support for multiple layers of nested cues.
2. Add support for anonymous span.
Closes#2623Closes#2761
Change-Id: I10a253b1a965606fc2db49c3168e92bcf4a95fa1