Commit Graph

4529 Commits

Author SHA1 Message Date
Joey Parrish 1aed3f18c7 build: Fix linter error introduced by #3649 (#4147) 2022-04-21 16:09:13 -07:00
Nbcl adc3502d55 feat(ui): Add quality selection for audio-only content (#3649)
Replaces resolution menu with audio quality menu when content is audio-only.

Fixes: #2071
2022-04-21 15:43:51 -07:00
Joey Parrish d1699de19b test: Fix Safari tests hanging in GitHub Actions environment (#4144)
Fixed upstream in shaka-project/karma-local-wd-launcher#38

Closes #3967
2022-04-21 08:52:36 -07:00
Álvaro Velad Galván 19e12b5e28 feat(hls): make a head request if hls subtitles have no extension (#4140)
Closes https://github.com/shaka-project/shaka-player/issues/4135 
Closes https://github.com/shaka-project/shaka-player/issues/1959
2022-04-20 14:23:54 -07:00
Joey Parrish 14355ee6d7 test: Tweak StreamingEngine test timeouts (#4138)
This seems to improve some intermittent test failures on Safari.
2022-04-19 21:29:50 -07:00
Joey Parrish 1eadfd1e20 test: Improve TextDisplayer test reliability and timing (#4136)
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.
2022-04-19 10:47:39 -07:00
Joey Parrish 9543b8af5f test: Deflake StreamingEngine tests on Firefox (#4139)
There was an exception to waitForEnd in StreamingEngine tests that
could have been handled generically inside the waiter for all tests.

It was also necessary to poll for ended state since the Firefox 99 update.

This fixes some recent test failures on Firefox 99.
2022-04-19 10:14:28 -07:00
Joey Parrish cc351a3d91 test: Add debug info to failure messages in test waiter (#4137)
This should help debug flakiness and failures in StreamingEngine tests
on Safari and Firefox.
2022-04-18 19:50:24 -07:00
Álvaro Velad Galván 42eecc84f9 feat(hls): parse EXT-X-GAP (#4134)
Parse EXT-X-GAP HLS tag and add a status enum to shaka.media.SegmentReference.

shaka.media.SegmentReference.Status.AVAILABLE --> Normal behaviour
shaka.media.SegmentReference.Status. UNAVAILABLE --> Related to https://github.com/shaka-project/shaka-player/issues/2541
shaka.media.SegmentReference.Status. MISSING --> EXT-X-GAP in HLS

Note: only the parsing is added, but the functionality is not yet implemented.

Issue https://github.com/shaka-project/shaka-player/issues/1308
2022-04-18 10:22:30 -07:00
Joey Parrish 4fecfb9652 ci: Re-enable tests on Tizen (#4131)
Our Tizen device is finally back online in the lab!
2022-04-18 09:21:43 -07:00
dependabot[bot] 65b3a2fc1f build(deps): bump async from 2.6.3 to 2.6.4 (#4132)
Bumps [async](https://github.com/caolan/async) from 2.6.3 to 2.6.4.
- [Release notes](https://github.com/caolan/async/releases)
- [Changelog](https://github.com/caolan/async/blob/v2.6.4/CHANGELOG.md)
- [Commits](https://github.com/caolan/async/compare/v2.6.3...v2.6.4)

---
updated-dependencies:
- dependency-name: async
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-15 09:46:06 -07:00
Joey Parrish a540fec627 ci: Fix typo in demo index workflow (#4130)
Closes #4074
2022-04-15 08:40:56 -07:00
Joey Parrish 783db97778 ci: Cancel old test runs when a PR is updated (#4127)
If another instance of the build-and-test workflow is started for the
same PR, cancel the old one.  If a PR is updated and a new test run is
started, the old test run will be cancelled automatically to conserve
resources.
2022-04-14 10:08:10 -07:00
Joey Parrish b11bec0e2d ci: Fix generation of demo index by fetching all history (#4126)
The demo index generation is now based on the git tags.  So when
checking out the repo to generate the index, the entire history is
needed.

Closes #4074
2022-04-14 10:01:18 -07:00
Álvaro Velad Galván 0fd19997dd feat!: Remove small/large gap config, always jump gaps (#4125)
We get rid of the "small/large" gap concept, to always jump gaps by default

Related to issue https://github.com/shaka-project/shaka-player/issues/3188#issuecomment-788173036
2022-04-13 11:00:47 -07:00
sr90 b83b4120f4 feat(dash): Construct ClearKey PSSH based on MPD ContentProtection (#4104)
This PR parses default_KID from ContentProtection in the manifest and constructs a PSSH box from it to feed to the ClearKey CDM only if clear key content is detected.

Example: 

```
<ContentProtection
    schemeIdUri="urn:mpeg:dash:mp4protection:2011" value="cenc"
    cenc:default_KID="9eb4050d-e44b-4802-932e-27d75083e266" />
<ContentProtection
    value="ClearKey1.0" schemeIdUri="urn:uuid:e2719d58-a985-b3c9-781a-b030af78d30e">
         <clearkey:Laurl Lic_type="EME-1.0">https://drm-clearkey-testvectors.axtest.net/AcquireLicense</clearkey:Laurl>
 </ContentProtection>
```

PSSH is based on https://www.w3.org/TR/eme-initdata-cenc/

Tested content: 
https://media.axprod.net/TestVectors/v7-MultiDRM-SingleKey/Manifest_1080p_ClearKey.mpd
2022-04-13 08:34:39 -07:00
Álvaro Velad Galván 85ee031496 chore: remove goog.require('shaka.polyfill.MathRound') in uncompiled (#4124)
Related https://github.com/shaka-project/shaka-player/pull/4114
2022-04-13 08:25:42 -07:00
Joey Parrish ead344fe1f chore: Drop MS EME polyfill (#4123)
The MS EME polyfill has been unused since v3.1 and removal of IE support, and isn't needed for Edge or Xbox One support.

Closes #4113
2022-04-12 21:15:14 -07:00
Joey Parrish d8b3341720 test: Run tests on a custom Selenium grid (#4117)
Includes a YAML config file for our lab, and documentation on how to
create a custom config for another Selenium grid.

A workflow will run tests nightly in the Shaka lab, using a
self-hosted runner with access to our private grid.

The workflow can also be triggered manually by maintainers to test a
PR in the lab.  This will report status back to the PR.
2022-04-12 11:32:59 -07:00
Joey Parrish 80e7f7ba55 ci: Fix demo index deployment (#4122)
Fixes these issues with the demo index deployment (tested by manual deployment):

 - Missing `handlers:` field in app.yaml
 - Missing handler for the URL `/`
 - Missing Flask entrypoint (even though no dynamic content is generated by it)

Closes #4074
2022-04-12 11:32:14 -07:00
Joey Parrish 2eca4b2ef5 ci: Generate static content for demo index at deploy time (#4119)
Rather than runtime-querying of appengine versions within the
appengine environment, we can instead generate the index at deployment
time (from git tags) and just serve static content.  This simplifies
the system and avoids dependence on Google Cloud.

This was less feasible before we adopted GitHub Actions, but is now
relatively simple.  The index will be regenerated when the index code
is updated or when a new release is created.

Closes #4074
2022-04-12 10:10:41 -07:00
Joey Parrish ac5acc80cb feat!: Remove deprecated features, update upgrade guides (#4089)
Below are the changelog entries for each deprecated feature removed by this commit.

-----

feat(config)!: `manifest.dash.defaultPresentationDelay` has been replaced by `manifest.defaultPresentationDelay` (deprecated in v3.0.0)

feat(config)!: Configuration of factories should be plain factory functions, not constructors; these will not be invoked with `new` (deprecated in v3.1.0)

feat(player)!: `shaka.Player.prototype.addTextTrack()` has been replaced by `addTextTrackAsync()`, which returns a `Promise` (deprecated in v3.1.0)

feat(ui)!: `shaka.ui.TrackLabelFormat` has been renamed to `shaka.ui.Overlay.TrackLabelFormat` (deprecated in v3.1.0)

feat(ui)!: `shaka.ui.FailReasonCode` has been renamed to `shaka.ui.Overlay.FailReasonCode` (deprecated in v3.1.0)

feat(offline)!: `shaka.offline.Storage.prototype.store()` returns `AbortableOperation` instead of `Promise` (deprecated in v3.0.0)

feat(offline)!: `shaka.offline.Storage.prototype.getStoreInProgress()` has been removed; concurrent operations are supported, so callers don't need to check this (deprecated in v3.0.0)

feat!: `shaka.util.Uint8ArrayUtils.equal` has been replaced by `shaka.util.BufferUtils.equal`, which can handle multiple types of buffers (deprecated in v3.0.0)

feat(manifest)!: `shaka.media.SegmentIndex.prototype.destroy()` has been replaced by `release()`, which is synchronous (deprecated in v3.0.0)

feat(manifest)!: `shaka.media.SegmentIterator.prototype.seek()`, which mutates the iterator, has been replaced by `shaka.media.SegmentIndex.getIteratorForTime()` (deprecated in v3.1.0)

feat(manifest)!: `shaka.media.SegmentIndex.prototype.merge()` has become private; use `mergeAndEvict()` instead (deprecated in v3.2.0)

feat(plugin)!: `AbrManager` plugins must implement the `playbackRateChanged()` method (deprecated in v3.0.0)

feat(plugin)!: `shaka.extern.Cue.prototype.spacer` has been replaced by the more clearly-named `lineBreak` (deprecated in v3.1.0)

feat(plugin)!: `IUIElement` plugins must have a `release()` method (not `destroy()`) (deprecated in v3.0.0)
2022-04-11 17:11:40 -07:00
theodab fe8b9ab2c1 fix(demo): Fix default demo index versions (#4116)
The script for deploying the demo version index page has a function
that chooses which versions to display. This script has a special
mode meant for testing that shows a default list of demo versions.
This mode was only supposed to trigger when run locally, but the
check did not work properly, so the demo version index was deploying
with a very out-of-date list of versions.
This fixes that check.

Closes #4074

<!--
Please remember to:

1. Use Conventional Commits syntax (fix: ..., feat: ..., etc.) in commits and
   PR title (https://www.conventionalcommits.org/)
2. Tag any related or fixed issues ("Issue #123", "Closes #420")
3. Sign the Google CLA if you haven't (https://cla.developers.google.com)

You may delete this comment from the PR description.
-->
2022-04-11 16:46:20 -07:00
Álvaro Velad Galván 8bb70449d3 feat!: Remove support for Safari 12 and iOS 12 (#4112)
1. Remove support for Safari 12
2. Support modern EME in Safari 13
3. Remove EME Apple polyfill
4. Update documentation
2022-04-11 16:17:51 -07:00
Joey Parrish fbbd63d96b test: Late load tests, fix Chromecast test flake (#4115)
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
2022-04-11 15:47:48 -07:00
Álvaro Velad Galván 169943f668 chore: remove mathround polyfill (used in IE) (#4114) 2022-04-11 13:15:04 -07:00
Joey Parrish 044375bda4 build(demo): Minimize goog.require in demo_uncompiled.js (#4111)
Rather than require everything, require only the top-level classes for
the demo, and let them require their dependencies.  This is consistent
with how this works in the library itself.

Related to issue #4094
2022-04-11 09:04:09 -07:00
Joey Parrish e6a80940c0 build: Add missing provide/require in demo (#4110)
The demo sources didn't properly provide/require the shakaAssets
namespace.  This caused issues when I tried to change the way demo
sources were loaded in tests.

Related to issue #4094
2022-04-11 09:03:52 -07:00
Joey Parrish 748585ede4 test: Fix Jasmine 4 deprecation warnings (#4109)
Jasmine 4 deprecated some part of its custom matcher API.

This puts us in compliance with the new API (by omitting a parameter
we didn't really need), and silences the deprecation warnings (which
only showed up when enabling logging in the tests).
2022-04-11 09:03:40 -07:00
Joey Parrish 6b833c0301 build: Don't ignore failures to generate deps (#4108)
Since transitioning from the deprecated depswriter.py to the new
closure-make-deps tool in 6f274cbc, the build system has been ignoring
any failures in the generation of deps.js.  This is because the new
tool doesn't return a proper non-zero exit code when it fails.  (See
https://github.com/google/closure-library/issues/1162)

This changes the build scripts to check for empty output instead,
which seems to be reliable for the moment.
2022-04-11 09:03:24 -07:00
Álvaro Velad Galván 57c73241a0 fix(performance): Eliminate use of ES6 generators (#4092)
See: https://github.com/shaka-project/shaka-player/issues/4062#issuecomment-1077826210

Co-authored-by: @joeyparrish

Issue #4062
2022-04-04 10:58:16 -07:00
theodab 8a3bed710c feat(HLS): Re-add TS support to Safari (#4097)
It appears that the problems we previously had with TS content
on Safari have been fixed. We no longer need the workaround where
we transmuxed TS on that platform.
2022-04-01 20:32:12 -07:00
Philippe f382cc702b feat: add option for segment-relative VTT timings (#4083)
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>
2022-04-01 09:39:11 -07:00
Joey Parrish cabb17a44c ci: Test on Safari 14 (#4095)
In the GitHub Actions environment, it is now possible to install and
run tests on Safari 14.  Though not completely straightforward, it
doesn't add much code to the workflow and shouldn't be too difficult
to maintain.

Closes #3899
2022-04-01 07:56:23 -07:00
theodab 7ecbe05381 chore(HLS): Refactor unused bandwidth parameter (#4090) 2022-03-30 19:47:29 -07:00
Joey Parrish ca08230fbe fix: Fix exceptions when quickly shutting down src= on Safari (#4088)
Some events and timers were used to process track changes with src=
playback on Safari, but they did not properly clean up when the player
was unloaded or destroyed.  In the case that this happened quickly
after starting playback, exceptions would be thrown or tracks could
manipulated after new content began.

This fixes the cleanup of these timers and events to be aware of
Player unloads or destruction.

Closes #4087
2022-03-30 19:26:41 -07:00
Joey Parrish 9660ce85df fix: Fix broken deps file generation on Windows (#4086)
This fixes broken deps file generation on Window by upgrading to a
pre-release version of the deps tool.  The upstream issue was filed in
https://github.com/google/closure-library/issues/1159 and fixed in
https://github.com/google/closure-library/pull/1160.

This issue has never affected a release version of Shaka Player, and
was introduced when we switched deps tools in 6f274cbc.

Closes #4085
2022-03-30 19:25:55 -07:00
Joey Parrish d9a1ec0a63 test: Update Safari native text screenshots (#4084) 2022-03-30 17:29:05 -07:00
theodab 48dd20562c fix(hls): Support playing media playlists directly (#4080)
Closes #3536
2022-03-30 17:27:50 -07:00
sr90 19e24b1d74 feat(dash): Parse ClearKey license URL in MPD (#4066)
Example content protection tags parsed: 

```xml
<ContentProtection schemeIdUri="urn:mpeg:dash:mp4protection:2011" value="cenc" cenc:default_KID="<default key id>" />
<ContentProtection value="ClearKey1.0" schemeIdUri="urn:uuid:e2719d58-a985-b3c9-781a-b030af78d30e">
    <clearkey:Laurl Lic_type="EME-1.0">License Url</clearkey:Laurl>
```

The player parses the default key id and license url, 
and sends a POST request to license url as per https://w3c.github.io/encrypted-media/#clear-key-request-format to retrieve the decryption key/s.
2022-03-30 09:10:14 -07:00
Álvaro Velad Galván 400575498f fix(cmcd): Fix Symbol usage in CMCD on Xbox One (#4073)
Close #4072

Co-authored-by: Joey Parrish <joeyparrish@users.noreply.github.com>
2022-03-29 16:04:26 -07:00
Joey Parrish 3822519c0c test: Update Xbox One native text screenshots (#4079)
In a recent firmware update, the native rendering of text changed on Xbox One.
2022-03-29 14:35:01 -07:00
Joey Parrish 5c81f3bddb fix: Fix playRangeEnd for certain content (#4068)
For content where the manifest parser uses the notifySegments API
(DASH SegmentBase/SegmentList/SegmentTimeline, or HLS, but not DASH
SegmentTemplate+duration), the Player seekRangeEnd configuration was
not being honored correctly.

This fixes the issue in PresentationTimeline and adds a regression
test to our playRangeStart/playRangeEnds tests.

Fixed #4026
2022-03-29 10:57:37 -07:00
Joey Parrish 62c60527bc ci: Fix Docker build (#4078)
This fixes the workflow job failing because of missing sources, and it
also fixes the job to run the compiler, not just build the image that
_could_ run the compiler.

Closes #4076
2022-03-29 10:56:57 -07:00
Joey Parrish 55eab2198c chore: Upgrade HTMLHint to new version with vulnerability fixed (#4071)
We were using a pre-release version of the same for a while, but this
is the same fix in an official release.
2022-03-29 09:37:23 -07:00
Álvaro Velad Galván 298b60481d fix(dash): Fix performance regression (#4064)
See: https://github.com/shaka-project/shaka-player/issues/4062#issuecomment-1077826210
2022-03-25 13:56:38 -07:00
theodab 89409cee3e feat(hls): Read EXT-X-PROGRAM-DATE-TIME (#4034)
This makes the HLS parser read the EXT-X-PROGRAM-DATE-TIME value
on manifests, and use it to make sure that segments are inserted at
the correct place in the timeline, when in sequence mode.

Issue #2337
2022-03-24 15:58:53 -07:00
Joey Parrish 2c5457bbec build: Fix build failure after Closure upgrade (#4063)
6f274cbc dropped a deprecated Closure build tool, but also upgraded
the Closure compiler and Closure library.  This introduced a failure
caused by a duplicate extern in the newer compiler.

This drops the now-unnecessary extern.

<!--
Please remember to:

1. Use Conventional Commits syntax (fix: ..., feat: ..., etc.) in commits and
   PR title (https://www.conventionalcommits.org/)
2. Tag any related or fixed issues ("Issue #123", "Closes #420")
3. Sign the Google CLA if you haven't (https://cla.developers.google.com)

You may delete this comment from the PR description.
-->
2022-03-24 15:01:50 -07:00
Joey Parrish 6f274cbc97 build: Stop using deprecated tool to generate closure deps (#4060)
The depswriter.py tool from google-closure-library was generating
deprecation warnings.  This switches to a newer, rewritten version
called google-closure-deps.
2022-03-23 15:08:01 -07:00
Álvaro Velad Galván 33e84009dc fix(UI): Add cursor pointer to range elements (#4059)
Since range elements are special input elements, they must reflect user
interaction, so when the user hovers over the range element, the cursor must be a pointer.

Issue #3220
2022-03-23 09:56:13 -07:00