Commit Graph

4551 Commits

Author SHA1 Message Date
Álvaro Velad Galván aaef0abd84 fix: Fix WebVTT position handling in UITextDisplayer (#9017)
Fixes https://github.com/shaka-project/shaka-player/issues/8948
2025-08-25 15:05:29 +02:00
Wojciech Tyczyński d3fcb2b598 fix: Fix buffering states when rebuffering goal is 0 (#9018)
After #7617, we stopped using the polling mechanism and playback rate to
control the buffering state, but the old behavior of checking the buffer
was still in place. Moreover, since buffer thresholds were set based on
the rebuffering goal value, when that value was 0, the underlying logic
tended to underreport buffering.

Now, when the goal is 0, Shaka will rely solely on media element events
for buffering reporting.
2025-08-25 14:43:42 +02:00
Álvaro Velad Galván c8d2452f3f fix(CMCD): Fix player expand/collapse events (#9016)
Listen fullscreenchange event on document instead of video
Fix compatibility with Apple Vision Pro
2025-08-25 12:59:27 +02:00
Juan Manuel Gonzalez c33e19e2f7 feat(CMCD): Add event mode support (#8980)
This pull request introduces comprehensive support for the CMCDv2
"event" mode in Shaka Player. This new functionality allows the player
to send real-time Common Media Client Data (CMCD) based on various
player and media events

- CMCDv2 Event Mode Implementation: Partial support for CMCDv2's "event"
mode has been implemented, enabling real-time event data reporting from
the player.
- Configurable Event Reporting: Configuration options have been
introduced to specify which CMCD keys and player events (e.g., play
state, mute/unmute, fullscreen, background mode) are included in the
reports.
- Periodic Time Interval Events: A timeInterval configuration option has
been added for periodic CMCD event reports, with a default of 10 seconds
and the ability to disable by setting it to 0.
- Unit Testing: Extensive unit tests have been added to validate the new
CMCDv2 event mode functionality across various scenarios, including
event filtering, header usage, and handling of multiple targets.

Shaka Player config for testing event mode:
```js
const cmcdConfig = {
    enabled: false,
    version: 2,
    contentId: 'id',
    useHeaders: false,
    targets: [{
        mode: 'response',
        enabled: false,
        useHeaders: false,
        url: 'http://localhost:3003/response-mode',
    },{
        mode: 'event',
        useHeaders: false,
        url: 'http://localhost:3003/event-mode',
        includeKeys: [],
        enabled: true,
    }]
}

player.configure('cmcd', cmcdConfig);
```

---------

Co-authored-by: Constanza Dibueno <121617928+cotid-qualabs@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Álvaro Velad Galván <ladvan91@hotmail.com>
2025-08-25 09:37:09 +02:00
Álvaro Velad Galván b5a8d952cd feat(Ads): Add EXT-X-DATERANGE schema for overlay support (#9014)
Spec:
[EXT-X-DATERANGE for
Overlay.pdf](https://github.com/user-attachments/files/21934641/EXT-X-DATERANGE.for.Overlay.pdf)

Note: this spec is also supported by Castlabs player
2025-08-22 12:31:24 +02:00
Álvaro Velad Galván f905bdad1d fix: Fix videoBandwidth when using LCEVC dual track (#9013) 2025-08-22 10:19:17 +02:00
Álvaro Velad Galván 062259eb96 perf(HLS): Do not store duplicated pssh data buffers (#9009)
Only for Widevine and WisePlay

Related to #9006
2025-08-21 12:16:25 +02:00
Álvaro Velad Galván 8e71a9b09b feat: Allow update some prefer* config on the fly (#9001)
Related to https://github.com/shaka-project/shaka-player/issues/8943
2025-08-21 12:13:04 +02:00
Wojciech Tyczyński 048ee45631 perf(DASH): Simplify multiperiod eviction (#9007)
When evicting segments based on time, evict only first period and
proceed to next ones only when first is already empty.
2025-08-21 11:47:48 +02:00
Wojciech Tyczyński a054b7e6ad perf(DASH): Do not store duplicated pssh data buffers (#9006)
Use PSSH string to cache init data in order to avoid creating duplicated
init data buffers. On streams with many periods due to ad insertion it
can make a difference - i.e. on stream with 50 periods this change
reduces used memory by init data buffers from 40 KB to 1 KB.

In DASH, PSSH can often be a duplicated data between protected periods
and/or adaptation sets.
2025-08-21 11:06:40 +02:00
Wojciech Tyczyński c79b7967f6 fix(EMSG): Fix memory leak in EMSG handling (#9004)
Since `RegionTimeline` is used for storing EMSG events, used memory
significantly grew when content extensively uses EMSG.

When creating EMSG region, we’re creating `message_data` by using method
`readBytes()` from `DataViewReader`. Internally, it calls
`BufferUtils.toUint8(buffer)` which creates new `Uint8Array` on shared
`ArrayBuffer`. We need to make a copy with data needed only to not store
whole segments in memory.
2025-08-21 10:17:37 +02:00
Álvaro Velad Galván 48914860af fix(ABR): Only update the variants if they are different (#8999) 2025-08-21 08:54:15 +02:00
Álvaro Velad Galván 57d3eaecf4 fix(HLS): Fix getAudioTracks in some HLS streams (#8996)
Some HLS streams have the same originalAudioId for multiple tracks, so
to avoid filtering out the tracks we want, we add the language, label,
channelsCount, and spatialAudio to get a more accurate ID.
2025-08-20 11:40:47 +02:00
Wojciech Tyczyński 41263d4359 fix: Avoid minifying AdaptationSetCriteria configuration (#8997)
When using custom adaptation set criteria, configuration fields might be
minified. Move AdaptationSetCriteria definition to externs to avoid
that.
2025-08-20 11:39:04 +02:00
Álvaro Velad Galván 43a45eab2b fix(HLS): Fix display stpp subtitles (#8995)
It also eliminates the use of private static

Fixes https://github.com/shaka-project/shaka-player/issues/8994
2025-08-20 11:30:48 +02:00
Juan Manuel Gonzalez eab22af5d3 feat(CMCD): Add bg key support (#8973) 2025-08-19 17:03:29 +02:00
Álvaro Velad Galván cb52a88509 fix: Don't filter video streams with different roles (#8991)
Related to https://github.com/shaka-project/shaka-player/issues/8943
2025-08-19 16:30:04 +02:00
Álvaro Velad Galván d7d3c51815 fix: Fix probeSupport when testing opus and flac codecs (#8987) 2025-08-19 15:59:05 +02:00
Juan Manuel Gonzalez 712850cb41 feat(CMCD): Add sn key support (#8975) 2025-08-19 15:42:01 +02:00
Wojciech Tyczyński 57f69807e1 fix(net): Throw HTTP_ERROR if request header is not valid (#8990)
`Headers` class and `XMLHttpRequest.setRequestHeader` throw an error if
added header is not a valid byte string, so we should take an advantage
of it instead of throwing an incompatible error.
2025-08-19 15:01:36 +02:00
Álvaro Velad Galván 5abfc0002b fix(HLS): Fix HLS audio only stream does not play when URI field is omitted from #EXT-X-MEDIA (#8988)
Fixes https://github.com/shaka-project/shaka-player/issues/8957

---------

Co-authored-by: Wojciech Tyczyński <tykus160@gmail.com>
2025-08-19 14:49:12 +02:00
Juan Manuel Gonzalez 51a9c9cb84 feat(CMCD): Add cmsds key support (#8977) 2025-08-19 14:48:42 +02:00
Álvaro Velad Galván dac3813bd1 fix: Fix QuickTime and MOV formats playback on Chromium (#8989)
Fixes https://github.com/shaka-project/shaka-player/issues/8942
2025-08-19 12:27:30 +02:00
Juan Manuel Gonzalez 842f2d4285 feat(CMCD): Add cmsdd key support (#8976) 2025-08-18 21:19:02 +02:00
Juan Manuel Gonzalez 863714d906 feat(CMCD): Add ttfb and ttlb keys support (#8974) 2025-08-18 19:48:13 +02:00
Juan Manuel Gonzalez 9e1ea12867 feat(CMCD): Add rc key support (#8972) 2025-08-18 16:43:15 +02:00
Juan Manuel Gonzalez c6df3cf9cf feat(CMCD): Add url key support (#8970) 2025-08-18 16:02:24 +02:00
Phyo Wai Lin d798db5059 feat(UI): Add MaterialSVGIcon element (#8969)
Add a new element for inline SVG icons that is supposed
to be a replacement for the current icon fonts.
I use filled Material Symbols Rounded icons as default.
Intended to support a future transition away from icon fonts.

Related to https://github.com/shaka-project/shaka-player/issues/2467
2025-08-18 12:38:12 +02:00
Álvaro Velad Galván e8b12d04de fix(Transmuxer): Fix bad generation of silence frames (#8983)
The code being removed is code that should have been removed previously
since video data is no longer used to generate audio silence frames.

Fixes https://github.com/shaka-project/shaka-player/issues/8951
2025-08-18 12:03:57 +02:00
Juan Manuel Gonzalez ab3a452cea feat(CMCD): Add ts key support (#8971) 2025-08-18 10:24:53 +02:00
Agajan J. b6dd9b69fa fix: Add Orange STB Back To requiresEncryptionInfoInAllInitSegments (#8966)
Classifies Orange STB as a Webkit STB device and returns true for
`requiresEncryptionInfoInAllInitSegments`

Fixes #8965
2025-08-08 10:34:44 -07:00
Martin Stark 47ea45d360 fix: avoid calling new Date(null * 1000) (#8963)
If the manifest has no PDT or PST it will currently result in calling
`new Date(null * 1000)`, equivalent to `new Date(0)`, which results in
an unexpected start time date. I believe a better behaviour in this
scenario is to simply return null, since I believe startTime resolving
to null here should be considered a valid case that shouldn't need to be
asserted against.

A manifest does not necessarily have a PDT or PST if it is a basic live
or VOD manifest. The caller of the function may not know this before
calling `getPresentationStartTimeAsDate`.

There is no good way of checking ahead of calling
`player.getPresentationStartTimeAsDate` if calling the method is valid
or not.

`startTime` being `null` here seems like a valid scenario to me. It
should not result in a erroneous call to `new Date` with `null` and
instead just return `null` and log a warning.
2025-08-07 11:05:03 -07:00
Wojciech Tyczyński 62c8367438 chore: Remove deprecated logic from GapJumpingController (#8954)
Some accidental leftover from large gap times.
2025-08-06 08:29:49 +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
Álvaro Velad Galván 656c5881fa fix: Separate gap jumping seeks from user seeks (#8911)
---------

Co-authored-by: Casey Occhialini <1508707+littlespex@users.noreply.github.com>
2025-08-04 19:47:14 -07:00
Álvaro Velad Galván 5654aea946 feat: Expose video label in Track and VideoTrack (#8947) 2025-07-31 16:15:47 +02:00
Álvaro Velad Galván 570fec9d31 feat: Support videoRole in AdaptationSetCriteria (#8945)
Add preferredVideoRole config
`preferredVariantRole` has been renamed to `preferredAudioRole`

Related to https://github.com/shaka-project/shaka-player/issues/8943
2025-07-31 14:38:09 +02:00
Álvaro Velad Galván 4967e5278a feat: Expose video roles in Track and VideoTrack (#8944)
Related to https://github.com/shaka-project/shaka-player/issues/8943
2025-07-31 14:00:29 +02:00
Álvaro Velad Galván ca01e1c228 chore: Fix some extends definitions (#8941) 2025-07-30 17:05:38 +02:00
Álvaro Velad Galván 4aa896197b docs: Fix downloadfailed event definition (#8938) 2025-07-30 16:08:12 +02:00
Álvaro Velad Galván 087387bbcb fix(DASH): Fix Playback Fails on Widevine L1/L3 Streams (#8936)
Fixes https://github.com/shaka-project/shaka-player/issues/8934
2025-07-30 13:16:10 +02:00
Álvaro Velad Galván 5e8e536e7e chore: Simplify onKeyStatus_ method (#8935) 2025-07-30 11:39:42 +02:00
Álvaro Velad Galván f4f36768cb fix: Reset MSE when the current readyState is closed (#8930)
Sometimes Safari's MSE status changes to closed when there are internal
errors. Scheduling a reset in this case will help resolve them.

Example 
<img width="1082" height="1194" alt="imagen"
src="https://github.com/user-attachments/assets/e2f0349b-0a90-4ea4-bc04-0cf66a887da3"
/>

---------

Co-authored-by: Theodore Abshire <TheodoreAbshire@Gmail.com>
2025-07-30 09:33:40 +02:00
Joey Parrish ddda658d39 chore: Update to the latest Closure Compiler (#8925)
- Bump to Java 21 to support the new compiler.
 - Removes externs now included in the compiler.
 - Removes compiler flag no longer supported.
- Adds onkeystatuseschange to MediaKeySession polyfills (now in compiler
externs).
- This new compiler now triggers a warning in the Closure Library, which
will get fixed in a follow-up to update the library.
2025-07-29 10:36:40 -07:00
Álvaro Velad Galván 42ee4db243 chore: Simplify back to play after MSE reset (#8929) 2025-07-29 14:10:52 +02:00
Wojciech Tyczyński 7b5109810f perf: Simplify region timeline buffer management (#8921)
Use `buffered` property directly, as there is no need for us to create
ranges from SourceBuffers. Also, just take start and end from frist and
last range, respectively, looping is unnecessary.
2025-07-28 12:12:59 +02:00
Álvaro Velad Galván bdae7a0863 fix: Check that the current reference exists before updating codecs (#8920) 2025-07-28 10:53:55 +02:00
Agajan J. d4e08097a0 fix: Session Update Error Handling For Youview Platform (#8918)
Fixes https://github.com/shaka-project/shaka-player/issues/8917
2025-07-28 10:44:03 +02:00
Álvaro Velad Galván e3c86315d3 feat(Queue): Add preloadPrevItem config (#8910) 2025-07-28 10:23:49 +02:00
Álvaro Velad Galván 1ec86ef120 fix: Fix Apple Vision Pro integration with some features (#8915)
Apple Vision Pro supports `webkitSupportsFullscreen` and
`webkitDisplayingFullscreen`, but it doesn't suppport
`webkitPresentationMode`.
2025-07-28 10:03:39 +02:00