Commit Graph

4446 Commits

Author SHA1 Message Date
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
Álvaro Velad Galván a61204e665 chore(EME): Remove cbcs-1-9 testing on probeSupport (#8817)
It's been removed because only the cenc and cbcs patterns are used.
cbcs-1-9 was added for FairPlay, but Safari uses cbcs for this use case.
2025-06-30 12:41:00 +02:00
Joey Parrish 75e271132d fix: Fix end-of-stream detection for VOD (#8813)
PR #8603 refactored the conditions for being "buffered to the end". Two
of these conditions from Player didn't fit in the new location
(Playhead). One (this.isEnded()) was moved, and the other
(this.mediaSourceEngine_.ended()) was dropped by accident. This restores
the dropped condition next to isEnded().

Verified in the Cast Application Framework.
2025-06-27 15:36:00 +02:00
Álvaro Velad Galván c00c9e4153 chore: Remove useless play listener when using delayLicenseRequestUntilPlayed as false (#8812) 2025-06-26 15:46:16 -07:00
Álvaro Velad Galván 80f407fa47 fix: Fix reloadTextStream function when using text with init segments (#8811) 2025-06-26 16:40:11 +02:00
Wojciech Tyczyński 7d43ee45b3 fix(HLS): Fix resync issues on Safari (#8808)
Removes duplicated logic around timestamp offset checks - now check is
only in `resync()` method. It should stay there, because it ensures it
will be executed only in sequence mode and also avoids otherwise
unnecessary `abort()` call.

Increases threshold to 150 ms as it was the originally proposed value
and gives better experience.

Now timestamp offset change won't be applied in sequence mode if it's
less than 150ms from buffer end, regardless of manifest type.
2025-06-26 14:25:10 +02:00
Álvaro Velad Galván 5b27f0f7d3 fix: Fix Apple Vision Pro (Vision OS) detection and other VR devices detection (#8805) 2025-06-26 10:39:28 +02:00
Álvaro Velad Galván 93117d2ace feat: Add enableAudioGroups config (#8792)
Close https://github.com/shaka-project/shaka-player/issues/8684
2025-06-25 12:46:38 +02: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
Álvaro Velad Galván f5c0fb24cd fix(HLS): Reset PTS/DTS reference at discontinuities when using TS (#8794) 2025-06-24 13:18:37 +02:00
Álvaro Velad Galván 762063dc46 fix(HLS): Fix presentation delay when there are not enough segments (#8793) 2025-06-24 12:33:13 +02:00
Agajan J. 62e55d4b1e fix: Another Sony Bravia TV Playready Failure (#8791)
Fixes https://github.com/shaka-project/shaka-player/issues/8790
There is another Sony TV model (called Bluefin) that also requires
little endianness conversion. Future proofed Sony tv detection to
include all the G models.
2025-06-24 09:36:20 +02:00
Álvaro Velad Galván 4713909dd2 feat: Add shaka.extern.DrmSessionMetadata to LICENSE_REQUEST_FAILED error (#8788)
Related to
https://github.com/shaka-project/shaka-player/issues/1772#issuecomment-2979980293
2025-06-23 18:02:32 +02:00
Álvaro Velad Galván e23112ec67 fix(HLS): mediaSequenceToStartTime isn't maintained correctly for AUDIO manifest (#8784)
Fixes https://github.com/shaka-project/shaka-player/issues/8780
2025-06-23 10:30:35 +02:00
Álvaro Velad Galván 35124e4071 fix(Demo): Fix keep custom config on page reload (#8777)
The previous fix doesn't work with streaming.lowLatencyMode config.
2025-06-21 07:23:08 +02:00
Álvaro Velad Galván 15401c36f0 fix: Don't cancel trick play near to live edge if rate is less than 1 (#8772) 2025-06-21 07:22:28 +02:00
Gregory McGarry 88627c3714 fix(DASH): Use the correct Representation ID for Uri substitution of media segments (#8760)
For DASH segment templates, MpdUtils.fillUriTemplate() is used for
substitution of tokens in the fetch URL, like $RepresentationID$. When
supplemental codecs are used, the incorrect RepresentationID will be
substituted for media segments. The initialisation segment is correctly
substituted.

The symptom is that fetches for media segments will fail with 404
response codes.
2025-06-20 11:27:07 +02:00
Álvaro Velad Galván 7a8dc5348d fix: Reset text visibility on unload (#8775) 2025-06-19 21:49:02 +02:00
Álvaro Velad Galván cb22ab6933 fix(DASH): Fix L3D streams (with k parameter) without $SubNumber$ (#8770) 2025-06-19 09:31:10 +02:00
David HM Morgan e303024390 fix: Fix 4k stream support within browser env on Tizen (#8764) 2025-06-18 16:01:34 +02:00
Wojciech Tyczyński 796444dd8a chore: Remove session definition from SessionMetadata (#8756) 2025-06-17 16:51:54 +02:00
Álvaro Velad Galván 231dd03dbd fix: Avoid throw BUFFER_READ_OUT_OF_BOUNDS when not necessary (#8753)
This only happens when a stream has incomplete mp4 boxes.
2025-06-17 13:10:29 +02:00
Álvaro Velad Galván 66efb0a4d3 fix: Close segment index when calling to unloadTextStream (#8754)
In HLS Live this is necessary to avoid continuing to download the
subtitle media playlist when it is not needed.
2025-06-17 12:02:02 +02:00
Álvaro Velad Galván 49c228c713 fix(CEA): INVALID_MP4_CEA error being thrown when shouldn't be (#8748)
Fixes https://github.com/shaka-project/shaka-player/issues/8729
2025-06-16 11:47:11 +02:00
Álvaro Velad Galván dbc76f9624 fix: Avoid reset or changeType in MSE when not necessary (#8744)
Fixes https://github.com/shaka-project/shaka-player/issues/8737

---------

Co-authored-by: Wojciech Tyczyński <tykus160@gmail.com>
2025-06-16 11:12:46 +02:00
Álvaro Velad Galván c1e2f7aab5 fix(HLS): Fix switching between muxed and alternate audios (#8741)
Fixes https://github.com/shaka-project/shaka-player/issues/8737
2025-06-12 13:48:43 +02:00
Álvaro Velad Galván a1cb769aa7 feat: Allow switch between UITextDisplayer and NativeTextDisplayer on runtime (#8736)
We prefer NativeTextDisplayer when using PiP and Fullscreen API of the
video element itself. Otherwise we prefer UITextDisplayer
2025-06-12 12:09:05 +02:00
Álvaro Velad Galván bb578895d2 fix(HLS): Fix reset media source when using muxed content (#8738)
Fixes https://github.com/shaka-project/shaka-player/issues/8737
2025-06-12 11:02:14 +02:00
Álvaro Velad Galván fa1a6b7c4c fix: Allow change NativeTextDisplayer on runtime (#8735)
This is required to be able to switch at runtime from UITextDisplayer to
NativeTextDisplayer and allow subtitles to be displayed correctly.
2025-06-12 11:02:01 +02:00
Wojciech Tyczyński 2a95bf825c chore: Unify text displayer creation (#8734) 2025-06-11 16:03:56 +02:00
Álvaro Velad Galván 3506c4f4b3 fix: Fix Apple Vision Pro detection (#8732) 2025-06-11 13:54:52 +02:00
Álvaro Velad Galván bc4d3377a6 feat(HLS): Get info about projection from REQ-VIDEO-LAYOUT instead of parsing the init segment (#8731)
See https://developer.apple.com/streaming/Whats-new-HLS.pdf
2025-06-11 12:26:02 +02:00
Álvaro Velad Galván 1c8f4572e9 feat(Demo): Add new VR streams from Apple (#8728) 2025-06-10 17:13:44 +02:00
Álvaro Velad Galván 4c2476d5b7 perf: Only parse spatialVideoInfo for video segments (#8726) 2025-06-10 15:17:09 +02:00
Álvaro Velad Galván 8cd5470e2f fix(HLS): Fix APAC detection (#8724)
More info in
https://developer.apple.com/av-foundation/Apple-Positional-Audio-Codec.pdf
2025-06-10 15:16:49 +02:00
Wojciech Tyczyński e60273ecec chore: Use standard concat method (#8722) 2025-06-09 16:07:35 +02:00
Wojciech Tyczyński 530c0c862f chore(DRM): DRM Engine init improvements (#8721)
- map `servers` and `advanced` config fields to maps once
- use `WeakSet` instead of `Set` to mark which objects have been
processed
2025-06-09 15:34:02 +02:00
Álvaro Velad Galván 49f569ddb3 fix: Fix chopped playback in some DASH multiperiod streams (#8717)
Increase the fudge append window end to fix a playback bug.
2025-06-09 12:32:04 +02:00
Álvaro Velad Galván b58a2e2d8a fix: Only change appendWindowStart and appendWindowEnd when necessary (#8716) 2025-06-09 12:31:52 +02:00
xiao 3cbc770b76 fix: NativeTextDisplayer.remove() not following the spec (#8714)
Should return false only if it's destroyed. Or it may cause
[`StreamingEngine`](https://github.com/shaka-project/shaka-player/blob/b752f779cfde99bb6bfa4f7f7dec31bb4f64209e/lib/media/streaming_engine.js#L2627)
to call it repeatedly, thus blocking the thread.

---------

Co-authored-by: Wojciech Tyczyński <tykus160@gmail.com>
2025-06-09 11:40:51 +02:00
Wojciech Tyczyński b752f779cf chore: Reduce same conditions in StreamingEngine (#8709) 2025-06-06 16:20:03 +02:00
Wojciech Tyczyński e8a8ad9fab perf(net): Do not parse headers twice in XHR plugin (#8710)
Continuation of #8618
2025-06-06 16:19:54 +02:00
Álvaro Velad Galván c15e524705 fix: Don't sort TS samples (#8708)
Fixes https://github.com/shaka-project/shaka-player/issues/8707
2025-06-06 12:14:33 +02:00
Álvaro Velad Galván 53db6554f3 perf: Simplify getAudioTracks internally when using src= (#8703) 2025-06-06 09:34:14 +02:00
Álvaro Velad Galván 1c4a20681c fix: Fix bad assert on DeviceFactory (#8705) 2025-06-05 21:34:46 +02:00
Álvaro Velad Galván 79f9960374 docs: Fix texttrackvisibility and trackschanged documentation (#8704) 2025-06-05 21:34:29 +02:00
Álvaro Velad Galván cc98d405af fix: Fix ts parser when using B-frames (#8696)
Fixes https://github.com/shaka-project/shaka-player/issues/8691
2025-06-05 13:48:29 +02:00
Álvaro Velad Galván aab4c27a51 perf: Simplify selectAudioTrack internally (#8687)
The number of internal operations has been reduced and the function is
now much faster.
2025-06-05 10:21:59 +02:00
Álvaro Velad Galván 863aa073a4 fix(Ads): Fix interstitials when not using multiple media elements (#8681) 2025-06-04 15:49:36 +02:00
Álvaro Velad Galván ff1ef7c262 feat: Add HDR detection in Tizen and WebOS (#8680)
Close #8441

---------

Co-authored-by: Wojciech Tyczyński <tykus160@gmail.com>
2025-06-04 12:34:59 +02:00