Commit Graph

241 Commits

Author SHA1 Message Date
Á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 789101cbba feat(DASH): Add DVB Font downloads (#6971) 2024-07-02 20:52:29 +02:00
Álvaro Velad Galván c866d7b467 feat(HLS): Allow disable streams when the media playlist fails (#6807) 2024-06-13 09:32:09 +02:00
Álvaro Velad Galván 2ec64442e2 feat(HLS): Add support for EXT-X-DATERANGE (#6718)
Closes https://github.com/shaka-project/shaka-player/issues/3523
2024-06-03 10:10:39 +02:00
Álvaro Velad Galván 329d42ad56 feat: Parse colorGamut and use it in MCap (#6663) 2024-05-24 08:59:06 +02:00
Wojciech Tyczyński c9b61fe351 perf(DRM): pass preferredKeySystems to filterManifest() (#6468)
Follow up to #5391
Always use `preferredKeySystems` during manifest filtering, not only via
DRM Engine.
2024-04-23 14:27:36 -07:00
theodab 1da5da9790 fix(DASH): Fix support for multi-mimeType variants (#6348)
A previous PR, #5950, added support for variants that contain multiple
different codecs.
It was supposed to also add support for variants with multiple
mimeTypes, but that part didn't work correctly. This reworks a lot of
#5950 and #6047, to change how they handle such complicated variants.

This has the side-effect of allowing the stream utils to differentiate
between content that has multiple codecs because of type changes, and
content that has multiple codecs because of being muxed video+audio.

Fixes #6010

---------

Co-authored-by: Álvaro Velad Galván <ladvan91@hotmail.com>
2024-04-10 02:48:57 -07:00
Álvaro Velad Galván 47602c6f5e feat!: Remove com.adobe.primetime keysystem (#6189)
`com.adobe.primetime` is not implemented in any browser and no one has
reported any problems in the 8 years of Shaka Player.
2024-01-30 20:02:44 +01:00
Álvaro Velad Galván 5acc773364 fix(offline): Fix store persistent licenses with drm info in the pssh (#6143)
Fixes https://github.com/shaka-project/shaka-player/issues/6141
2024-01-24 07:38:50 +01:00
Álvaro Velad Galván 51edeaefa0 fix: Fix variant filtering by preferredAudioChannelCount (#5859)
Fixes https://github.com/shaka-project/shaka-player/issues/5858
2023-11-06 11:49:20 +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 f4a35f2c3f fix(offline): Fix server certificate error when trying to store content (#5848)
Fixes https://github.com/shaka-project/shaka-player/issues/5132
2023-11-02 18:35:35 +01:00
theodab 4425dca283 chore: Remove state engine (#5752)
The state engine mechanism, designed for the player class, was
over-engineered. The structure of the class makes debugging player
errors unnecessarily annoying, by obfuscating the code-path the error
followed, and in general
has created a significant amount of technical debt.
This changes the player to use an async-await setup for the top-level
operations, laying things out much more cleanly
and linearly.

---------

Co-authored-by: Álvaro Velad Galván <ladvan91@hotmail.com>
2023-10-30 23:59:08 -07:00
Álvaro Velad Galván 5aa3597074 fix: Fix incompatible codec is selected in Windows Edge for Widevine (#5831)
Fixes https://github.com/shaka-project/shaka-player/issues/4242
2023-10-30 16:23:13 +01:00
Álvaro Velad Galván 81fc82b6b2 feat(HLS): Add support for REQ-VIDEO-LAYOUT (#5809)
Also add preferredVideoLayout config
2023-10-26 09:25:45 +02:00
Álvaro Velad Galván 1271a18fec feat: Add getBandwidthEstimate to the player interface for custom manifest parser (#5714) 2023-10-03 17:23:34 +02:00
Álvaro Velad Galván 0bbb47025e feat(DASH): Add new config to prevent mixing of audio representations from different adaptation sets (#5620)
Closes https://github.com/shaka-project/shaka-player/issues/5461
2023-09-13 22:38:00 +02:00
Álvaro Velad Galván b16d2f0bf3 feat: Add manifestupdated event (#5602) 2023-09-05 08:15:18 -07:00
Álvaro Velad Galván de19884dd1 fix(HLS): Fix external subtitles out of sync in HLS (#5491)
Fixes https://github.com/shaka-project/shaka-player/issues/5458
Fixes https://github.com/shaka-project/shaka-player/issues/5443
2023-08-21 09:00:07 -07:00
Wojciech Tyczyński f53349fc93 feat: Add originalLanguage to the Track structure (#5409)
Shaka in most of places normalizes tracks' language code to be compliant with ISO 639-1 when possible. However, it does not do that all the time (i.e. normalization is missing in MSS parser) and there is no way to get value that has been explicitly set in a manifest. Moreover, documentation is misleading, as it claims that value is taken directly from a manifest.
Normalization should take place, specifically to easify PeriodCombiner algorithm and also to not break existing applications.
However, original value can be desired for some implementations.
This PR introduces new field to get original language value from the manifest.
2023-07-18 02:09:17 -07: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
Álvaro Velad Galván 2b50b88030 feat(HLS): Add HLS support for non-sequence mode (#4623) 2023-01-30 21:22:30 +01:00
Joey Parrish a7f0be726d fix: Fix HLS lazy-loading with DRM (#4646)
Now that DRM info is only parsed after playback has begun, the manifest
parser needs to communicate back to the other components that new DRM
info is available after lazy-loading a playlist.

Closes #4622
2022-11-04 08:31:52 -07:00
Joey Parrish a16b1ac8a4 fix: Fix HLS dynamic to static transition (#4483)
fix: Fix HLS dynamic to static transition

 - Keep maxSegmentEndTime_ updated in PresentationTimeline by calling
   notifySegments on each HLS playlist update, so that the seek range
   doesn't revert to the original playlist size when it becomes
   static.
 - Wait to change the presentation type to VOD until after _all_
   active playlists have an ENDLIST tag, to avoid missing the final
   segments in one type or the other.
 - Stop updating the playlists after transition to VOD.
 - Update the MSE duration at exactly the same time as we transition
   to VOD, to avoid a loophole where the UI knows it's VOD, but
   doesn't have any way to get the correct duration.  Previously, this
   state would persist until the final segments were appended.

Closes #4431
2022-09-13 13:44:44 -07:00
Joey Parrish c07447f00e fix(offline): Clean up orphaned segments on abort (#4177)
If a storage operation is aborted (via API, not via closing the page),
this will now be cleaned up from the database.  More work is needed to
find and remove orphaned segments in the database.

Related to #4166 and follow-up to PR #4176.
2022-04-29 20:11:31 -07:00
Joey Parrish c1c9613512 fix(offline): Speed up offline storage by ~87% (#4176)
By waiting for all segment data to be written to the database before updating the manifest, we can speed up offline storage in the foreground by ~87%.

Closes #4166
2022-04-29 16:34:23 -07:00
Álvaro Velad Galván 73f6de3e01 feat(offline): improve the speed of offline downloads (#4168)
Add the possibility to configure the number of downloads in parallel per stream. If you put a higher value the download time can decrease.

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

Co-authored-by: Joey Parrish <joeyparrish@users.noreply.github.com>
2022-04-28 11:30:52 -07:00
Joey Parrish ac5acc80cb feat!: Remove deprecated features, update upgrade guides (#4089)
Below are the changelog entries for each deprecated feature removed by this commit.

-----

feat(config)!: `manifest.dash.defaultPresentationDelay` has been replaced by `manifest.defaultPresentationDelay` (deprecated in v3.0.0)

feat(config)!: Configuration of factories should be plain factory functions, not constructors; these will not be invoked with `new` (deprecated in v3.1.0)

feat(player)!: `shaka.Player.prototype.addTextTrack()` has been replaced by `addTextTrackAsync()`, which returns a `Promise` (deprecated in v3.1.0)

feat(ui)!: `shaka.ui.TrackLabelFormat` has been renamed to `shaka.ui.Overlay.TrackLabelFormat` (deprecated in v3.1.0)

feat(ui)!: `shaka.ui.FailReasonCode` has been renamed to `shaka.ui.Overlay.FailReasonCode` (deprecated in v3.1.0)

feat(offline)!: `shaka.offline.Storage.prototype.store()` returns `AbortableOperation` instead of `Promise` (deprecated in v3.0.0)

feat(offline)!: `shaka.offline.Storage.prototype.getStoreInProgress()` has been removed; concurrent operations are supported, so callers don't need to check this (deprecated in v3.0.0)

feat!: `shaka.util.Uint8ArrayUtils.equal` has been replaced by `shaka.util.BufferUtils.equal`, which can handle multiple types of buffers (deprecated in v3.0.0)

feat(manifest)!: `shaka.media.SegmentIndex.prototype.destroy()` has been replaced by `release()`, which is synchronous (deprecated in v3.0.0)

feat(manifest)!: `shaka.media.SegmentIterator.prototype.seek()`, which mutates the iterator, has been replaced by `shaka.media.SegmentIndex.getIteratorForTime()` (deprecated in v3.1.0)

feat(manifest)!: `shaka.media.SegmentIndex.prototype.merge()` has become private; use `mergeAndEvict()` instead (deprecated in v3.2.0)

feat(plugin)!: `AbrManager` plugins must implement the `playbackRateChanged()` method (deprecated in v3.0.0)

feat(plugin)!: `shaka.extern.Cue.prototype.spacer` has been replaced by the more clearly-named `lineBreak` (deprecated in v3.1.0)

feat(plugin)!: `IUIElement` plugins must have a `release()` method (not `destroy()`) (deprecated in v3.0.0)
2022-04-11 17:11:40 -07:00
Joey Parrish 1507b1e844 chore: Update URLs after moving projects (#4008) 2022-03-03 14:34:40 -08:00
Álvaro Velad Galván 36ca820877 fix: Fix download of some HLS assets (#3934)
Fix download of https://devstreaming-cdn.apple.com/videos/streaming/examples/img_bipbop_adv_example_ts/master.m3u8

The filterManifestByMediaCapabilities method is async, but the code doesn't wait for it to finish before continuing the download process. This PR fix it.

This also fixes a hidden compiler issue caused by the use of an alias for StreamUtils.
2022-02-10 08:36:50 -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
Casey Occhialini 221637a66c feat: Add Common Media Client Data (CMCD) logging support (#3662)
Add support for including Common Media Client Data (CMCD) in outgoing requests.

Fixes #3619

NOTE: The following fields have not been implemented: rtp, nrr, nor, dl

Co-authored-by: Dan Sparacio <daniel.sparacio@cbsinteractive.com>
2021-10-20 12:22:41 -07:00
Theodore Abshire aded252e40 feat(offline): Make segment storage stateless.
This refactors the storage mechanism so that the method that
attaches a segment to the manifest is be a stateless async method,
and no longer needs to be in the same session as the method that
stored the manifest.
This is the end of phase one of the work towards allowing Shaka
Player to use background fetch to store assets offline.
This change will allow a service worker to store the segments as
they are downloaded, without having to keep the Shaka Player
instance alive.

Issue #879

Change-Id: I6a3545c57bacaf7229fe8c32669e88c6cc4e4138
2021-09-07 17:05:46 +00:00
Theodore Abshire db8ad31bfb feat(offline): Load init segments first for keys
It is unlikely that we will be able to load DRM sessions inside
the service worker for BG fetch. However, sometimes we have to get
the DRM keys from the init segments.
This changes Storage.downloadSegments_ to download the init segments
first if it looks like they will contain needed init data to create
license requests.
This also fixes a typo that was preventing us from getting init data
from segments, and adds a test that would catch that issue.

Issue #879

Change-Id: Ide859ed0eb2d9208150787f14d915135df681d96
2021-08-12 21:03:04 -07:00
Theodore Abshire 5215f5319f feat(offline): Changed store order of operations.
This changes the order that things happen when the offline storage
mechanism stores a manifest, so that the manifest is made and the
segments are downloaded in separate steps.
This is in preparation for adding background fetch support.

Issue #879

Change-Id: I4451db839b654f6134f06a58c240a9ca98d31a4e
2021-08-10 23:23:13 -07:00
Álvaro Velad Galván 2a4083bab8 feat: Add support to HLS Image Media Playlists (#3365)
Close: #2429
2021-06-02 10:53:32 -07:00
Michelle Zhuo 9709086e98 refactor(MediaCap): Remove MediaCapabilities config
Remove "useMediaCapabilities" configuration in the code base.

Issue #1391

Change-Id: I5fc74e31666840828e9dc04a5733db3eaed0d21a
2021-05-21 20:39:06 +00:00
Michelle Zhuo 9a706ef90e feat(CodecPreference): Add preferred codecs config
Adding the "preferredVideoCodecs" and "preferredAudioCodecs"
configuration, so that the application can set their own preferences
when choosing a codec.

Issue: #2179
Change-Id: Ib56aec10613dda9b7dce8e465c5f1d81540c34fd
2021-05-21 18:59:04 +00:00
Michelle Zhuo 79d5fd8ca0 feat(MediaCap): Add preferredDecodingAttributes config
We'll allow users to configure the decoding attributes they prefer when
choosing codecs through the configuration. The attributes include
'smooth', 'powerEfficient' and 'bandwidth'.

For example, if the user configures the field as ['smooth',
'powerEfficient'], we'll filter the variants and keep the smooth ones
first, and if we have more than one available variants, we'll filter and
keep the power efficient variants.
After that, we choose the codecs with lowest bandwidth if we have
multiple codecs available.

Issue #1391

Change-Id: Ief3f6d8ff98fabff5ec99bb0365cdc6a36d2ab2d
2021-05-11 23:50:29 +00:00
Álvaro Velad Galván 69c310cefd fix: Fix STORAGE_LIMIT_REACHED error masked by DOWNLOAD_SIZE_CALLBACK_ERROR (#3396) 2021-05-10 13:39:56 -07:00
Michelle Zhuo 0f0c9409c3 feat(MediaCap): Skip filtering by DrmEngine with MediaCap enabled
When we use decodingInfo() with the drmInfo of the variants to get media
keys, the decodingInfo result can tell us whether the variant's DRM is
supported by the platform. Thus, filterManifestByDrm_() is no longer
needed with MediaCapabilities enabled.

Issue #1391
Closes #3334

Change-Id: I34fbb3e11877f02cae1d435e9dbf274ce0e691dc
2021-04-20 07:48:49 -07:00
Michelle Zhuo 2f65b97b79 feat(MediaCap): Use MediaCapabilities for offline storage
Issue #1391

Change-Id: Ifdf4477d3798ddacf77036f7d85d9cb29438becc
2021-04-07 19:50:51 +00:00
Michelle Zhuo b63a64e4ba feat(MediaCap): Use mediaKeySystemAccess from decodingInfo in DrmEngine
In DrmEngine, previously we created MediaKeySystemConfiguration for the
variants, and called navigator.requestMediaKeySystemAccess() to get the
mediaKeySystemAccess, and set up MediaKeys.

Now we can use the mediaKeySystemAccess from the decodingInfo results of
the variants directly to set up MediaKeys.

Issue #1391

Change-Id: Id93a5e2fed7f6827317ae11644967185fc0cffbd
2021-04-07 19:32:47 +00:00
Vincent Valot b4595d5a59 feat(drm): make dash keySystems configurable (#3276)
Make the DASH keySystems configurable, so that any developer could chose to opt-in for recommendation based on DASH DRM UUID.

Example:
player.configure({
  dash: {
    keySystemsByURI: {
      'urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95': 'com.microsoft.playready.recommendation',
    }
  }
});
2021-04-02 17:33:39 -07:00