Commit Graph

49 Commits

Author SHA1 Message Date
Joey Parrish 7e6a0f38ff fix: Correct license headers in misc. files
This corrects/normalizes license headers in misc. files, such as
config files, docs, build tools, tests, and externs.  This does not
affect the compiled output, and is only done for consistency.

Issue #2638

Change-Id: I9d8da2de55243b08d7df2b743aac73c6f15e858a
2020-06-09 16:13:56 -07:00
Theodore Abshire 8d657140f1 Made ManifestParser.PlayerInterface.filter async.
This is a change in preparation for the adoption of the
MediaCapabilities API.

Related to #1391

Change-Id: If0988aedafe15aa3be794fb977fd8e04e91ca10e
2020-06-04 17:42:27 -07:00
Joey Parrish 6e3dfa40ba Deduplicate key IDs with Set
When period-flattening combines Streams, key ID arrays would get very
long with duplicates.

This changes keyIds in the manifest and offline structures from Array
to Set.

Issue #1339

Change-Id: I003d23e567efafa771ecd2ad597900181604ad18
2020-04-09 19:22:16 +00:00
Joey Parrish e8ac57f36c Move drmInfos array to Stream
Period-flattening will concatenate Stream objects, so this information
should be available per-Stream instead of at the Variant level.

Issue #1339

Change-Id: I96195fea48cab1e4a349b2ab0b16064a443e928a
2020-04-09 19:22:16 +00:00
Joey Parrish 99de217c23 Remove periods from manifest structure
This removes periods from the internal manifest structure and cleans
up code and tests accordingly.  This leaves us unable to play
multi-period DASH & offline streams until the main period-flattening
algorithm is completed in shaka.util.Periods.

Three test cases have been disabled for the moment.

Multi-period playback will be restored in a smaller, more focused
follow-up commit, with disabled tests re-enabled.

Issue #1339 (flatten periods)
Issue #1698 (rapid period transitions issue)
Issue #856 (audio change causes bitrate change)
Closes #892 (refactor StreamingEngine)

Change-Id: I0cbf3b56bfdb51add15229df323b902f0b2e643a
2020-04-09 19:22:16 +00:00
michellezhuo 3b52166f56 Remove support for custom DASH ContentProtection schemas
Remove manifest.dash.customScheme callback function since it's no longer used.

Closes #2356

