Commit Graph

112 Commits

Author SHA1 Message Date
vlazh 13186bd403 feat: Add 'downloadcompleted' event (#7609)
Closes #7608
2024-11-18 08:41:24 +01:00
vlazh 0fc5316c5a fix: Calculate timeToFirstByte before fire the event 'downloadheadersreceived' (#7605)
Fixes #7604
2024-11-15 15:43:37 +01:00
Álvaro Velad Galván f5b78dc88a feat(Ads): Added advanced type to ad requests (#7196) 2024-08-23 12:34:44 +02:00
Wojciech Tyczyński d36ff6553c feat(net): Add minimum bytes for progress events (#7117)
By limiting progress events to only ones with minimal chunk size, we might end up with feeding better default ABR implementation, which should result in more accurate adaptation in case of network throttle.
2024-07-31 05:34:13 -07:00
Wojciech Tyczyński 2f3a1ebf94 feat(DASH): add MPD_PATCH advanced request type (#6787)
Add `shaka.net.NetworkingEngine.AdvancedRequestType.MPD_PATCH` to
distinguish regular MPD requests from MPD Patch requests.
2024-06-11 10:56:14 +02:00
theodab 1cfb53e648 fix(preload): Copy net filters to preload manager (#6709)
Some assets might rely on networking engine filters (request and
response filters) to properly download their assets. However, the
preload manager's need to use a fresh networking engine also caused it
to not use any filters set on the player already. This changes the
process of setting up a preload manager, to make it copy over any
filters defined on the player's networking engine.

Fixes #6698
2024-05-30 12:45:12 +02:00
Álvaro Velad Galván dda713aa71 feat: Optionally force HTTP content URIs (#6649)
This may be necessary on older devices where not all certificates are
present.
2024-05-23 04:16:18 +02:00
Álvaro Velad Galván d532bf44c7 feat: Add bytesDownloaded to stats (#6469)
Closes https://github.com/shaka-project/shaka-player/issues/6413
2024-04-23 14:26:58 -07:00
Dave Nicholas 6c4333c565 feat(ABR): Additional request information for ABR Managers (#6313)
This PR makes the following request information available for ABR consideration. Allowing the ABR manager to know about the request latency from the time to first byte and knowing the order order of a packet, as well as the contentType of the request.
2024-03-06 12:15:38 -08:00
Álvaro Velad Galván 48626f2ae0 fix: Change quality only when adding the last partial segment and it is fast switching (#6114) 2024-01-18 08:31:06 +01:00
Álvaro Velad Galván 42f491f782 feat(DASH): Add support for Content Steering (#5710)
Related to https://github.com/shaka-project/shaka-player/issues/5704
2023-11-09 08:34:09 +01:00
Álvaro Velad Galván 508e5cfbba feat(DASH): Add initial support for "urn:mpeg:dash:ssr:2023" (#5762) 2023-11-03 14:57:15 +01:00
Álvaro Velad Galván cf5a72bb51 feat(Ads): Add support for AWS Elemental MediaTailor (#5679) 2023-09-28 09:55:26 +02:00
Joey Parrish 330f04b76f fix: Fix HEAD request exception (#5194)
We should not look for response data in a HEAD request.

Fixes #5164
2023-04-27 07:24:02 +02:00
Casey Occhialini 93baba20a1 fix: stream property of request context obfuscated in production builds (#5118)
Co-authored-by: Dan Sparacio <daniel.sparacio@cbsinteractive.com>
2023-03-23 21:45:40 +01:00
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
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
theodab 6194021a3d feat(hls): Support AES-128 in HLS (#4386)
Expands on the original PR (#3880) by adding support for MP4 and key rotation.

Close #850

Co-authored-by: wjywbs <wjywbs@users.noreply.github.com>
2022-08-12 10:50:32 -07:00
Álvaro Velad Galván bdc5ea767e feat(DRM): add initData and initDataType to license requests (#4039)
Adds initData and initDataType field to all LICENSE-type requests.

Based on comments here: https://github.com/shaka-project/shaka-player/issues/4001#issuecomment-1050655197
2022-03-21 09:49: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
Joey Parrish 1507b1e844 chore: Update URLs after moving projects (#4008) 2022-03-03 14:34:40 -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
Theodore Abshire dd3748d599 fix: Enforce string-format of event data keys.
Previously, many events were being defined with a data dictionary
that used variable-type keys (e.g. {key: value}). This worked fine
in uncompiled mode, but in compiled mode it lead to those properties
being obfuscated.
This changes the FakeEvent constructor to take a map rather than an
object, so the compiler will force the keys to be strings.

Closes #3710

Change-Id: I67b1a391540a5ee21f0aaf940ae054d26f4c10a4
2021-10-25 12:40:32 -07:00
Theodore Abshire 7893b7733b Feat(player): Added events for download lifecycle.
This adds two new player events, 'downloadheadersreceived' and
'downloadfailed', to allow users to measure network performance
in greater detail.

Issue #3533

Change-Id: I33a3bd411d815e926d4bea2184e8d3ea69e2bb49
2021-07-29 18:47:24 +00:00
Percy Tse f09616fb41 fix(LL-DASH): Append segment chunk strictly in order (#3405)
An async process handles the appending of partial segments for LL-DASH.  This fixes the caller to wait on the results, so that partial segments are always appended in order.

Fixes #3404
2021-05-17 10:00:28 -07:00
Vincent Valot 9b4502cc5d feat: add serverCertificateUri in DRM advanced config (#3358)
Fixes #1906
2021-05-03 10:53:31 -07:00
Álvaro Velad Galván 863e3455b6 feat: Network stall detection (#3227)
Closes: #1582
2021-03-30 13:35:41 -07:00
Álvaro Velad Galván 207c235b1c feat: Optionally force HTTPS content URIs (#3025)
Closes: #1389
2020-12-17 10:59:15 -08:00
michellezhuo ce7528ea0e build: add goog.requireType for compiler upgrade
Change-Id: Ibdca83fcbc3f8637c09c2cabfeaaea173850a553
2020-10-05 19:57:57 +00:00
Michelle Zhuo f67367a81b feat(LL-Dash): Fetch and append ReadableStream
With the low latency streaming mode, we fetch a segment, and get the
response data through a ReadableStream.
For each segment request, we may get multiple chunked data. We handle
and append the chunked data of the ReadableStream via a callback
function in the StreamingEngine.
Once the whole segment gets handled and appended, we move on to the
next segment.

Issue #1525

Change-Id: I7949c87f4e491c928919c2e9dc4dafbebac22c9b
2020-09-16 20:17:02 +00:00
Joey Parrish f539147d48 fix: Correct license headers in compiled output
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
2020-06-09 16:05:09 -07:00
Joey Parrish 5d2dc2daaf Update deprecation timelines (v3.1 => v4.0)
Since we are getting strict about semantic versioning, we can't remove
features in v3.1.  Any backward compatibility we offer will be
maintained until v4.0.

The exception is explicit IE 11 support, which will still be removed
in v3.1.

To help us follow the rules for removal, the Deprecate utility no
longer accepts a minor version argument.

Change-Id: I4dd94a6084e4ed72eeec410eb9aa0ad974d8dac8
2020-06-01 15:57:31 -07:00
Joey Parrish aba5e2583c Rename v2.6 to v3.0 and v2.7 to v3.1
We have decided to bump the major version number instead of the minor
number, based primarily on the fact that this release breaks
compatibility with our previous manifest structure.

Change-Id: I67e4c8267c6e103cfc7278e09daac186ae5cbbc6
2020-05-29 17:50:22 +00:00
Joey Parrish 4dc2c65578 Add type assertions for Errors
In many places, we check error codes on shaka.util.Error.  But the
compiler doesn't know that what is caught in "catch" is that type, so
we add type assertions.

In some cases, we know that other types may also be thrown, so there
are also some runtime checks.  Some of these had to be refactored to
allow the compiler to correctly infer types.

Change-Id: I053bd7e96213c689aae3889315052dd402124690
2020-04-29 10:11:21 -07:00
Joey Parrish 07335d79f6 Fix missing or bad type info
In many places, the implicit type info was insufficient.  For example,
document.createElement returns Element, but the actual return is
always a subclass of Element.  In many cases, we need the compiler to
know that a specific subclass is in use, so that it can correctly
check our use of subclass-specific properties.  Another common pattern
is confusion between Node and Element (which is a subclass of Node).

Almost all of the changes in the demo and UI are Element-related.

In some places, we referred to HTMLMediaElement, used in the Player
API, instead of the more specific HTMLVideoElement in use in our demo.
Since the demo uses video-specific properties, we must use the more
specific type.

Another case is the use of document.createEvent, which returns Event
according to the compiler, but in reality always returns a subclass,
like CustomEvent.

In one case in NetworkingEngine, correcting the type of an
AbortableOperation led to the discovery that we had been incorrectly
accessing a private method of that type.

In goog.Uri, there were several instances of "*" for a type, which the
newer compiler won't accept.  These have all been corrected.

Finally, in some places, we had the wrong nullability on a type.

These were all caught by a compiler upgrade.

Issue #2528

Change-Id: I7f2d070e3da32fe9ff5f444315649f3cbdb5a4a5
2020-04-28 16:51:20 -07:00
Joey Parrish 15e48e91f3 Fix over-indentation of classes
These classes were over-idented, making formatting more challenging.
I wanted to fix this before making compiler-upgrade-related changes in
these files.

Issue #2528

Change-Id: Ic44448760161a3e724d8c92f41f07c1a0babfa72
2020-04-28 22:30:19 +00: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
Joey Parrish 9e92167910 Treat URL schemes as case-insensitive
According to RFC 3986, URL schemes should be case-insensitive.  Our
scheme plugin map is registered with exclusively-lowercase scheme
names, so we should convert the input scheme to lowercase before
looking up the plugin.

Closes #2173

Change-Id: I78218c18d3df154aabd101a9ef5fd3156d0c57a8
2019-10-04 10:32:58 -07:00
Theodore Abshire a84fd65d9e Added "report bug" button to demo.
Change-Id: I27e25f8b88effc596e2f836ec263f9ae9d2b5fc0
2019-09-04 22:51:03 +00:00
Jacob Trimble a2bcf7278d Move some utilities to BufferUtils.
Change-Id: Ifb3c4348cc912640b99ff53f7cac59a63480c68e
2019-08-20 22:07:35 +00:00
Jacob Trimble 596c80a949 Refactor handling of ArrayBuffer.
This changes the network API to use BufferSource instead of ArrayBuffer,
which allows plugins to return a "view" on a buffer instead of the
whole buffer.  This also adds some utilities for changing between
views and buffers.

Lastly this forbids the use of the "buffer" property of TypedArrays
since it doesn't work with partial "views".  This audits and fixes the
usages of the "buffer" property to ensure correct usage.

It should be noted that both MSE and EME accept a BufferSource as input,
so we don't need to convert a "view" into an ArrayBuffer before passing
to it.

Change-Id: Iaa417773f8ce5304424e43c7372ce10ebf540d2a
2019-08-20 20:17:33 +00:00
Jacob Trimble b12075093e Add sessionId field to network request.
This allows a request/response filter to determine which EME session
made the request.  This also changes the session ID of FairPlay sessions
so they are available too.

Issue #1951

Change-Id: I1a07abae6faf4a87fad7b5d4290a00b25e83da8e
2019-08-05 16:52:11 +00:00
Jacob Trimble 74918b90ec Convert networking files to ES6.
Issue #1157

Change-Id: Iae83b88881b351c97e8ec020625167f5f700f97e
2019-05-20 17:10:06 +00:00
Jacob Trimble d5780d401b Fix line length issues for indent fix.
Change-Id: I87d75fd88000f8f9bff7b9f1bf5667ba28f6dd60
2019-05-13 22:31:20 +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
Theodore Abshire 273698d607 Fix exception on network retry.
The numBytesRemainingObj parameter in |NetworkingEngine.send_| was
optional, but in some circumstances we were assuming that it was set.
This just changes the parameter to be non-optional.
In fact, the parameter now being non-optional revealed an error that
caused the numBytesRemainingObj to be lost on network retry.

Fixes #1930

Change-Id: I74f24309f859f975f51e20455739b806ed3f4ecd
2019-05-09 22:19:56 +00:00
Jacob Trimble ded2b84313 Require consistent return values.
This enables the eslint rule that requires all functions to consistently
either return a value or not return a value.

Change-Id: I98b579f3689c3b6c74968116824231bb792bd9dd
2019-05-09 20:34:47 +00:00
Joey Parrish 189902bdb3 Eliminate free calls of static methods
This was caught by a newer compiler release.  These were missed in the
last audit we did before releasing v2.5.0.

Change-Id: I4abd29e965c95b56eb83c61294f8a7dbaacae990
2019-05-08 15:01:02 -07: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