Commit Graph

40 Commits

Author SHA1 Message Date
Álvaro Velad Galván 1a845ec353 feat(MSF): Provide a bandwidth estimate for ABR purposes (#10016)
Co-authored-by: Wojciech Tyczyński <tykus160@gmail.com>
2026-04-23 10:57:10 +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
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 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 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 adb1aca180 test: Stop correctly DASH parser (#5715) 2023-10-03 17:48:11 +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 b16d2f0bf3 feat: Add manifestupdated event (#5602) 2023-09-05 08:15:18 -07: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 fbbd63d96b test: Late load tests, fix Chromecast test flake (#4115)
This change fixes tests on Chromecast by loading tests later in the process.  Test scripts are now dynamically inserted by boot.js, rather than loaded by Karma.  The bootstrapping code then awaits the completion of that before starting the Karma frameworks (Jasmine) to run the tests.

This also removes the use of goog.provide/goog.require in tests and test utils.  We don't need to load test utils or library sources dynamically in each test, and this gives us more explicit control over script loading and ordering.

Closes #4094
2022-04-11 15:47:48 -07:00
Joey Parrish 1507b1e844 chore: Update URLs after moving projects (#4008) 2022-03-03 14:34:40 -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
Jacob Trimble 78357ed785 fix(media): Fix playback of some multi-Period content.
When a Period has segments outside the Period, we evict them during
manifest parsing.  However, this eviction shouldn't affect the position
of segments since these never existed.

Fixes #3230

Change-Id: I0494d9c38b51857967ed4b572475ddcc37f815a0
2021-03-17 16:39:11 +00:00
michellezhuo 8df67bd3f8 build: add goog.require for compiler upgrade (Part2)
This change includes files under test/dash, test/hls and test/media
folders.

Change-Id: Ifdfcf5a6d6132b79e834e0dad016fc17d09c502c
2020-10-07 19:20:18 +00:00
Joey Parrish 7e6a0f38ff fix: Correct license headers in misc. files
This corrects/normalizes license headers in misc. files, such as
config files, docs, build tools, tests, and externs.  This does not
affect the compiled output, and is only done for consistency.

Issue #2638

Change-Id: I9d8da2de55243b08d7df2b743aac73c6f15e858a
2020-06-09 16:13:56 -07:00
Joey Parrish 1ab3f9c6db Remove position from SegmentReference
As part of Period-flattening, I'm trying to remove our dependence on
the "position" field of SegmentReference.  With that eliminated, we
can more easily concatenate Arrays of SegmentReferences without
modifying them.

 - Make SegmentIndex iterable
 - Add specialized seek() and current() methods to SegmentIterator
 - Remove position from SegmentReference
 - Make positions in SegmentIndex API stable without field in
   reference
 - Remove brittle hard-coded positions in tests (except SegmentIndex
   tests, where they would be hard to avoid in testing methods
   separately)
 - Use SegmentIterator in StreamingEngine to track the next segment
   between switches

Issue #892 (refactor StreamingEngine)
Issue #1339 (period flattening)

Change-Id: I666cc21249c34ee6cbc138a59109d9f1159fa127
2020-03-23 10:09:35 -07:00
Jacob Trimble 011749e95f Standardize argument comments.
This changes the eslint rule to enforce a strict pattern for the
argument comments.  The comment must appear before the argument and
must be /* foo= */.  This still ignores line comments.

Change-Id: I3afb01c65e1088eda13facb3aeeaa7595a2f5aee
2020-01-06 19:40:52 +00:00
Joey Parrish c13830e535 Augment SegmentReference with offset and window
SegmentReference used to have presentationTimeOffset, which,
subtracted from the period start time, was then _added_ to the
timestamps in the segment by MediaSource.

Now, SegmentReference has a timestampOffset field, which is exactly
what MediaSource's timestampOffset field is set to on the SourceBuffer
before this segment is appended.  For DASH, this is periodStart minus
presentationTimeOffset.

This also adds append window start & end times to the
SegmentReference.  Now segments can be appended to SourceBuffers
without reference to the period.

Note that start & end times of the SegmentReference in each segment
index are still relative to the period.  This will change in a
follow-up.

Issue #1339 (flatten periods)
Issue #892 (refactor StreamingEngine)

Change-Id: I9d54eb2b529ec643c9475b8e9d218c3e2e826a26
2019-12-19 11:35:14 -08:00
Joey Parrish 64896d70b0 Use shorter license header
This reflects changes in Google's policy on JavaScript license
headers, which should be smaller to avoid increasing the size of the
binary unnecessarily.

This also updates the company name from "Google, Inc" to "Google LLC".

Change-Id: I3f8b9ed3700b6351f43173d50c94d35c333e82b4
2019-11-22 18:18:36 +00:00
Jacob Trimble f130dffcef Enable eslint indentation rule.
This is a fully automated change.  The linter will fail because the
extra indentation caused line-length errors.  These won't be fixed
automatically.  They are fixed in a follow-up to make this one fully
automated.

Change-Id: I4d8cf9c998985add2bcd24a81c8d65495668c4f3
2019-05-13 22:31:09 +00:00
Jacob Trimble 47daf49f31 Use arrow functions for callbacks.
This is an automated change to convert use of "function" functions
to arrow functions.  This doesn't change all uses of bind() that
could be converted.  This also doesn't remove all "function" functions.

Change-Id: I40ac7d086bcef947a1be083359c8fd1d4499a9c3
2019-05-09 16:40:46 +00:00
Jacob Trimble c81389741f Prefer const over let.
A coming update to the Google eslint config will require using "const"
over "let".  This makes that one change to isolate the big changes.

Change-Id: I7d0974c3ae15c53cc45a6b07bf9f6586e2d34aca
2019-05-08 09:22:10 -07:00
Joey Parrish fd0449d8f7 Re-enable some disabled style rules
This re-enables the following style rules:
  - "block-spacing"
  - "brace-style"
  - "comma-dangle"
  - "comma-spacing"
  - "new-cap"
  - "no-multi-spaces"
  - "no-multiple-empty-lines"
  - "one-var"
  - "padded-blocks"
  - "prefer-rest-params"

Change-Id: I15d616e8d5b88b273ded6128b4f9ad86bdb26bd1
2018-07-09 19:44:56 +00:00
Theodore Abshire 1d2cdc84db Added async/await to some of Dash tests.
Also fixed some formatting in media tests.

Issue #1337
Change-Id: Ifc003e3cb8f4b7a9920a0d2a121089eea4cf1bcd
2018-06-12 08:56:50 -07:00
Jacob Trimble 29f39077dc Convert 'var' to 'let'/'const' (2 of 9).
This is part of a change to convert all usages of 'var' with either
'let' or 'const'.  This takes a conservative approach for 'const' where
it will only be used for aliases and storing the "original" values in
tests.

Change-Id: Iebba756b5d0e68c41292ecabda89503682d8d434
2018-02-14 00:38:06 +00:00
Sandra Lokshina 051531b80f Add support for HLS playlists with type EVENT.
HLS Live comes in two flavors: LIVE and EVENT.
EVENTs append segments to the end of the playlist, but do not
ever remove segments. LIVE can both append segments to the end
and remove segments from the beginning of the playlist.
This CL lays the ground for supporting both types and introduces
support for EVENTs.

Issue #740.

Change-Id: I2042660daf9d1e7209cb1b40f50ab8b24571faa4
2017-08-22 19:02:04 +00:00
Jacob Trimble adb8da4764 Disallow unknown properties (1/5).
This is part of adding a new conformance rule to add additional type
safety.  This will disallow using properties of unknown types or using
unknown properties.

The first parts will be fixing errors caused by the new rule.  These
are backwards compatible, so can be applied before the rule is enabled.
Once all the errors and bugs are fixed, the rule will be enabled.

Change-Id: Iefde089b2f62ddfdf43944cda5badab438577561
2017-06-27 19:43:00 +00:00
Jacob Trimble e5ce395f37 Implement gap jumping.
The bulk of the logic for gap jumping is handled in Playhead.  It
tracks the current buffered ranges and jumps over any gaps that appear.
It listens for a special browser event ('waiting') for when the video
element runs out of playable frames.

This change also removes the logic for jumping gaps at the beginning
of the timeline.  This is handled by the more general gap jumping
logic and works cross-browser.

Finally, this updates the buffering logic to only count the amount of
content buffered (i.e. ignoring the gaps).  This fixes some bugs where
gaps in the content can result in StreamingEngine buffering forever
since it thinks only a little is buffered.

This includes full implementation of the logic, but this doesn't close
the issue since there aren't any integration tests yet.  Those will
be added next.

Issue #555

Change-Id: Id99eb9fe469e8cf2c7464a3d70c3733791e806e0
2017-04-17 18:15:23 +00:00
Jacob Trimble 575f2ad109 Add an indicator for critical errors.
This adds a severity field to Error objects.  This can be used to
detect whether an error is recoverable.  All the same errors are still
reported so the field can be ignored.

There are two possible values:
* RECOVERABLE means that the Player will try to recover from the error
* CRITICAL means the Player will be unable to continue and must call
  load() again

Closes #564

Change-Id: Ie2c5468340c13e7a288b99690ab65b7ecc0a6b29
2017-04-04 23:57:59 +00:00
Jacob Trimble 68e870dc9a Add support for EventStream elements in DASH.
This also makes the Playhead ignore duplicate regions.  This simplifies
manifest updates in DashParser by having it add every Event tag it
sees.  The DASH spec doesn't specify how we should detect duplicate
entries or how events are fired.  So to avoid firing all the same
'timelineregionadded' events on every manifest update and getting
multiple enter/exit events, we will simply remove duplicates.

Closes #462

Change-Id: If5d2c42bd6958567b2ec05ba1e9af252c95cf354
2017-01-26 21:56:07 +00:00
Jacob Trimble 2ca962a33c Refactor ManifestParser.start to accept an object.
Rather than accepting multiple callback methods as separate arguments,
now start() will accept an object.  This will allow us to add new
callbacks without breaking backwards compatibility or adding
additional arguments.

Change-Id: I839cbb12e71c2e7270aa218802c79440c458e964
2017-01-19 22:54:09 +00:00
Joey Parrish c6451690e6 DASH trick mode support
Parses DASH trick mode tracks and puts the extra trick mode Stream
into the manifest.  StreamingEngine can now use this info to optimize
streaming during trick play mode.

Includes:
 - a new demo asset with a trick mode track
 - updates to tests (we now require at least one audio or video stream
   and we require bandwidth attributes on them)
 - updates to the parser's trickmode test
 - a new StreamingEngine test

Closes #538

Change-Id: Id38264ca64bc7905a5c33a269269741cfd12dd4d
2017-01-05 04:45:10 +00:00
Joey Parrish aa00166277 Remove dots from test suite names
These are confusing the build bot's parser for the junit reports
karma generates.

Change-Id: If38355bcd6b9adfb1e1c995d79eb47a80cab8a48
2016-11-29 11:15:56 -08:00
Joey Parrish c7e73e0115 In-progress recording (IPR) support, phase 1
This change creates a new model which divides DASH streams into VOD,
IPR, and live.  It is possible to create manifests which do not fit
into any of the three categories according to our model, so we now
assert that our input fits cleanly into one of the three.

Inline manifests used in our tests had to be updated to conform to
the new model.  All external test assets have been verified to fit
into these categories.

This is phase 1 of IPR support.  There should be no behavior change
in this CL.

In phase 2, we will make various other parts of the library aware of
IPR so that IPR-specific behaviors can be achieved.

Issue #477

Change-Id: I395d3a0c8c9825a3cd2efde263b8493ce0920ed9
2016-08-29 11:09:45 -07:00
Leandro Moreira a8c44da4b1 restructures test files 2016-07-01 09:53:30 -03:00