Change-Id: I6d08fcf97cff1bf2985e7c660d74efcd767eaed9
2020-04-09 09:11:20 -07:00
Álvaro Velad Galván ad33625a11 Add non-standard DASH PlayReady UUID (#2474)
Resolves #2440
2020-04-01 09:54:42 -07:00
Jacob Trimble 011749e95f Standardize argument comments.
This changes the eslint rule to enforce a strict pattern for the
argument comments.  The comment must appear before the argument and
must be /* foo= */.  This still ignores line comments.

Change-Id: I3afb01c65e1088eda13facb3aeeaa7595a2f5aee
2020-01-06 19:40:52 +00:00
Joey Parrish 64896d70b0 Use shorter license header
This reflects changes in Google's policy on JavaScript license
headers, which should be smaller to avoid increasing the size of the
binary unnecessarily.

This also updates the company name from "Google, Inc" to "Google LLC".

Change-Id: I3f8b9ed3700b6351f43173d50c94d35c333e82b4
2019-11-22 18:18:36 +00:00
Jacob Trimble cbcfba031d Avoid having two top-level describe() blocks.
This moves some of the tests around to have each file use only one
top-level describe() block.  This removes some Player integration tests
that are already tested elsewhere.

There are two cases where there are two top-level describe() blocks
left: the segment reference and http plugin tests.

Change-Id: Iab7365919cfba739d4710184f079b6d2638192b6
2019-09-12 15:50:43 +00:00
Álvaro Velad Galván 5a5864c653 Get PlayReady PSSH from <mspr:pro> in DASH (#2106)
Creates "pssh" init data based on the <mspr:pro> element in the DASH manifest.

Closes #2058
2019-08-23 08:46:56 -07:00
Jacob Trimble 887f2e614d Make Uint8ArrayUtils accept BufferSource.
Change-Id: Ia22b4535f4a6cbc156022299d732b27602c677d3
2019-08-21 20:41:45 +00:00
Jacob Trimble fd0dc8a5cc Add utility for looping from 0 to n.
Closes #1518

Change-Id: I865f7a0311516d04ae84532dab873e1aaa31eb24
2019-07-10 21:23:22 +00:00
Jacob Trimble 83de1ad634 Use toBe instead of toEqual for primitives.
This ensures that we get the expected types and that type coercion
doesn't convert between types.  This also ensures we are consistent
in how we check for equality of primitives in tests.

Change-Id: I9f3aacdf25ab1afe5e8d6e4b895b5299ee687d54
2019-06-26 18:57:18 +00:00
Jacob Trimble e966945f61 Convert DASH tests to ES6.
Issue #1157

Change-Id: Iee2c8daede491e832bc2fd790a6d6b15fb019619
2019-05-30 21:52:13 +00:00
Jacob Trimble f130dffcef Enable eslint indentation rule.
This is a fully automated change.  The linter will fail because the
extra indentation caused line-length errors.  These won't be fixed
automatically.  They are fixed in a follow-up to make this one fully
automated.

Change-Id: I4d8cf9c998985add2bcd24a81c8d65495668c4f3
2019-05-13 22:31:09 +00:00
Jacob Trimble 47daf49f31 Use arrow functions for callbacks.
This is an automated change to convert use of "function" functions
to arrow functions.  This doesn't change all uses of bind() that
could be converted.  This also doesn't remove all "function" functions.

Change-Id: I40ac7d086bcef947a1be083359c8fd1d4499a9c3
2019-05-09 16:40:46 +00:00
Jacob Trimble c81389741f Prefer const over let.
A coming update to the Google eslint config will require using "const"
over "let".  This makes that one change to isolate the big changes.

Change-Id: I7d0974c3ae15c53cc45a6b07bf9f6586e2d34aca
2019-05-08 09:22:10 -07:00
Jacob Trimble c3ce160217 Consolidate default configs in tests.
Instead of duplicating the default configuration values in each test,
this now uses the default configuration methods.

Change-Id: Ifd2ab349db7903a2acb0d06fed4bd0ccd5050b35
2018-12-27 18:00:55 +00:00
Tyler Daines 3c8241f3c7 Add license url parsing (#1644)
This adds parsing license URLs to the DASH parser so the URL can be embedded in the manifest.

Fixes #484
2018-12-13 10:58:27 -08:00
fadomire 99ebc693f2 Add config field to ignore manifest minBufferTime #1547 (#1581)
Add the config field manifest.dash.ignoreMinBufferTime, which will default to false. If true, the DASH parser will ignore minBufferTime in the manifest, such that streaming.rebufferingGoal is the only factor in play.

Closes #1547
2018-09-21 12:51:33 -07:00
Theodore Abshire b37a450aed Add availabilityWindowOverride configuration.
This config lets you override the availability window of a live stream.
It is in config.manifest, and passed along on start.
This will let users configure the parser so that they can seek with HLS
live streams, for example.

Closes #1177
Closes #1307

Change-Id: Icd3c1d81c6b52ebdbb72137df42fc91cd73a0207
2018-07-16 17:13:53 +00:00
Joey Parrish fd0449d8f7 Re-enable some disabled style rules
This re-enables the following style rules:
  - "block-spacing"
  - "brace-style"
  - "comma-dangle"
  - "comma-spacing"
  - "new-cap"
  - "no-multi-spaces"
  - "no-multiple-empty-lines"
  - "one-var"
  - "padded-blocks"
  - "prefer-rest-params"

Change-Id: I15d616e8d5b88b273ded6128b4f9ad86bdb26bd1
2018-07-09 19:44:56 +00:00
Joey Parrish 95a55c7240 Avoid clearkey w/ DASH mp4protection scheme
When a DASH manifest has a ContentProtection element with the generic
"mp4protection" scheme, no particular key systems are specified.  When
this happens, we assume that any of the well-known key systems could
work.

Since a recent change (Ib74b0b7477cb47f80fda2e1184c86ab37771c105) to
the demo app, we are now providing the library a license server config
for clearkey, which enables DrmEngine to select the clearkey CDM for
any generic mp4protection content.  This causes playback failures when
the license server URI points to Widevine, PlayReady, or any other
real key system.

With this change, the demo can still be used to test explicit clearkey
DASH content which uses "1077efec-c0b2-4d02-ace3-3c1e52e2fb4b", the
UUID for clearkey.  But we will no longer inappropriately select
clearkey for the generic "mp4protection" scheme.

Fixes: 110281315

Change-Id: Ie6ee4e08e749dd38852f0096df35d35f3d3b2cee
2018-06-21 23:31:07 +00:00
Theodore Abshire 1d2cdc84db Added async/await to some of Dash tests.
Also fixed some formatting in media tests.

Issue #1337
Change-Id: Ifc003e3cb8f4b7a9920a0d2a121089eea4cf1bcd
2018-06-12 08:56:50 -07:00
Jacob Trimble 866b0e18ef Fix non-default namespace names in DASH.
XML allows namespace names to be any string.  So instead of looking
for the literal name 'cenc:pssh', we should be looking for the 'pssh'
name in the correct namespace.

Closes #1438

Change-Id: I724db3b7f0e60b4233b0fc40b1ed57698c6ce9ce
2018-05-21 20:02:18 +00:00
Michelle Zhuo 535de4db84 Refactor: Remove underscore from parameter names
Change-Id: Ie9e6fb59763f454f245175f23c6444f919ba8135
2018-05-08 19:21:51 +00:00
Sandra Lokshina 8065bd54a8 Change namespace from shakaExterns to shaka.externs
Change-Id: I16432351e2a266aa8fd175669aa27c44bfdffeae
2018-04-11 17:26:26 +00:00
Jacob Trimble 29f39077dc Convert 'var' to 'let'/'const' (2 of 9).
This is part of a change to convert all usages of 'var' with either
'let' or 'const'.  This takes a conservative approach for 'const' where
it will only be used for aliases and storing the "original" values in
tests.

Change-Id: Iebba756b5d0e68c41292ecabda89503682d8d434
2018-02-14 00:38:06 +00:00
Benjamin Wallberg cf3e1e3337 Change so that default presentation delay for DASH is configurable (#1235)
It is useful to have the default presentation delay configurable when the stream provider isn't able to add `suggestedPresentationDelay` in the manifest

Fixes #1234
2018-01-22 09:31:22 -08:00
Joey Parrish 529e97fbf2 [ES6] Configure eslint with Google style checks
Some style rules are temporarily overridden until we can get in
compliance.

Issue #1157

Change-Id: Ie27be6ec6632b7786a1f9ebc32911ba9dcd42599
2018-01-18 00:01:05 +00:00
Joey Parrish a18dc01874 Remove broken HLS time offset code
We misinterpretted the EXT-X-START tag before.  Now, we ignore this
tag and parse segment times from the segments themselves.  This is
more robust for both VOD and live HLS content.

We avoid segment parsing when updating normal, well-behaved live
streams.  For poorly-behaved live streams, we will fall back to
segment parsing and recover.

This also addresses the issue of VOD content which does not start at
zero.  Instead of using configuration to make this playable, we will
now offset VOD content back to 0 automatically.

Issue #740
Closes #1011

Change-Id: Ib3a59f87e3a050244cd39854409d8e3542c50b0a
2017-10-30 18:51:29 +00:00
Michelle Zhuo d67764b5ff New Error Code for Content unsupported by Browser
Previously "UNPLAYABLE_PERIOD" exception is thrown when a browser
doesn't support the container or codecs in a piece of content, which is
confusing to developers and customers.
Changing it to "CONTENT_NOT_SUPPORTED_BY_BROWSER" exception.

Test manifest:
https://media-ci.foxford.ru/dist/hls-issue/issue.master.m3u8

Closes #868.

Change-Id: Ied135b687190919abbeb1561c2bff36a7203136e
2017-08-04 11:07:07 -07:00
Jacob Trimble adb8da4764 Disallow unknown properties (1/5).
This is part of adding a new conformance rule to add additional type
safety.  This will disallow using properties of unknown types or using
unknown properties.

The first parts will be fixing errors caused by the new rule.  These
are backwards compatible, so can be applied before the rule is enabled.
Once all the errors and bugs are fixed, the rule will be enabled.

Change-Id: Iefde089b2f62ddfdf43944cda5badab438577561
2017-06-27 19:43:00 +00:00
Theodore Abshire 1e119e40cf Adds option to fail gracefully on xlink failure.
At the moment, when there is an xlink problem, the manifest parser
returns a rejected promise. This adds a configuration variable to
instead simply not replace the xml tag.

Closes #788

Change-Id: Iace953233c83a57820130033150e7cd9a9385d6f
2017-05-25 21:10:09 +00:00
Sandra Lokshina b14867bc65 Add config to ignore key system and init data in DASH manifest.
Closes #750.

Change-Id: I551a671eb153428f7d9a7900bf9b47cb37694f95
2017-04-17 17:22:37 +00:00
Jacob Trimble 575f2ad109 Add an indicator for critical errors.
This adds a severity field to Error objects.  This can be used to
detect whether an error is recoverable.  All the same errors are still
reported so the field can be ignored.

There are two possible values:
* RECOVERABLE means that the Player will try to recover from the error
* CRITICAL means the Player will be unable to continue and must call
  load() again

Closes #564

Change-Id: Ie2c5468340c13e7a288b99690ab65b7ecc0a6b29
2017-04-04 23:57:59 +00:00
Sandra Lokshina c6729d7c14 Add hls config with default time offset.
Apple encoded content has a default time offset of 10 seconds.
Every other packeger we've encountered so far doesn't.
New config will default to 0 and allow the application to specify
the offset for their content according to the packager's standards.

Issue #279

Change-Id: I65b16b05a5974a2f0318cd1f9847c3a56c38b745
2017-03-02 13:32:17 -08:00
Theodore Abshire 3cd2506a05 Fixed a test failure on IE and Firefox.
There was a typo in the expected manifest in 'sets key IDs for the
init data'. I forgot a >. Honestly, I'm surprised the test passed on
Chrome. I guess the Chrome XML parser must be very permissive.

Change-Id: Ia272f2e629ad93db40e13cdb4b4001eb7ecf4f05
2017-02-13 22:36:48 +00:00
Theodore Abshire 5707e16038 Filter duplicate initData from manifest by key ID
Adds a new field to initDataOverride, key Id, that contains the
default key Id corresponding to this initData. This is used to filter
initDatas by their key Ids, hopefully cutting down on unnecessary
license requests.

Closes #580

Change-Id: Ie228d6c0f4c693b19b4119ec4f72a85d555215c1
2017-02-10 18:14:14 +00:00
Theodore Abshire 354880c32e Fixed the keyIds field in drmInfo.
Now it is set in a more suitable stage of content parsing, thus
fixing a bug where the field would contain multiple copies of
every keyInfo.

Change-Id: I12875efa04c4e3ccbb459945091533006bd398fd
2017-01-30 20:25:14 +00:00
Jacob Trimble 68e870dc9a Add support for EventStream elements in DASH.
This also makes the Playhead ignore duplicate regions.  This simplifies
manifest updates in DashParser by having it add every Event tag it
sees.  The DASH spec doesn't specify how we should detect duplicate
entries or how events are fired.  So to avoid firing all the same
'timelineregionadded' events on every manifest update and getting
multiple enter/exit events, we will simply remove duplicates.

Closes #462

Change-Id: If5d2c42bd6958567b2ec05ba1e9af252c95cf354
2017-01-26 21:56:07 +00:00
Jacob Trimble 2ca962a33c Refactor ManifestParser.start to accept an object.
Rather than accepting multiple callback methods as separate arguments,
now start() will accept an object.  This will allow us to add new
callbacks without breaking backwards compatibility or adding
additional arguments.

Change-Id: I839cbb12e71c2e7270aa218802c79440c458e964
2017-01-19 22:54:09 +00:00
Joey Parrish b4cfc1fa72 Drop DASH AdaptationSetSwitching support
These properties are no longer used since we refactored for variants.
All compatible AdaptationSets are now implicitly squashed together.

Issue #279

Change-Id: Idc1922c54b0c1aa62f3199369b8e819e3a374b55
2017-01-03 17:44:59 +00:00
Sandra Lokshina e95d7b9de4 Refactor shaka internals to use variants instead of stream sets.
Issue #279

Change-Id: Idf4241b4e2490876bdc6275685361a5c9bf132b0
2016-12-28 17:49:24 +00:00
Joey Parrish aa00166277 Remove dots from test suite names
These are confusing the build bot's parser for the junit reports
karma generates.

Change-Id: If38355bcd6b9adfb1e1c995d79eb47a80cab8a48
2016-11-29 11:15:56 -08:00
Joey Parrish 696332fbf8 Fix AdaptationSetSwitching support
We had a typo in the case of an attribute (schemeIdUri vs schemeIdURI)
and we did not have support for the latest scheme URI (upcoming MPEG
scheme URI vs /guidelines/ vs /descriptor/).

Change-Id: Ibee1802cfe2b04183d52e75378fa23e0c4e3aae8
2016-10-11 02:31:50 +00:00
Sandra Lokshina f1a4e25151 Add support for EMSG box.
Look for EMSG boxes in segments if the manifest signals their presence.
Update the manifest when a DASH EMSG box is encountered.
Dispatch an event with the content of the box for all other EMSG boxes.

Closes #259

Change-Id: I874121207c2419e756980ac858fba0d56e68e07e
2016-08-01 14:32:23 -07:00
Leandro Moreira a8c44da4b1 restructures test files 2016-07-01 09:53:30 -03:00