Commit Graph

129 Commits

Author SHA1 Message Date
Álvaro Velad Galván 5abd49cd82 feat: Add requestType and context to download events (#9723)
Close https://github.com/shaka-project/shaka-player/issues/9408
2026-02-17 12:43:26 +01:00
Álvaro Velad Galván ef361ed039 feat: Add MoQT draft-14 + WARP/MSF draft-1 experimental support (#9409)
Spec: https://datatracker.ietf.org/doc/draft-ietf-moq-transport/14/
Spec: https://datatracker.ietf.org/doc/draft-ietf-moq-warp/01/

Note: this is experimental and not included in the default builds

---------

Co-authored-by: Wojciech Tyczyński <tykus160@gmail.com>
2026-01-14 09:27:10 +01:00
Álvaro Velad Galván e85b648ef0 feat!: Remove MSS support (#9329)
Related to https://github.com/shaka-project/shaka-player/issues/9321
2025-11-04 20:06:44 +01:00
Álvaro Velad Galván 7ccb20a641 feat(HLS): Add support for com.apple.hls.chapters (#9195)
Spec:
https://developer.apple.com/documentation/http-live-streaming/providing-javascript-object-notation-json-chapters

Add disableChapters config
Update the UI to show chapters if there is only one language Add support
to download chapters

---------

Co-authored-by: Wojciech Tyczyński <tykus160@gmail.com>
2025-10-14 15:20:51 +02:00
Álvaro Velad Galván 6235b66004 chore(Ads): Some renames to accommodate the changes to integrate SVTA2053-2 (#9169) 2025-10-07 11:44:24 +02:00
Álvaro Velad Galván e6dfa903ef feat(Ads): Add support for tracking urls (#9144) 2025-09-29 21:27:41 +02:00
Wojciech Tyczyński 6d04f7f225 feat(net): Allow request filters to be called multiple times (#9129)
This change allows to execute request filter on every request attempt.
It can be useful i.e. to update credentials when first request fails.

New field `attempt` has been added to `shaka.extern.Request` which
informs which attempt is currently ongoing. This is needed to not do the
unnecessary work multiple times.

HTTP 401 Unauthorized and 403 Forbidden are no longer treated as
immediate critical errors, as tokens can be updated during retry
process.
2025-09-24 11:55:47 +02:00
Joey Parrish 7c1e31d4e6 chore: Add trailing commas to all record types (#8820)
Now that jsdoc supports this, it will make future diffs cleaner. See
#8819 and #1236.
2025-06-30 13:36:04 -07:00
Juan Manuel Gonzalez 2420cc90ab feat(CMCD): Add response mode for CMCDv2 (#8782)
# CMCD V2 - Response Mode
## PR Description
This PR focuses on the implementation of Response Mode functionalities
for version 2 of the Common Media Client Data (CMCD v2) specification
within the Shaka Player project.

Key changes made in this pull request include:
- **Response Mode**: CMCD v2 introduces "Request Mode" "Response Mode"
and "Event Mode". Request Mode aligns with the default delivery mode in
CMCD v1. Response Mode, which this PR implements, allows clients to send
data to one or more alternative destinations after receiving either a
full response or an error to a media object request. These reports use
one of the defined data transmission modes (Query Mode or Headers Mode)
- **CmcdTarget**: A new configuration type, `shaka.extern.CmcdTarget`,
was introduced. This configuration allows specifying the transmission
strategy (mode=response) since targets can also be configured for
**event mode** (mode=event), whether it's enabled (enabled), if it uses
HTTP headers mode (`useHeaders=true`) or query parameters mode, the
destination URL (url), and specific keys to include (`includeKeys`). For
Response Mode, the mode value includes 'response'.
- **Independent Handling of Transmission Modes**: Request mode and
Response mode can be enabled and disabled independently using the
previously mentioned CmcdTarget config for response mode and the base
config for request mode.
- **Validation and Filtering of Keys**: Allowed keys for Response Mode
were added, and validation for these keys was implemented. The
capability to include (`includeKeys`) and filter specific keys for both
Request Mode and each Response Mode target was also enabled. Also, CMCD
dictionary definitions were moved to a new dedicated section to improve
structure
- **Unit Tests**: Extensive unit tests were included and unified to
validate CMCD v2 functionality in both Request Mode and Response Mode.

Config example with request mode and targets with response mode:
```js
const cmcdConfig = {
	enabled: true,
	version: 2,
	contentId: 'content-id',
	useHeaders: false,
	targets: [{
        	mode: 'response',
        	useHeaders: false,
        	enabled: true,
        	url: 'http://localhost:3003/response-mode'
        }]
}
```

## Keys not implemented in this PR
The following keys are defined in the CMCD v2 specification but are not
calculated or attached to requests/responses in the `cmcd_manager.js`
code:
- **Common & Request Mode Keys:**
	- **`ab` (Aggregate encoded bitrate)**
	- **`tbl` (Target Buffer length)**
	- **`cdn` (CDN Id)**
	- **`bg` (Backgrounded)**
	- **`sta` (State)**
	- **`ts` (Timestamp)**
	- **`tpb` (Top playable bitrate)**
	- **`lb` (Lowest encoded bitrate)**
	- **`tab` (Top aggregated encoded bitrate)**
	- **`lab` (Lowest aggregated encoded bitrate)**
	- **`pt` (Playhead time)**
	- **`ec` (Player Error Code)**
- **Response Mode Keys:**
	- **`rc` (Response code)**
	- **`ttfb` (Time to first byte)**
	- **`ttfbb` (Time to first body byte)**
	- **`ttlb` (Time to last byte)** 
	- **`url` (Request URL)**
	- **`cmsdd` (CMSD Dynamic Header)**
	- **`cmsds` (CMSD Static Header)**

Related to https://github.com/shaka-project/shaka-player/issues/8660

---------

Co-authored-by: Constanza Dibueno <121617928+cotid-qualabs@users.noreply.github.com>
Co-authored-by: Álvaro Velad Galván <ladvan91@hotmail.com>
2025-06-25 10:19:25 +02:00
Nick Michael d9b0e857e1 feat: Provide Segment Reference to ABR Manager (via the request context) (#8316)
Provides the Segment Reference to the ABR Manager via the request
context. This allows the ABR manager to get information about the
specific segment being downloaded such as the start and end time (used
to calculate segment duration).
2025-03-24 12:52:26 +01:00
Álvaro Velad Galván 36db472d93 feat(net): Add networking config (#8306) 2025-03-21 10:20:38 +01:00
Álvaro Velad Galván a30f1da2a2 fix(net): Allow preventDefault() on retry event (#8058)
Fixes https://github.com/shaka-project/shaka-player/issues/8041
2025-02-11 19:10:52 +01:00
Álvaro Velad Galván c54b2dee19 chore: Stop using "Object" in plugins annotations (#7933)
Related to https://github.com/shaka-project/shaka-player/issues/1672
2025-01-24 08:29:51 +01:00
Wojciech Tyczyński 6e55a3b21b build: Forbid using dot in generic types (#7904)
Fixes #2643

Happy reviewing!
2025-01-20 09:39:51 +01:00
Wojciech Tyczyński 82f7eafdc5 build: Add new JSDoc rules to ESLint (#7897)
Adds a replacement for removed JSDoc checks from ESLint v9.
Additionally fixes lots of issues found in the JSDoc, such as:
- missing `@param`/`@return` annotations
- bad formatting
- params order
- param name in the same line as type definition (tried to disable it,
but it was causing other issues and we didn't have lots of places with
such formatting)

Minor fixes in code found by Closure Compiler after fixing JSDoc are
also included.
2025-01-17 09:28:19 +01:00
Wojciech Tyczyński 51765e9693 build: Change spellchecking tool and fix spelling mistakes (#7765)
Fixes #7693
2024-12-20 12:27:05 +01:00
Álvaro Velad Galván c10b796bb6 feat: Add basic support for the Common Access Token (#7651)
Close https://github.com/shaka-project/shaka-player/issues/7649
2024-11-25 09:28:51 +01:00
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