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
When there is no X-TIMESTAMP-MAP header, the HLS spec states that the
client should map 0 to 0, effectively. That means we were wrong to
offset the cues by the segment time.
Since DASH IOP states that segmented text should be packaged in MP4,
this should not affect compliant DASH content.
Closes#2714
Change-Id: Iddb00f2fd1afeb4f0f2c99f92f65e5db0e3a84f1
This fixes all the license headers in the main library, which corrects
the appearance of the main license in the compiled output.
It seems that the `!` in the header forces the compiler to keep it in
the output. I believe older compiler releases did this purely based
on `@license`.
Issue #2638
Change-Id: I7f0e918caad10c9af689c9d07672b7fe9be7b2f3
Instead of having the "factories" use "new" to construct them, now they
will be plain functions.
Closes#1521
Change-Id: Ia6151ad679a78a5c6db128d43094c82add0af348