Commit Graph

403 Commits

Author SHA1 Message Date
Wojciech Tyczyński e2cf6a1724 chore: Replace PublicPromise with Promise.withResolvers (#9925)
Stop using `shaka.util.PublicPromise` and replace it with modern
`Promise.withResolvers()` API, that is [widely implemented
already](https://caniuse.com/wf-promise-withresolvers).

Polyfill is already included by Closure Compiler:
https://github.com/google/closure-compiler/blob/master/src/com/google/javascript/jscomp/js/es6/promise/withResolvers.js

---------

Co-authored-by: Álvaro Velad Galván <ladvan91@hotmail.com>
2026-04-07 16:11:29 +02:00
Álvaro Velad Galván 90f59213bb fix: Honors streaming.retryParameters for segments (#9796)
Fixes https://github.com/shaka-project/shaka-player/issues/9787
2026-03-06 20:23:25 +01:00
Álvaro Velad Galván e59b8b40a7 feat(HLS): Add chapter images (#9738)
Spec:
https://developer.apple.com/documentation/http-live-streaming/providing-javascript-object-notation-json-chapters
2026-02-20 15:04:12 +01:00
Álvaro Velad Galván 88c65c6bbf chore: Reduce the internal complexity of the chapters (#9737)
Instead of saving chapter titles as a URL, they are now saved as a
metadata section that can be expanded in the future.
2026-02-20 11:38:33 +01:00
Andy(김규회) c7368024ae feat: Select default track by a list of preferences (#9542)
I went ahead and implemented the full structured preference system that
was discussed in
https://github.com/shaka-project/shaka-player/issues/1591.
Instead of just expanding languages to arrays, I replaced all 14
individual preference fields with 3 structured arrays:

```tsx
  preferredAudio (language, role, label, channelCount, codec, spatialAudio)
  preferredText (language, role, format, forced)
  preferredVideo (label, role, codec, hdrLevel, layout)
```

Each array entry works as an AND filter - so you can say things like "I
want Korean with 5.1 surround, but if not available, English is fine
too":

```tsx
player.configure('preferredAudio', [
  {language: 'ko', channelCount: 6},
  {language: 'ko'},
  {language: 'en'},
]);
```

<img width="1728" height="965" alt="image"
src="https://github.com/user-attachments/assets/7b088150-139b-475e-bdba-5bc77dd4e524"
/>

**Config** - Replaced the 14 individual fields with 3 arrays of typed
preference objects (AudioPreference, TextPreference, VideoPreference).
The old fields still work at runtime with a deprecation warning, so
existing apps won't break immediately.

**Demo** - The demo config UI now shows inline expandable preference
lists instead of flat text inputs. You can add/remove entries and
configure each field per entry. URL hash serialization was updated to
use JSON format, with legacy param fallbacks preserved.
2026-02-20 10:12:08 +01:00
Joey Parrish ab16b73614 fix: Improve handling of in-progress content (#9414)
The HLS parser used isLive_() in some places, which was equal to
presentationType_ != VOD, and in other places, checked presentationType_
directly.

In fact, isLive_()'s old formulation was checking for all dynamic
content (live & event types), so it should be called isDynamic_(). But
some usages of the old isLive_() actually only cared about live, and
should exclude event types.

This cleans up usage and clarifies each condition to either strictly
live (excluding VOD & event types) or all dynamic content (live & event,
excluding VOD). This is done both inside and outside the HLS parser.

This also makes one behavioral change to HLS event type streams. These
are now shown as "in progress" (dynamic, finite duration) instead of
"live" (dynamic, infinite duration).

---------

Co-authored-by: Álvaro Velad Galván <ladvan91@hotmail.com>
2025-12-04 09:54:02 +01:00
Álvaro Velad Galván c920ecd4fa chore: Move createSegmentRequest to shaka.net.NetworkingUtils (#9363) 2025-11-05 21:05:49 +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 ee003012d4 fix(Offline): Fix playback of streams with audio muxed in video (#9229)
Fixes https://github.com/shaka-project/shaka-player/issues/9223
2025-10-16 12:47:57 +02: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 194af00106 fix(Ads): Fix LL HLS with interstitials pre-roll ad is played slightly after primary content when using ASSET-LIST (#9183)
Fixes https://github.com/shaka-project/shaka-player/issues/9164
2025-10-09 11:55:53 +02:00
Gary Katsevman 729cea8fc4 feat: Change dvvC box to free box for Dolby Vision workarounds (#9101)
This is based on
https://professionalsupport.dolby.com/s/article/Guidelines-to-developers-building-DASH-HLS-player-apps-for-LG-WebOS-Chromecast-and-other-Chromium-based-app-development-platforms?language=en_US
2025-09-17 10:21:12 +02:00
Wojciech Tyczyński f1768a5f84 chore: Remove JSDoc for empty constructors (#8955)
We don't need this anymore with `exemptEmptyConstructors` config added
in #8901
2025-08-05 13:06:00 +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
Wojciech Tyczyński 970d7756ea feat: Add Device API (#8210)
The goal is to simplify and abstract feature logic detection. Currently
lots of places depend on various calls to `shaka.util.Platform` and
mainteinance of this is hard & not easy to read.

By introducing device API ideally rest of the player logic would look
into device features instead of directly checking platform. Additionally
we can more easily cache needed values, so we won't have to parse user
agent several times anymore.

---------

Co-authored-by: Álvaro Velad Galván <ladvan91@hotmail.com>
2025-06-02 13:46:40 +02:00
Joey Parrish 549385be54 docs: Clarify storage.removeEmeSessions (#8586)
Closes #8479
2025-05-09 12:03:18 -07:00
loicraux 8cd2c019b8 feat(Offline): Allow no timeout when opening IndexedDB database (#8372)
This is the followup to the previous PR #8366 , to allow to disable the
timeout, as per @avelad
[suggestion](https://github.com/shaka-project/shaka-player/pull/8366#issuecomment-2766660785)
to add this in another PR...

---------

Co-authored-by: Loïc Raux <loicraux@gmail.com>
Co-authored-by: Álvaro Velad Galván <ladvan91@hotmail.com>
Co-authored-by: Wojciech Tyczyński <tykus160@gmail.com>
2025-04-01 16:01:24 +02:00
Álvaro Velad Galván 60c6b19d61 fix(Offline): Fix HLS-AES download (#8374) 2025-04-01 15:49:13 +02:00
Álvaro Velad Galván 5752a21b0f feat(Offline): Make timeout for opening IndexedDB configurable (#8366)
Close https://github.com/shaka-project/shaka-player/issues/8355
2025-04-01 11:47:33 +02:00
Álvaro Velad Galván aed6471dd4 perf(HLS): Reduce load time when loading in the player a media playlist (#8333)
This allows temporary caching of init segment and data segment used to
obtain the data (eg: codec) needed for playback.
2025-03-25 18:00:47 +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 8f0b0e3282 feat(LCEVC): Detect as supported dual track content with LCEVC (#8134)
This PR does not yet add enhancement layer decoding support.
2025-02-21 13:28:56 +01:00
Álvaro Velad Galván 4936b0c230 feat(DASH): Add dependencyVideo to video streams (#8057)
This will allow us to support dual tracks (main and enhancement layer)
in the future, for example with the LCEVC codec.
2025-02-11 18:20:25 +01:00
Álvaro Velad Galván a4305f9625 chore: Stop using "Object" in StreamBandwidthEstimator annotations (#7939)
Related to #1672
2025-01-24 11:12:19 +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 510962fc38 build: Upgrade ESLint to v9 and migrate config (#7887)
Migrates old config file to new flat config recommended by ESLint now.
Removes jsdoc rules, as they are not available anymore in ESLint.
Instead, if we want to have them, we should use `eslint-jsdoc-plugin`.
2025-01-16 10:58:03 +01:00
Álvaro Velad Galván 59c9989e49 feat(net): Add originalRequest to shaka.extern.Response (#7857) 2025-01-09 18:50:13 +01:00
vlazh 7ef0f924c3 feat: Add support for WisePlay DRM (#7854)
Some info:
https://drmnow.pro/wiseplay/

https://developer.huawei.com/consumer/en/doc/Media-Guides/client-dev-0000001050040000

---------

Co-authored-by: Álvaro Velad Galván <ladvan91@hotmail.com>
2025-01-09 16:18:23 +01:00
Álvaro Velad Galván fb8086b0a3 fix(Offline): Fix some aborted downloads continue to download (#7842)
Fixes https://github.com/shaka-project/shaka-player/issues/6311
2025-01-08 12:57:07 +01:00
Álvaro Velad Galván 21bbd93a50 fix(Offline): Allow downloading AES content (#7827)
Also adds integration tests for DASH AES-128, HLS AES-256 and HLS
SAMPLE-AES download and playback
2025-01-07 09:53:51 +01:00
Álvaro Velad Galván 50a1851f03 feat(Offline): Allow downloading some clearkey content without persistent license support (#7811)
Cases:
- Configured `drm.clearKeys`
- HLS SAMPLE-AES
2024-12-31 15:51:59 +01:00
Álvaro Velad Galván bc41643cf3 fix(Offline): Allow storage of MSS streams (#7799)
Co-authored-by: theodab <theodab@google.com>
2024-12-24 14:07:25 +01:00
Álvaro Velad Galván 179ccc61b8 chore: Move DrmEngine and DrmUtils to drm namespace (#7788) 2024-12-20 13:10:29 +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 6616ff202a feat: Simplify the use of low latency (#7748)
The autoLowLatencyMode config is removed because it's no longer
necessary. Now lowLatencyMode only enable low latency if the stream is
low latency.

A new method is added (configurationForLowLatency) to allow configure
the Low Latency config more easily
2024-12-20 10:27:39 +01:00
Álvaro Velad Galván 79a481e4ab fix: Fix usage of keySystemsMapping (#7736)
Related to https://github.com/shaka-project/shaka-player/issues/7613
2024-12-10 16:11:01 +01:00
Álvaro Velad Galván 2260aa9cf6 feat: Update usage of minBufferTime according to the DASH spec (#7616)
Related to
https://github.com/shaka-project/shaka-player/issues/7602#issuecomment-2479518970

From 23009-1:

The value of the minimum buffer time does not provide any instructions
to the client on how long
to buffer the media. The value however describes how much buffer a
client should have under
ideal network conditions. As such, MBT is not describing the burstiness
or jitter in the network,
it is describing the burstiness or jitter in the content encoding.
Together with the BW value, it is
a property of the content. Using the "leaky bucket" model, it is the
size of the bucket that makes
    BW true, given the way the content is encoded
2024-11-19 10:47:18 +01:00
Álvaro Velad Galván d8a14b0a45 fix(DASH): Fix playback after DASH period eviction (#7603)
Fixes https://github.com/shaka-project/shaka-player/issues/7516 in a
simpler way

Reverts
https://github.com/shaka-project/shaka-player/commit/5eff0384d04e22a971336c90aae0a83db2a451d5
Reverts
https://github.com/shaka-project/shaka-player/commit/037193c2d601e02c8611a4527dcb04d32adbbd27
2024-11-15 13:23:40 +01:00
ncocaign 5eff0384d0 fix(DASH): Fix playback after DASH period eviction (#7519)
With this change, closeSegmentIndex() of all streams of a removed period
are defered in StreamingEngine.onUpdate_()

Fixes #7516
2024-11-13 19:14:15 +01:00
Álvaro Velad Galván 597e129bd6 feat: Add preferredTextFormats config (#7523)
Close https://github.com/shaka-project/shaka-player/issues/4650
2024-10-31 08:53:55 +01:00
Álvaro Velad Galván e2413ed5f2 feat(HLS): Make dummy streams for tags representing muxed audio (#7343)
Close https://github.com/shaka-project/shaka-player/issues/5836
2024-09-20 23:58:56 +02:00
Álvaro Velad Galván e28a07eaae fix(offline): Text segments are downloaded before audio&video (#7336)
Support for using the old parallel download mechanism is also added.

Fixes: https://github.com/shaka-project/shaka-player/issues/4878
2024-09-18 13:04:29 +02:00
Álvaro Velad Galván 346cf48a5e feat(Offline): Allow store external text (#7328)
Close https://github.com/shaka-project/shaka-player/issues/2016
2024-09-17 13:35:36 +02:00
Álvaro Velad Galván 013b3c7f22 feat(Offline): Allow store external thumbnails (#7322)
Related to https://github.com/shaka-project/shaka-player/issues/2016
2024-09-17 09:44:53 +02:00
Álvaro Velad Galván 1434426f2c feat(Cast): Enable storage in Android Cast devices (#7292)
Related to https://github.com/shaka-project/shaka-player/issues/7253
2024-09-13 09:39:31 +02:00
Álvaro Velad Galván 789101cbba feat(DASH): Add DVB Font downloads (#6971) 2024-07-02 20:52:29 +02:00
Álvaro Velad Galván d63df145aa feat(HLS): Add support for EXT-X-START (#6938) 2024-07-02 08:54:17 +02:00
Álvaro Velad Galván 0ea31b46e6 feat: Add option to disable continue loading live stream manifest when paused (#6916)
Close https://github.com/shaka-project/shaka-player/issues/3781
2024-06-26 17:17:28 +02:00
Álvaro Velad Galván e0208148cb feat: Add isLowLatency to shaka.extern.Manifest (#6842) 2024-06-18 18:48:11 +02:00