Commit Graph

4464 Commits

Author SHA1 Message Date
Joey Parrish b275cb591d test: Minimize file globs served by test runner (#4031)
This was originally supposed to help resolve "too many open file"
errors in the test runner, but we could not prove that this made any
difference.  Still, it doesn't seem to hurt.  Tests start up ~6%
faster (several seconds difference on my workstation).
2022-03-16 15:06:49 -07:00
Álvaro Velad Galván abe846e1a3 feat(DRM): add drmInfo to license requests (#4030)
Adds drmInfo field to all LICENSE-type requests.

Based on comments here: https://github.com/shaka-project/shaka-player/issues/4001#issuecomment-1050655197
2022-03-16 11:10:33 -07:00
Álvaro Velad Galván f1eeac1efb feat: add new methods to FairPlayUtils (#4029)
This adds 3 new methods to FairPlayUtils:

- isFairPlaySupported --> Closes PR #3562
- spcFairPlayRequest --> This method adds basic spc FairPlay request filter
- commonFairPlayResponse --> This method adds a basic FairPlay response filter that supports a lot of DRM providers.
2022-03-16 11:05:29 -07:00
Joey Parrish f5f517759f chore(deps): Upgrade less to v4 (prerelease) (#4028)
In #3991, I changed the syntax of our colors to a modern rgba syntax.
For example, rgba(255, 255, 255, 0.85) would become rgba(255 255 255 /
85%). However, less v3 seems not to understand that properly, and
performs division on the last two parts, resulting in output of
rgba(255 255 3%), which is indeed invalid.

This fixes the issue by upgrading to less v4, which understands the
new rgba syntax and leaves it alone. The output for that will now
match the input.

To work around an issue with less v4, this uses a prerelease version
with a fix for https://github.com/less/less.js/issues/3693 . See also
https://github.com/tomas/needle/issues/391

This doesn't affect any release branches, since #3991 hasn't been
cherry-picked.

Closes #4027
2022-03-15 14:53:54 -07:00
Álvaro Velad Galván f2f24d528f fix(ttml): Center subtitles by default (#4023)
Closes: https://github.com/shaka-project/shaka-player/issues/4015
2022-03-10 13:11:50 -08:00
Dulmandakh 3a6daa1b1f refactor: remove node version check (#4019)
This PR removes the check for **npm** command version.  v6 is implicitly required by the `npm ci` command.
2022-03-09 11:31:11 -08:00
Joey Parrish 847744cede ci: Revert to upstream release-please-action (#4018)
The fix we needed has now been released there.
2022-03-08 16:43:16 -08:00
Joey Parrish 1507b1e844 chore: Update URLs after moving projects (#4008) 2022-03-03 14:34:40 -08:00
Shaka Bot d6bdf9a4c2 chore: Sync common workflows (#4003)
This is an automated sync of common workflows for this organization.
The upstream source is:
https://github.com/shaka-project/shaka-github-tools/commit/b39597e92d44c25ae64ab15a963ec74a4c7269ed

Co-authored-by: Shaka Bot <shaka-bot@users.noreply.github.com>
2022-02-28 21:13:15 -08:00
Álvaro Velad Galván 2687b95d58 fix(cea): make a more robust CEA MP4 parser (#3965)
Fix a HLS error reported in https://github.com/google/shaka-player/issues/2337#issuecomment-1040389975

Tested with https://devstreaming-cdn.apple.com/videos/streaming/examples/bipbop_adv_example_hevc/master.m3u8
2022-02-24 13:27:18 -08:00
theodab c438e857f2 fix(hls): Fixed buffering issue with live HLS (#4002)
HLS now appends segments in sequence mode. In order to handle seeks,
we set the timestampOffset property on SourceBuffer to the startTime of
the segment. This is done after every seek, or on startup.

For non-sequence-mode content (DASH), we normally set timestampOffset
based on the Period structure.  This should be suppressed in sequence
mode, though, where only the reference startTime matters.

The buffering issue was caused by two things in combination:

1. The HLS parser set meaningless timestampOffset values that would
change when a playlist was updated
2. We would use those timestampOffset values in setStreamProperties,
even though this should be skipped in sequence mode

These two things in combination would lead MediaSourceEngine to start
inserting segments near the start of the presentation, rather than at
the live edge.

This changes MediaSourceEngine so that in sequence mode, timestampOffset
is ignored in setStreamProperties.  This also cleans up the HLS parser
to set each reference's timestampOffset to 0, since they should be
ignored anyway.
2022-02-24 11:43:30 -08:00
Shaka Bot 5894b8cd3f chore: Sync common workflows (#3997)
This is an automated sync of common workflows for this organization.
The upstream source is:
https://github.com/joeyparrish/shaka-github-tools/commit/82c303a994400013debc05aa30e988ddbefbbb36

Co-authored-by: Shaka Bot <shaka-bot@users.noreply.github.com>
2022-02-23 17:28:57 -08:00
Joey Parrish 4aab0cc0ba build: Replace less-plugin-clean-css and htmlhint with forks (#3995)
These projects have vulnerable dependencies, but are not being
properly maintained.  This replaces both with forks that have upgraded
their deps.

This brings the NPM audit vulnerability count from 6 to 0.
2022-02-23 13:01:47 -08:00
Joey Parrish bbca5e9773 ci: Rename workflows (#3996)
Now that we are building tools to keep common workflows in sync across
repos, we should use the same names across repos.  This brings Shaka
Player workflow names in line with everything else.

See https://github.com/joeyparrish/shaka-github-tools/pull/5
2022-02-23 08:31:42 -08:00
Joey Parrish c318a11caa build: Update jsdoc fork (#3994)
This updates the jsdoc fork to one based on the latest jsdoc.  (The
fork adds features for tutorial sorting.)

We also have an in-repo fork of the default jsdoc template from 2019.
The newer default template no longer includes the same dependencies,
so three deps we used to get transitively from jsdoc are now explicit
at the shaka-player level: open-sans-fonts, code-prettify, and
color-themes-for-google-code-prettify.  This is appropriate, since the
dependency comes from our in-repo fork of the default template.

This upgrade brings our NPM audit vulnerabilities from 10 to 6.
2022-02-22 16:22:48 -08:00
Joey Parrish cef918d190 ci: Fix several release workflow bugs (#3992)
1. When release-please creates release PRs, it removes the -uncompiled
tag in the version number in lib/player.js.  This adds a step to the
workflow to maintain the player.js version manually.

2. This also adds a new job that tags the master branch after a
release PR is merged.  We maintain the -master tags on the master
branch corresponding to each release so that it is easier to manage
the range of commits for cherry-picks.

3. The "npm ci" step was failing because our package-lock.json was not
compatible with v12 of NodeJS.  This updates our workflow to use v16.
The npm release workflow has now been tested in a fork up until the
publish step.

4. The tagging and GitHub release publication parts of the workflow
were previously failing due to an issue with release-please parsing
the branch name.  This has now been fixed, and is awaiting an upstream
merge.  For now, we can use my forked version.

Closes #3968 (branch parsing failure)
Issue #3969 (npm release is now tested up to the publish step)
Closes #3971 (master branch tags)
Closes #3974 (missing -uncompiled in lib/player.js)
2022-02-22 16:02:25 -08:00
Joey Parrish a5e9ed61eb build: Upgrade CSS linter (#3991)
The new version requires additional configuration for less syntax, and
has new default rules we were out of compliance with.

I disabled rules about avoiding explicit vendor prefixes (such as
"-webkit") because we are not using any auto-prefixer tools.  Other
violations have been fixed:

 - kebab-case for element ids
 - quotes around URLs
 - double quotes instead of single quotes
 - disable class selector pattern matching for MDL (external)
 - use modern rgb/rgba syntax
 - no quotes on font families
 - no long-hand when short-hand will do

This brings our NPM audit vulnerabilities from 20 down to 10.
2022-02-22 14:16:22 -08:00
Joey Parrish fe6b924e51 ci: Simplify PR template (#3993)
The old template is bulky and does not reflect the new workflows we
have on GitHub.  All that is really critical is that users start using
Conventional Commits syntax and tag issue numbers.
2022-02-22 14:15:58 -08:00
Joey Parrish a67cb6ed00 build: Downgrade less (#3982)
Downgrade less to v3.  v4 is failing on macOS for some reason.  See
less/less.js#3693

This also makes some less/CSS changes that are useful for future
upgrades:

 - wrap all calculations in calc(), which is required in less v4
 - remove unneeded @transparent variable

Finally, this fixes an erroneous error message that said "extern
generation failed" instead of "CSS compilation failed".

Closes #3981
2022-02-22 08:46:54 -08:00
JH d2368779b6 test: Validate custom license server option in test.py (#3605)
Fixes #3079

When running custom asset tests with the custom license server parameter, it is easy to make mistakes on the argument value. The `--test-custom-license-server` option expects the user to pass in a key-value pair of `KEYSYSTEM_ID=LICENSE_SERVER_URL`. This change checks if the provided value has `KEYSYSTEM_ID` as its key through a custom argparse type.
2022-02-18 11:29:09 -08:00
Joey Parrish a2c853522f build: Update babel (#3979)
This updates babel and its various plugins and associated modules,
which brings our NPM audit vulnerability count from 24 to 20.
2022-02-18 11:28:36 -08:00
Joey Parrish d99ab7959d build: Update eslint (#3977)
Also fixes linter errors found by the new versions
2022-02-18 08:26:43 -08:00
Álvaro Velad Galván 0daa00fc7f feat!(hls): HLS disabled in old browsers/platforms due to incompatibilities (#3964)
In Tizen 2/3 and WebOS 3.x there is no support for SourceBuffer.mode=sequence so as a result of change #2337, it necessary disable support for the HLS parser so that the user can at least use the native one with src= .
2022-02-17 19:52:36 -08:00
Joey Parrish c482e81ad9 build: Update Closure Compiler (#3976)
This updates the compiler and closure library to the latest releases.
This required a few small tweaks:

 - Drop custom extern for WebCrypto (now built into the compiler)
 - Remove require() in cea parser, only used in `throws` annotations
 - Hack around a typing issue in a fake version of TextTrack in tests
2022-02-17 18:55:49 -08:00
wjywbs a6d8610241 fix: Select first of identical audio streams (#3869)
If a manifest lists 2 audio streams, select the first acceptable stream instead of the last one. For example below, previously the 2nd stream was selected, and now the first stream will be selected. Other players like roku, video.js and exoplayer select the first one.

```
#EXT-X-MEDIA:TYPE=AUDIO,URI="stream_1.m3u8",GROUP-ID="default-audio-group",NAME="128k",AUTOSELECT=YES,CHANNELS="2"
#EXT-X-MEDIA:TYPE=AUDIO,URI="stream_2.m3u8",GROUP-ID="default-audio-group",NAME="64k",CHANNELS="2"
(video streams snipped)
```
2022-02-17 13:59:08 -08:00
Joey Parrish 49fbcb4e5a build: Update most dev dependencies (#3973)
Most dependencies are not used in Shaka Player itself, but in our
build and test infra or in our demo app.  Still, GitHub reported 29
potential vulnerabilities in these deps, and NPM reported 37.

The changes below being NPM's audit report from 37 down to 24
vulnerabilities.

Detailed updates:
 - Dropped explicit deps for transitive dependencies that we no longer
   need to update for ourselves:
   - ua-parser-js (via karma)
 - Dropped because we no longer need them:
   - karma-ie-launcher
 - Updated to latest versions:
   - awesomplete
   - core-js
   - dialog-polyfill
   - htmlhint
   - jimp
   - karma*
   - less
   - pwacompat
   - rimraf
   - tippy.js
   - which
 - Updated as far as possible without code or config changes in Shaka:
   - mux.js
   - stylelint*
 - Still needs an update:
   - *babel*
   - eslint
   - eslint-config-google
   - google-closure-compiler
   - google-closure-library

Some of the vulnerabilities stem from stylelint, babel, and others
that haven't been updated yet, so follow-up work is needed to address
those with breaking updates.

mux.js is actually used at runtime (optional), so it was only updated
to the latest non-breaking release.
2022-02-17 13:52:24 -08:00
Joey Parrish 65035e0364 build: Update version parsing to match new release automation (#3972)
We double-check the version in the changelog to make sure it matches
the npm and player versions.  But with our new release automation, we
have a new changelog format.  This updates the parsing so that release
checks can succeed.
v3.1.6-master v3.2.4-master
2022-02-17 12:17:08 -08:00
Joey Parrish 3fe8a3b947 ci: Test PRs against release branches, too (#3961) v3.3.2-master 2022-02-16 15:09:25 -08:00
Joey Parrish b7f04cb36b fix: Fix memory leak in DASH live streams with inband EventStream (#3957)
EventStreams in DASH generate TimelineRegionInfo objects, which are
then stored in the RegionTimeline and RegionObserver classes.  But
DashParser would add all regions to RegionTimeline, even if they would
be quickly removed again, and RegionObserver would cache some regions
from the timeline without ever removing them.

This fixes the issue from both of those directions.  DashParser will
now ignore regions that are outside the DVR window (and therefore
would soon be removed from RegionTimeline), and RegionObserver listens
to an event on RegionTimeline to clean up its own storage when regions
fall outside the DVR window during playback.

Closes #3949 (memory leak in DASH live streams with inband EventStream)
2022-02-16 14:02:54 -08:00
theodab a4e926772e fix(text): Fix webvtt offset in sequence mode (#3955)
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
2022-02-16 11:38:20 -08:00
Joey Parrish e49c849321 refactor: Replace callbacks with events (#3953)
Three classes (RegionTimeline, RegionObserver, and QualityObserver)
were all designed with callbacks instead of events.  A single callback
is inflexible compared to events, which allow multiple listeners.  We
already have a long-standing and robust event system, so why not use
it?

Issue #3949 (memory leak in DASH live streams with inband EventStream)
2022-02-15 17:23:40 -08:00
Joey Parrish 6023878c8d ci: Fix typo in dry_run parameter for sync-labels (#3956) 2022-02-15 17:05:01 -08:00
Joey Parrish b2a8fcdfaa ci: Add missing token parameter to sync-labels workflow (#3954) 2022-02-15 15:01:05 -08:00
Joey Parrish f1c1585afb fix: Add explicit release() for FakeEventTarget (#3950)
Before, we would count on all event listeners for FakeEventTargets to
be cleaned up by the object that listens.  Now, FakeEventTarget
implements IReleasable, so that all listeners are removed when owners
call release().

For objects extending FakeEventTarget and also implementing
IDestroyable, the destroy() methods will call out to super.release()
to clean up listeners then.  The owner should use destroy() in those
cases.

Issue #3949 (memory leak in DASH live streams with inband EventStream)
2022-02-15 12:06:26 -08:00
Joey Parrish 46bb67bf56 ci: Synchronize issue labels using a central configuration (#3951) 2022-02-15 12:05:16 -08:00
Joey Parrish f04b8558d7 ci: Expand PR title validation triggers (#3946)
Force-pushes from automated PRs (like release-please) do not seem to
trigger any of the normal PR triggers (opened, edited, synchronize).
In fact, even an exhaustive list of types will not work.  So here we
add triggers for reviews, so that the validation will run after
someone approves such a PR.  This is critical since this is a required
status check in most of our repos.  If the workflow doesn't run, the
release PR can't be merged.
2022-02-14 11:20:18 -08:00
Joey Parrish e2ec5ebd52 ci: Add workflow for automated release PRs (#3942)
This includes a temporary config file to bootstrap the workflow for
the master branch, whose commit and branch history is too confusing
for the tool to handle with defaults.  After v3.4.0 is released from
the master branch, these configs can be deleted.
2022-02-11 16:25:44 -08:00
Joey Parrish 4bb2c14195 test: Fix failing WebDriver installations (#3943)
https://github.com/joeyparrish/webdriver-installer/pull/8
2022-02-11 15:28:29 -08:00
Joey Parrish 4948d938a0 ci: Fix ffmpeg install failure for Linux+Firefox (#3944)
CI for Firefox on Linux is failing because of (I suspect) an outdated
package index in Ubuntu.  This addresses it by updating the package
list before installing ffmpeg.
2022-02-11 15:28:20 -08:00
wjywbs ea6c02aece fix(HLS): skip whitespace in attributes (#3884)
Example:
`#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=1000000, RESOLUTION=1920x1080`

Co-authored-by: Joey Parrish <joeyparrish@users.noreply.github.com>
2022-02-11 12:58:47 -08:00
Joey Parrish 2a8ea8ca2c ci: Migrate update-issues tool to a central location (#3939)
This tool can now be shared among projects
2022-02-10 17:52:44 -08:00
Joey Parrish 746d2536a0 ci: Commit package-lock.json for CI stability (#3938)
This is recommended by npm to allow CI to get stable results when
installing dependencies.
2022-02-10 13:59:46 -08:00
Joey Parrish 1b12910661 test: Fix flaky player integration test (#3936)
Instead of waiting for the playhead to reach a specific time that we
know to be the end, then expecting ended to be true, we can use the
purpose-built waiter that waits for the ended event.

We also need to set the timeout explicitly, so that we have enough
time to play through to the end.
2022-02-10 08:56:24 -08:00
Joey Parrish 4855a50c22 ci: Require PRs in conventional commits syntax (#3937)
This will allow automated generation of changelogs and releases based
on PR titles.
2022-02-10 08:56:03 -08:00
Álvaro Velad Galván 36ca820877 fix: Fix download of some HLS assets (#3934)
Fix download of https://devstreaming-cdn.apple.com/videos/streaming/examples/img_bipbop_adv_example_ts/master.m3u8

The filterManifestByMediaCapabilities method is async, but the code doesn't wait for it to finish before continuing the download process. This PR fix it.

This also fixes a hidden compiler issue caused by the use of an alias for StreamUtils.
2022-02-10 08:36:50 -08:00
Patrick Cruikshank 48433abe74 fix: Fix exception in StreamingEngine for EMSG with HLS (#3887)
Add null check for emsgSchemeIdUris when EMSG boxes are parsed, as this value is null for HLS streams

Fixes #3886
2022-02-09 12:38:08 -08:00
Álvaro Velad Galván 1becadfc93 feat(demo): Add Apple Advanced HLS Stream (TS) with raw AAC (#3933) 2022-02-09 12:29:06 -08:00
theodab b005a7c645 demo: Probe for containerless format support (#3931)
Issue #2337
2022-02-09 12:27:15 -08:00
theodab 6034db8b33 test: Added integration test for sequence mode (#3929)
Issue #2337
2022-02-08 15:34:26 -08:00
Joey Parrish 9c3520b677 chore: Update roadmap (#3930)
This updates the roadmap for v3.2 and v3.3 (out) and v3.4 (upcoming).
This also trims down our current priorities to what the team at Google
will be addressing in the near term.
2022-02-08 14:09:30 -08:00