Commit Graph

1789 Commits

Author SHA1 Message Date
Casey Occhialini fe38e45f4d fix: Adds missing CMCD params to some http requests (#5072)
Fixes #5067
Fixes #5094

Co-authored-by: Dan Sparacio <daniel.sparacio@cbsinteractive.com>
2023-03-15 02:13:16 -07:00
Álvaro Velad Galván dfe263aa6a feat(Ads): Add ads config (#5085)
This doesn't produce any output right now, but this allow to the forks
to create custom configurations for ads, and also allow future
configurations to be added.
2023-03-14 19:18:19 +01:00
Casey Occhialini 50d0645a1e fix: Fallback to isTypeSupported when cast namespace is undefined (#5012)
Resolves #5010

---------

Co-authored-by: Dan Sparacio <daniel.sparacio@cbsinteractive.com>
2023-02-28 13:50:53 -08:00
theodab fbce38af1c feat(net): Added advanced type to filters (#5006)
This adds an optional parameter to request and response filters, of a
new enum called AdvancedRequestType.
This enum describes request types that are subtypes of the basic types.
For example, INIT_SEGMENT is a type of SEGMENT.
This gives users more information about the type of the request, while
maintaining backwards compatibility.

Closes #4966
2023-02-23 11:56:23 -08:00
Álvaro Velad Galván 2d0469fb4a fix(VTT): Fix spacing between text lines (#4961)
Fixes https://github.com/shaka-project/shaka-player/issues/4958

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Joey Parrish <joeyparrish@google.com>
2023-02-10 14:08:42 -08:00
Tom Bloom 9b1c614815 feat: Allow VTT files with erroneous linebreaks (#2394)
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>
2023-02-09 11:07:23 -08:00
Joey Parrish dc9bd27203 test: Add missing screenshots on Android (#4985)
I'm not sure how these were left out of the previous round of work on
the screenshot tests.

See
https://github.com/shaka-project/shaka-player/actions/runs/4133220258/jobs/7143870547
for an example of the failing nightly tests in the lab.
2023-02-09 09:29:58 -08:00
Álvaro Velad Galván d4fc54f8dc fix(WebVTT): Tags in the WebVTT subtitle are not parsed (#4960)
Fixes https://github.com/shaka-project/shaka-player/issues/4956
2023-02-03 11:11:23 +01:00
Albin Larsson ed7a736ca2 feat(webvtt): webvtt colors output (#4954)
Adds color support for SimpleTextDisplayer and WebVttGenerator (only one
place to fix both now thanks to #4941).

It's limited to the [8 colors
classes](https://w3c.github.io/webvtt/#default-text-color) supported by
the WebVTT specification, and also works with their 3 or 6-digit hex
variants (if the stream has TTML subtitles).

It does not support rgb, rgba or any colors other than these 8.

Fixes #4545

---------

Co-authored-by: Alvaro Velad Galvan <ladvan91@hotmail.com>
2023-02-03 09:34:16 +01:00
Tian Shao de6abde06f feat: Support Parallel Segment Fetching (#4784)
closes https://github.com/shaka-project/shaka-player/issues/4658.

This solution is inspired by abandoned PR
https://github.com/shaka-project/shaka-player/pull/2809, which
implements segment prefetching ahead of current play head.


![image](https://user-images.githubusercontent.com/3315733/205465795-75c605d2-c2e3-4d03-90f5-46a72a7189d2.png)
2023-01-31 20:08:29 +01:00
Álvaro Velad Galván b441518943 feat(DASH): Add support for <dashif:Laurl> (#4849)
Closes #4748
2023-01-30 16:08:34 -08:00
Joey Parrish f45631834d fix(WebVTT): Fix horizontal positioning with cue box size (#4949)
When the VTT size setting is used, the horizontal positioning was wrong
in both native and UI display.

The native display is wrong on Chrome and Edge because of a layout bug
in Chrome, where the shadow DOM for the cue box has conflicting
(redundant) styles. For example, these VTT settings:

`line: 85% position: 50% size: 63%`

result in these styles in the shadow DOM:

`top: 85%; left: 18.5%; transform: translate(-18.5%, -85%)`.

The `translate` style is what breaks the positioning. Unfortunately,
there is no way to fix that in JavaScript.

The UI display, however, was buggy for different reasons and is fixable.
The styles `left: 0; top: 0;` were applied by default, and then `top:
85%;` and `width: 63%;` were set based on the cue settings. The default
of `left: 0` was what broke the positioning. Removing this leaves `left`
set implicitly to `auto`, which is correct.

No other test cases were broken (or fixed) by this change.

This also adds a filter parameter to the lab workflow to run a subset of
tests for quicker results. This is useful for updating screenshots.

Closes b/259121343
2023-01-30 16:01:25 -08:00
Álvaro Velad Galván 2b50b88030 feat(HLS): Add HLS support for non-sequence mode (#4623) 2023-01-30 21:22:30 +01:00
Álvaro Velad Galván 056588b2e1 fix(DASH): Fix dynamic manifests from edgeware (#4914)
Fixes https://github.com/shaka-project/shaka-player/issues/4913

---------

Co-authored-by: Joey Parrish <joeyparrish@users.noreply.github.com>
Co-authored-by: Joey Parrish <joeyparrish@google.com>
2023-01-30 18:22:05 +01:00
Tiago Lopes 67a245129f feat(logs): Add extra logging for 3015 errors (#4932)
This adds extra context to 3015 (MEDIA_SOURCE_OPERATION_THREW) errors, by attaching
the error  on the media element. This is helpful because, in some situations, media source operations
can have very unhelpful exception strings like:
`Error: Failed to execute 'appendBuffer' on 'SourceBuffer': The HTMLMediaElement.error attribute is not null`
2023-01-27 16:30:21 -08:00
Álvaro Velad Galván d465942c43 feat(HLS): Improve detection of basic info from Media Playlist (#4809) 2023-01-26 23:46:46 -08:00
Joey Parrish 7c4ed53410 test: End-to-end WebVTT layout tests (#4935)
Many of these are rendered incorrectly in some way.

This PR contains only the tests, but not the screenshots, to make the
tests easier to review. The screenshots will appear in a separate PR.

Related to work on PR #4767
2023-01-26 14:09:16 -08:00
Joey Parrish 1bba2c549e test: End-to-end WebVTT layout screenshots (#4936)
Many of these are rendered incorrectly in some way.

This PR contains only the screenshots, to make the tests easier to
review in a separate PR.

Related to work on PR #4767
2023-01-26 11:04:59 -08:00
Álvaro Velad Galván 68968c17d8 fix(WebVTT): Fix voices with styles and support to multiple styles (#4922) 2023-01-24 19:53:48 +01:00
Joey Parrish 5b9d25325c chore: revert "Forbid MathML namespace in shaka.util.XmlUtils" (#4930)
Reverts shaka-project/shaka-player#4919
2023-01-24 09:33:16 -08:00
Álvaro Velad Galván 726ef425b0 fix(WebVTT): Add support to &nbsp;, &lrm; and &rlm; (#4920) 2023-01-20 23:41:51 +01:00
Joey Parrish 2043af0598 test: Reorganize screenshots in review tool (#4918)
Now screenshots are grouped by test for easy comparison across
platforms, and have an optional line break element between each set of
tests.

Related to work on PR #4767
2023-01-20 14:03:37 -08:00
Tobias Smolka 4bd3adc8cb fix: Forbid MathML namespace in shaka.util.XmlUtils (#4919)
This PR fixes #4912 by adding MathML to the list of forbidden
namespaces.
2023-01-20 13:22:05 +01:00
Joey Parrish da84a2c86b fix: Fix WebVTT parser failure on REGION blocks (#4915)
We do not yet support VTT region settings, but we should still not fail
when a region block appears in a VTT file.

Related to work on PR #4767
2023-01-19 11:53:22 -08:00
Joey Parrish ed47c60257 test: Preserve filters when reloading the review page (#4911)
Related to work on PR #4767
2023-01-19 10:51:20 -08:00
Álvaro Velad Galván a5f8b4361e feat(WebVTT): Add support to voice tag styles (#4845)
closes https://github.com/shaka-project/shaka-player/issues/4844
fixes https://github.com/shaka-project/shaka-player/issues/4843
fixes https://github.com/shaka-project/shaka-player/issues/4479
2023-01-19 11:35:21 +01:00
Joey Parrish a19c658088 test: Rewrite screenshot review tool (#4909)
This rewritten screenshot review tool is more dynamic and better
organized.

It is now easier to add additional test suites, and filtering can be
done dynamically by any attribute (platform, suite, or test).

Related to work on PR #4767
2023-01-18 13:11:37 -08:00
Joey Parrish dd860fab9f chore: Organize screenshots by suite (#4908)
There is currently only one suite, but that is about to change. This
renames all screenshots to include the name of the suite, and updates
the review page with a temporary hard-coded suite name.

Related to work on PR #4767
2023-01-17 15:47:40 -08:00
Joey Parrish dcc94b163f chore: Rename layout tests (#4907)
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
2023-01-17 15:31:39 -08:00
Joey Parrish d0a5366fbb chore: Factor out common code for layout tests (#4906)
This prepares us to create additional suites of layout tests

Related to work on PR #4767
2023-01-17 13:39:21 -08:00
Joey Parrish 3611f07d9f test: Fix surround sound test case on Tizen (#4893)
This test started failing on Tizen after PR #4858, which updates codecs
in manifest metadata any time they are rewritten. Since ac-3 is
rewritten as ec-3 on Tizen, that caused this test case covering ac-3 to
start failing (because the codec says ec-3 by the end of the test).
2023-01-13 09:34:31 -08:00
Joey Parrish 52f4b638b1 fix: Fix potential duplicate segments, AV sync issues (#4884)
Make SegmentIndex robust against rounding errors so that we don't end up
with duplicate segments on merge. In sequence mode, this would cause a
massive AV sync issue of 1 segment duration.

Issue #4589
2023-01-12 09:41:14 -08:00
Joey Parrish fc3d5c1447 fix(HLS): Fix discontinuity tracking (#4881)
Discontinuity tracking was broken and test coverage was insufficient to
catch this. This fixes the parsing and counting of discontinuities, and
replaces two outdated and useless tests with a new one that covers the
counting properly.

One of the old tests was checking that a timestamp offset was set for
each discontinuity, but this had become irrelevant since the test was
written. Discontinuities do not have anything to do with timestamp
offsets in current versions of Shaka Player.

The other old test was checking that after a discontinuity, we didn't
fetch a segment to parse out the timestamp, but we stopped doing that
entirely in v4.

The new test checks that the initial discontinuity sequence number is
honored, and that after a discontinuity, the number goes up. It also
checks that the correct number is extracted after an update. This test
fails without the fix, and passes with it.

This bug affected v4.2.6 and v4.3.2 only.

Issue #4589
2023-01-10 11:36:57 -08:00
theodab 26ba3a5070 test: Added test to detect lingering timers (#4872)
Issue #4850
2023-01-10 09:00:53 -08:00
Álvaro Velad Galván 452694d597 fix(HLS): Fix support for mixed AES-128/NONE decryption (#4847)
fixes https://github.com/shaka-project/shaka-player/issues/4846
2023-01-09 20:19:31 +01:00
Joey Parrish 6c16df8fef test: Consolidate emsg tests (#4693)
Some of the EMSG tests were redundant, and repeated for different
timestamps. Instead, run all EMSG tests with a non-zero timestamp
offset, since 0 is just a degenerate case.

This also consolidates all of the test vectors so that the tests are
easier to read.

Co-authored-by: Álvaro Velad Galván <ladvan91@hotmail.com>
2023-01-09 10:12:47 -08:00
Álvaro Velad Galván fac721df86 feat: Allow custom plugins for transmuxing (#4854) 2023-01-05 19:15:51 +01:00
David HM Morgan 5681efe95c fix: Treat regions uniquely (#4841)
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
2022-12-15 19:23:41 +01:00
Joey Parrish 35033bb2db fix(HLS): Fix AV sync over ad boundaries (#4824)
If server-side ad segments aren't aligned, AV could get out of sync by
accumulating errors in the timestampOffset of the SourceBuffers.

This improves the issue by tracking discontinuity boundaries and
resetting timestampOffset to theoretical segment start times when a
boundary is crossed.

Issue #4589
2022-12-13 10:14:17 -08:00
Joey Parrish 1bf5ef1cdd test: Fix StreamingEngine tests on Tizen (#4812)
For some unknown reason, using precise durations for these audio
segments on Tizen creates gaps that can't be survived. I don't know why
that creates a 150ms gap, and I don't know why we can't seem to jump
over it. It feels very much like a bug in Tizen itself.

Experimentally, I found that rounding these durations to 10s even
removes the gap completely. I tried many other things, but this is the
only reasonable thing I have found that works.

More details on my investigations can be found in the issue on GitHub.

This change in durations exposed some brittle tests in Player which had
to be adjusted to be more robust.

Closes #4806
2022-12-13 08:19:47 -08:00
Joey Parrish 715035cd27 test: Catch and print info from unhandled global exceptions (#4814)
Unhandled global exceptions already generate test failures, but this
adds specific useful information, like stack traces, to those failures.

See issue #4813
2022-12-11 17:47:43 -08:00
Joey Parrish bd75032d63 fix(TTML): Fix duplicate cues overlapping segment boundaries (#4798)
Closes #4631
2022-12-08 09:05:08 +01:00
Fredrik Höglin 2bc481decd fix(HLS): Fix missing roles (#4760)
Issue wasn't caught by the existing tests.

Closes #4759

Co-authored-by: Joey Parrish <joeyparrish@google.com>
2022-12-07 15:14:55 -08:00
David HM Morgan 4081434eba fix: Fix subtitles not added to DOM region (#4733)
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>
2022-12-07 14:23:12 -08:00
Álvaro Velad Galván b491a6b7ca feat: Move forceTransmux from streaming to mediasource config (#4783) 2022-12-07 11:52:12 -08:00
theodab 806a9a81c4 fix: Manually order key for decodingInfo cache (#4795) 2022-12-07 11:39:11 -08:00
Zhenghang Chen ad6c08561d perf: Caching mediaSource support for browser engine (#4778)
Caches the results of MediaSource.isTypeSupported, which is slow on some platforms, to reduce the
number of calls needed. This is especially helpful on manifests with many similar variants (multiple languages, etc).
Data collected from 2 months of practical testing shows that this helps reduce the start lag by 40% on Chromecast, 15% on WebOS, and 12% on Tizen.
2022-12-05 19:47:13 -08:00
theodab b7781f0446 feat: Cache mediaCapabilities.decodingInfo results (#4789)
Issue #4775
2022-12-05 18:12:21 -08:00
Albin Larsson b46012df64 feat: Enable variant failover for BAD_HTTP_STATUS and TIMEOUT (#4769)
This enables #4189 for two more error types. As mentioned in #4728 404
status results in `BAD_HTTP_STATUS` rather than `HTTP_ERROR`. I also
think `TIMEOUT` should be included, and another issue was just created
for this (#4764), so I included that as well.

Closes https://github.com/shaka-project/shaka-player/issues/4728
Closes https://github.com/shaka-project/shaka-player/issues/4764
2022-12-01 22:16:58 +01:00
Julian Domingo 5d6f56adf3 fix(cast): Use cast platform APIs in MediaCapabilties polyfill (#4727)
See https://github.com/shaka-project/shaka-player/issues/4726 for more
context.

This allows Cast devices to properly filter stream variants with a
resolution surpassing that of the device's capabilities.

We place the fix in the `MediaCapabilities` polyfill since it's intended
to be the right way to check for anything related to platform support.

HDR support checks will require `eotf=smpte2048`, as indicated in
https://github.com/shaka-project/shaka-player/issues/2813#issue-684874730.
Specifically, a `{hev|hvc}1.2` profile is only an *indication* of an HDR
transfer function, but *may* be a non-HDR 10-bit color stream.

In Cast, the platform can distinguish between the two by explicitly
providing the transfer function; it uses `smpte2048` (`"PQ"`) because
this is the "basis of HDR video formats..."
(https://en.wikipedia.org/wiki/Perceptual_quantizer).
2022-12-01 09:18:24 -08:00