Commit Graph

197 Commits

Author SHA1 Message Date
Álvaro Velad Galván f8abc76dcf docs: Fix NO_VIDEO_ELEMENT doc on v5 (#9697) 2026-02-11 13:16:48 +01:00
Álvaro Velad Galván 674e71d064 fix(Ads): Harden MediaTailorAdManager state and cuepoint handling (#9619)
This change improves MediaTailor ad handling by:
- Deduplicating cue points to avoid repeated ad markers
- Guarding ad break listener setup to prevent event duplication
- Cleaning up ad state more defensively on stop/end
- Improving static resource caching and tracking robustness

These fixes prevent duplicate events, listener leaks, and inconsistent
ad playback during manifest updates and polling.

---------

Co-authored-by: Theodore Abshire <TheodoreAbshire@Gmail.com>
Co-authored-by: Wojciech Tyczyński <tykus160@gmail.com>
2026-01-29 12:39:14 +01:00
Wojciech Tyczyński 5c05132772 feat!: Use shared logic for MediaError details (#9594) 2026-01-22 20:50:32 +01:00
Álvaro Velad Galván e5d9471fa5 feat(HLS): Add AES-256-GCM support (#9562)
More info in:
https://datatracker.ietf.org/doc/draft-pantos-hls-rfc8216bis/19/ and
https://mailarchive.ietf.org/arch/msg/hls-interest/85CoeMS9O2zRoMff_Xx_WgCukJg/
2026-01-15 14:18:02 +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 643e2c8b62 feat!: Simplify shaka.ads.AdManager interface (#9357) 2025-11-06 13:29:42 +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 c94a34f5d5 fix: Fix CANNOT_ADD_EXTERNAL_CHAPTERS_TO_LIVE_STREAM error code (#9138)
Fixes https://github.com/shaka-project/shaka-player/issues/9137
2025-09-26 13:57:01 +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 3daeac65cd feat: Add queue manager (#8649)
Close #8508

---------

Co-authored-by: Wojciech Tyczyński <tykus160@gmail.com>
2025-05-29 12:41:30 +02:00
Álvaro Velad Galván 627128252e fix: Allow use Chapter API on browsers without track element support (#8515)
Co-authored-by: Wojciech Tyczyński <tykus160@gmail.com>
2025-04-25 12:16:07 +02:00
Álvaro Velad Galván 6583f96164 fix: Throw preload destroyed error when re-using same preloadManager (#8046)
Related to https://github.com/shaka-project/shaka-player/issues/8042
2025-02-10 13:31:31 +01:00
Álvaro Velad Galván 455163f874 feat: Add new error code when the streaming is not allowed (#7994)
Maybe related to
https://github.com/shaka-project/shaka-player/issues/7960
2025-01-30 18:10:18 +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 3a83e7693f feat: Add new error code for missing EME support (#7596)
Close https://github.com/shaka-project/shaka-player/issues/4495
2024-11-14 18:41:08 +01:00
Álvaro Velad Galván c1e26eafe6 fix(Ads): Fix VAST_INVALID_XML error code (#7593) 2024-11-14 12:57:36 +01:00
Gregory McGarry c9f7723d23 feat: Support Fairplay DRM in DASH manifest. (#7454)
Support Fairplay DRM for DASH, specifying the license server in the
manifest using dashif:Laurl.
2024-10-24 09:36:35 +02:00
Álvaro Velad Galván c59922bae5 feat(Ads): Add basic VAST support without IMA (#7052)
This only includes playback, no tracking is sent.
2024-07-17 11:00:43 +02:00
Álvaro Velad Galván 9e1f4e7b8c feat(Ads): Allow the use of custom interstitials ads (#6991) 2024-07-08 14:22:55 +02:00
Álvaro Velad Galván b3df270a3e fix(HLS): Add HLS_EMPTY_MEDIA_PLAYLIST error (#6951) 2024-07-04 09:09:21 +02:00
Joey Parrish 8d680e56b4 feat: Add segment URIs to segment-related errors (#6714)
This makes it more feasible to debug and fix transmuxer bugs or other segment append failures.

Closes #6712
2024-05-31 09:41:45 -07:00
Dave Nicholas d38aabf04d feat(DASH): Add MPD Patch support (#5247)
Closes https://github.com/shaka-project/shaka-player/issues/2228

---------

Co-authored-by: Wojciech Tyczyński <wojciech.tyczynski@sky.uk>
2024-05-29 08:11:28 +02:00
Álvaro Velad Galván ed939872e1 feat: Add response URI to BAD_HTTP_STATUS error (#6561)
Closes https://github.com/shaka-project/shaka-player/issues/2969
2024-05-08 20:17:36 +02:00
Joey Parrish 250ad33b3e test: Fix missing HLS parser in tests (#6284)
A test suite that overwrites the HLS parser needs to restore it afterward.  To aid in debugging future parser issues, this adds the detected or specified MIME type to the error object for UNABLE_TO_GUESS_MANIFEST_TYPE.

Closes #5834
2024-02-22 14:11:18 -08:00
theodab 489b11a959 feat: Add preload system to player (#5897)
Adds a new player method, preload. This asynchronous method creates a PreloadManager object, which
will preload data for the given manifest, and which can be passed to the load method (in place of an asset URI)
in order to apply that preloaded data. This will allow for lower load latency; if you can predict what asset will
be loaded ahead of time (say, by preloading things the user is hovering their mouse over in a menu),
you can load the manifest before the user presses the load button.
Note that PreloadManagers are only meant to be used by the player instance that created them.

Closes #880

Co-authored-by: Álvaro Velad Galván <ladvan91@hotmail.com>
2024-02-02 00:27:29 -08:00
Álvaro Velad Galván 6102060028 fix: Fix transmuxer when sample has no video data (#5933)
Fixes https://github.com/shaka-project/shaka-player/issues/5931
2023-11-27 10:28:14 +01:00
Álvaro Velad Galván c2c8320251 fix(Offline): Fix download of some HLS manifests (#5861) 2023-11-06 20:38:49 +01:00
Álvaro Velad Galván 88e4cd4116 feat: Add thumbnails support in src= (#5802)
Closes https://github.com/shaka-project/shaka-player/issues/5778
2023-10-26 07:54:17 +02:00
Álvaro Velad Galván cf5a72bb51 feat(Ads): Add support for AWS Elemental MediaTailor (#5679) 2023-09-28 09:55:26 +02:00
Álvaro Velad Galván 96ae7f2fe6 feat(DASH): Add support for AES-128 (#5656)
Closes https://github.com/shaka-project/shaka-player/issues/5622
2023-09-16 07:34:42 +02:00
Álvaro Velad Galván 3c76f62dbe chore: Rename HLS_AES_128_* to AES_128_* (#5654)
This change is required in preparation for
https://github.com/shaka-project/shaka-player/issues/5622
2023-09-13 20:52:16 +02:00
Joey Parrish a19912e5bf fix: Fix compiled-mode error formatting (#5623)
We declare shaka.util.Error to extend the native Error, but only supplied a message field in uncompiled and debug modes.  This broke the Jasmine test framework when it tried to extract error message information from a compiled-mode shaka.util.Error object.

Now we always supply a message object, and merely skip the fancy enum formatting in compiled mode.
2023-09-08 13:30:04 -07:00
Cristian Atehortua 7d049eb8cb feat: Include stack trace in errors dispatched from production builds (#5407)
Fixes #5406
2023-07-19 11:44:41 -07:00
Vincent Valot cc97da167f feat: allow reuse of persistent license sessions (#4461)
Add capability to re-use persistent license sessions across sessions.

DrmEngine will now always:
- try to start stored persistent sessions before trying to fetch a
license, as-to be able to check if all needed keys are already loaded.
- ask for a new license when the persistent session doesn't have the
needed keys for playback,

Given the flag `persistentSessionOnlinePlayback` is true, DrmEngine:
- won't remove the persistent session from the device at the end of the
playback,
- won't throw an error when the persistent session isn't found on the
device,

For now, it needs Shaka's users to persist session information by
themselves (localStorage, IndexDB, ...) before giving it back for the
next session. Still, it lays foundation to develop the feature to fully
handling it on Shaka's side.

Related to #1956
2023-04-19 15:18:34 -07:00
Álvaro Velad Galván f80bf208b1 feat(MSS): Add support for Microsoft Smooth Streaming (VOD only) (#5002)
Closes https://github.com/shaka-project/shaka-player/issues/703

---------

Co-authored-by: Joey Parrish <joeyparrish@google.com>
2023-03-24 07:47:33 +01:00
Tiago Lopes 67a245129f feat(logs): Add extra logging for 3015 errors (#4932)
This adds extra context to 3015 (MEDIA_SOURCE_OPERATION_THREW) errors, by attaching
the error  on the media element. This is helpful because, in some situations, media source operations
can have very unhelpful exception strings like:
`Error: Failed to execute 'appendBuffer' on 'SourceBuffer': The HTMLMediaElement.error attribute is not null`
2023-01-27 16:30:21 -08:00
Álvaro Velad Galván 61613cf0ee feat: Config to require a minimum HDCP version (#4883)
https://github.com/WICG/hdcp-detection/blob/main/explainer.md

Co-authored-by: Joey Parrish <joeyparrish@users.noreply.github.com>
2023-01-11 21:04:16 +01:00
theodab d4d37407c8 fix(offline): Add storage muxer init timeout (#4566)
In some cases, indexedDB.open() can end up calling neither callback.
When this does happen, according to my initial testing, it happens
consistently when reloading the page, so it's not a one-off fluke but
presumably some sort of implementation or browser install problem. If
that does happen, the init promise of the storage muxer hangs forever,
potentially blocking other operations from happening. This adds a
timeout to the invocation of indexedDB.open(), after which the operation
fails with a new error.
2022-10-13 15:35:55 -07:00
Álvaro Velad Galván 3582f0a727 feat: Add external thumbnails support (#4497)
JW spec:
https://docs.jwplayer.com/platform/docs/vdh-add-preview-thumbnails

Video.js implementation:
https://github.com/chrisboustead/videojs-vtt-thumbnails

Note: thumbnails with sprites are not supported yet.
2022-09-30 22:25:05 +02:00
Joey Parrish 91003d3170 chore: Clean up unused AES-128 failure paths (#4450)
Now that we support AES-128, some older AES-128 code paths in the HLS
parser have become obsolete.  This cleans up those unneeded code paths
and adds a test to ensure that the correct failure handling is used
when AES-128 cannot be supported by the platform.
2022-08-29 12:15:29 -07:00
theodab 3a0e40ee04 chore(HLS): Retired unused error code (#4428)
Now that #2337 has been implemented, the error code HLS_INTERNAL_SKIP_STREAM
is no longer used anywhere in the code.
This retires that error, and also cleans up the code that previously
was responsible for handling that error being fired.

Pre-work for #1936
2022-08-19 20:59:13 -07: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 5441f932fd feat: Add support for Modern EME and legacy Apple Media Keys for FairPlay (#4309) 2022-06-29 07:13:53 +02:00
Joey Parrish 80e81f1391 fix: Wait for chapters track to be loaded (#4228)
addChaptersTrack() was already an async method, but it did not wait
for the chapter data to be loaded by the browser.  The solution is to
wait for the `load` event on the `<track>` element we create.

To accomplish this, some cleanup and refactoring was done in how
tracks are managed.  Summary of changes:

 - The `addtrack` event, which triggered management of tracks in src=
   playback, is now used for all types of playback.  In src= mode, it
   manages all tracks, and in MSE mode, it only manages chapters
   tracks (which are added to the video element as in src= mode).
 - `processChaptersTrack_()` has been renamed to
   `activateChaptersTrack_()`, since its only job is to set the
   track's mode field to make the browser load it.
 - `activateChaptersTrack_()` is now only ever called via the
   `addtrack` event.
 - `activateChaptersTrack_()` no longer loops over all chapter tracks
   on a timer, and instead only touches the single track it was
   called for.
 - `addSrcTrackElement_()` now returns the HTML `<track>` element it
   creates.
 - `addChaptersTrack()` now awaits a `load` or `error` event to
   complete (or fail) the operation.
 - Existing tests for addChaptersTrack had long delays to work around
   this issue; these delays have simply been removed.

Fixes #4186
2022-05-16 16:10:44 -07:00
Álvaro Velad Galván 14e61a7368 feat(hls): Add support for EXT-X-GAP (#4208)
Related to 42eecc84
Closes #1308
2022-05-10 13:19:46 -07:00
Álvaro Velad Galván 8bb70449d3 feat!: Remove support for Safari 12 and iOS 12 (#4112)
1. Remove support for Safari 12
2. Support modern EME in Safari 13
3. Remove EME Apple polyfill
4. Update documentation
2022-04-11 16:17:51 -07:00
theodab 48dd20562c fix(hls): Support playing media playlists directly (#4080)
Closes #3536
2022-03-30 17:27:50 -07:00
Joey Parrish 1507b1e844 chore: Update URLs after moving projects (#4008) 2022-03-03 14:34:40 -08:00
Michelle Zhuo 36d0b5484f feat(HLS): Containerless format support
This adds code to allow Shaka Player to play media in sequence
mode, an alternate playback mode that makes the browser ignore
media timestamps, when playing HLS media.
This is important for containerless media formats, as they do not
contain such timestamps.
Changing HLS to not require timestamps also means that we no
longer need to fetch media segments in order to get the start
time, which should lower bandwidth usage and startup delay.
In initial tests, on a simulated 3G network, load latency went down
from an average 3.16s to 2.61s on the HLS version of "Big Buck Bunny:
the Dark Truths of a Video Dev Cartoon"; an improvement of about 17%.

Issue #2337

Change-Id: I507898d74ae30ddfb1bddf8dce643780949fbd9b
2022-02-08 09:34:03 -08:00
Vincent Valot 6d76a135e5 feat: add modern EME support for FairPlay (#3776)
Add support for HLS com.apple.streamingkeydelivery through MSE/EME implementation.

Close #3346

## Tests
Tested on:
- Mac 11.6 Safari 15.2
- iOS 15.2 Safari 15.2
- Mac 11.6 Chrome 96 (for potential regressions on Widevine keySystem)

| Mode | DRM API | TS | CMAF (mono-key and multi-keys)
|---|---|---|---|
| file | EME |   |   |
| file | Legacy-prefixed |    |    |
| media-source | EME | **mux-js**: `encrypted` never fired<br />**real MSE**: `encrypted` event received, but with incorrect `sinf` initData (*1)  |   |
| media-source | Legacy-prefixed | **mux-js**: `webkitneedkey` never fired<br/>**real MSE**: TBD  | 🔴 fails to append media segment to SourceBuffer (init segment ok) `(video:4) – "failed fetch and append: code=3015"` |

## Support table 
| Mode | DRM API | TS | CMAF (mono-key and multi-keys)
|---|---|---|---|
| file | EME |   |   |
| file | Legacy-prefixed |    |    |
| media-source | EME | 🚫 `4040: HLS_MSE_ENCRYPTED_MP2T_NOT_SUPPORTED`  |   |
| media-source | Legacy-prefixed | 🚫 `4041: HLS_MSE_ENCRYPTED_LEGACY_APPLE_MEDIA_KEYS_NOT_SUPPORTED`  |🚫 `4041: HLS_MSE_ENCRYPTED_LEGACY_APPLE_MEDIA_KEYS_NOT_SUPPORTED` |

⚠️ Use EME APIs with multi-keys CMAF makes the video stalling with the audio continuing alone after a short time (~3 minutes in the stream, could be shorter, could be longer). Didn't find an explanation to that yet. I've observed the same behaviour with hls.js code so I don't think this is a player issue.
2022-02-07 11:17:22 -08:00