Commit Graph

100 Commits

Author SHA1 Message Date
Álvaro Velad Galván 4082ed75ee feat(DASH): Add support for SegmentTimeline@Pattern (#9669)
Close https://github.com/shaka-project/shaka-player/issues/9659
2026-02-06 07:31:49 +01:00
Matthias Van Parijs 0bc7a96b33 fix(DASH): Shift segment timeline with cached presentationTimeOffset (#9481)
Fixes https://github.com/shaka-project/shaka-player/issues/9480.

A change in PTO when updating periods & segment timelines should be
avoided by whatever produces the manifest. This is merely a mitigation.
When detected, it'll log an error to warn the user about the timeline
shift.
2025-12-09 12:30:40 +01: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 51ff82f204 build: Migrate to stylistic eslint plugin (#8298)
Fixes #8278
Migrates deprecated rules from `eslint-config-google` and our rules as
well to stylistic.
Additionally removes broken `eslint-disable` python check and replaces
with eslint `reportUnusedDisableDirectives` option.
2025-03-19 16:18:30 +01:00
Wojciech Tyczyński 97832b7c45 chore: Stop using "Object" in DASH (#7947)
Related to #1672
2025-01-24 16:38:03 +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
Joey Parrish abd6d8b34c fix(dash): Fix $Time$ usage with SegmentTemplate (#7849)
`$Time$` in SegmentTemplate should not be adjusted for
presentationTimeOffset or Period start. It should always match the
segment's own media timestamp as it appears in the manifest.
2025-01-08 11:23:40 -08: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 7ceffc0db7 perf: Only use tXml parent when necessary (#7304)
Issue https://github.com/shaka-project/shaka-player/issues/6239
2024-09-13 13:49:39 +02:00
Álvaro Velad Galván 3e45e66af2 fix(DASH): Allow play when SegmentTimeline has a duration 0 "S" element (#6896)
Fixes https://github.com/shaka-project/shaka-player/issues/6889
2024-06-25 09:21:00 +02: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
theodab bbefeada6a chore(DASH): Remove support for float durations. (#6513)
We previously supported float duration attributes in DASH
SegmentTemplate, due to an ambiguity in the DASH samples.

The code linked to a DASH IOP issue asking if duration could be a float
or it had to be an int.

That issue has since been closed, with the clarification that duration
attributes must be an unsigned int and the sample was in violation of
the spec.
2024-04-30 10:12:03 +02:00
Dave Nicholas 7116a34ec2 feat!: Remove DOM Parser (#6063)
## Background: 
The native DOM Parser can perform poorly on some older devices, this
approach is faster on newer devices but is considerably better on older
devices.
This PR replaces the usage of the DOM Parser for DASH, MSS, VTT and
TTML.

The draw back of this approach that it does not include any validation
at the cost of better performance.
2024-01-22 08:39:06 +01:00
Dave Nicholas d8aa24f41d fix(DASH): Segments being fetched out of the range of the timeline (#5889)
Fixes: https://github.com/shaka-project/shaka-player/issues/3952
2023-11-16 09:48:12 +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
Ivan bcc2c24eb8 chore(DASH): move repetitive code to method, avoid full iteration if possible (#5786)
This change creates a separate method to get context nodes, and breaks from loops early if it finds the desired result

Co-authored-by: Ivan Kohut <ivan.kohut@lamin.ar>
2023-10-20 23:04:49 -07:00
Álvaro Velad Galván 4a1c96e630 feat(DASH): Allow the playback of DASH with $time$ and large timescale value (#5621)
Closes https://github.com/shaka-project/shaka-player/issues/4337

Only supported on browsers with support to BigInt
2023-09-12 20:57:33 +02:00
Joey Parrish d4dca2a571 chore: Fix core build without dash (#5289)
- Move TimeRange from shaka.dash.MpdUtils to
shaka.media.PresentationTimeline
- Move AccessibilityPurpose from shaka.dash.DashParser to
shaka.media.ManifestParser

With these changes, core Shaka Player can be built without the dash
module.
2023-06-13 12:23:55 +02:00
Nick Crast f1c5a1c191 feat(dash): Improve DASH SegmentTemplate performance with on-demand segment references (#5061)
This is a performance optimization intended to reduce the Video Start
Time for DASH streams, both VOD and Live, by reducing the amount of
processing done during manifest parse time. This is especially effective
for long multi-period assets, assets with many variants, or on low end
devices in general. I've provided some measurements showing the
performance improvements at the conclusion of this PR.

Currently, during manifest parse time for a Segment Template, Shaka will
loop through the entire timeline and create segment references for each
timeline entry. For a long asset, or an asset with many tracks, this is
a significant amount of processing.

I've created a new entity called the Timeline Segment Index that extends
the SegmentIndex interface. The purpose of the Timeline Segment Index is
to ingest a timeline during construction, and then use that information
to build Segment References only on demand. This removes the need to
parse the entire timeline and create all of the Segment References
during parse time.

The effects of this change aren't quite as apparent on desktop web
browsers, given their speed and power. This improvement really shines on
lower end TVs on assets with a long timeline.

DASH parsing speed-ups in some cases can be as much as 40%.

Co-authored-by: Joey Parrish <joeyparrish@users.noreply.github.com>
2023-04-28 17:20:33 -07:00
Álvaro Velad Galván 298b60481d fix(dash): Fix performance regression (#4064)
See: https://github.com/shaka-project/shaka-player/issues/4062#issuecomment-1077826210
2022-03-25 13:56:38 -07:00
Álvaro Velad Galván b9b3cc8098 feat(dash): Add support for thumbnail tracks (#3145) 2021-03-02 13:36:09 -08:00
Jacob Trimble dc8b007d56 cleanup: Add missing requires.
This is a port of the internal changes: cr/321495405, cr/321592702,
and cr/321594488.

Change-Id: If6a4c4266ed10a70b01442974dbd19329bb5122e
2020-07-16 10:59:49 -07:00
Joey Parrish f539147d48 fix: Correct license headers in compiled output
This fixes all the license headers in the main library, which corrects
the appearance of the main license in the compiled output.

It seems that the `!` in the header forces the compiler to keep it in
the output.  I believe older compiler releases did this purely based
on `@license`.

Issue #2638

Change-Id: I7f0e918caad10c9af689c9d07672b7fe9be7b2f3
2020-06-09 16:05:09 -07:00
Jacob Trimble 654b6cbee3 Fix SegmentTimeline with t attribute missing.
Fixes #2590

Change-Id: I2ac4adb1898b4affea9ee337f1d59fc3dca69ced
2020-05-27 16:48:54 +00:00
Joey Parrish 50bf467055 Assert that number|string union is number
The new Closure Compiler complains that a number|string union from a
map in MpdUtils is used in a calculation.  In practice, we know that
this specific value is always a number, so we add an assertion to
satisfy the newer compiler's type checks.

Issue #2528

Change-Id: Id12de47d2dd4a12f9cc35879bee8da5ee25cdd70
2020-04-29 22:40:26 +00: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 fd0dc8a5cc Add utility for looping from 0 to n.
Closes #1518

Change-Id: I865f7a0311516d04ae84532dab873e1aaa31eb24
2019-07-10 21:23:22 +00:00
Jacob Trimble 5c35108cb8 Avoid integer for loops.
Issue #1518

Change-Id: I3ba3cb6a439264e823022b2a64e7cdbd265494c7
2019-07-09 17:11:49 +00:00
Jacob Trimble 47533d1173 Add an enumerable() method for loops.
This is a helper to aid in iterating over items.  This returns a list
of objects that contain:
- "item": The current value.
- "prev": The previous value in the list.
- "next": The next value in the list.
- "i": The zero-based index in the list.

Issue #1518

Change-Id: Id18ab977e3ae45dfbfd2b4137a1bffb6e53c6bce
2019-06-27 16:31:42 +00:00
Jacob Trimble a6d06cc104 Convert dash files to ES6
Issue #1157

Change-Id: I9c269bb82e791efbb5df483a4ff1701b7739a96f
2019-05-21 22:27:26 +00:00
Jacob Trimble d5780d401b Fix line length issues for indent fix.
Change-Id: I87d75fd88000f8f9bff7b9f1bf5667ba28f6dd60
2019-05-13 22:31:20 +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
Jacob Trimble a453095412 Misc fixes for const.
This prepares some changes for the conversion from "let" to "const".
This ensures the follow-up is just an automated change with minimal
intervention.

Change-Id: I19b24dc67f20038dffd36b8903547f6ee4f00c25
2019-05-08 16:17:58 +00:00
Tyler Daines 3c8241f3c7 Add license url parsing (#1644)
This adds parsing license URLs to the DASH parser so the URL can be embedded in the manifest.

Fixes #484
2018-12-13 10:58:27 -08:00
Jacob Trimble 140105b0a2 Optimize processXlinks.
- Only traverse children once.
- Avoid traversing into SegmentTimeline, which is usually large and
  won't contain xlinks.

Issue #1640

Change-Id: I8a7a05d580740f9a9953b0a8aec89a06cc7e33f2
2018-10-24 11:38:36 -07:00
Joey Parrish 96237671d7 Avoid assertions about $Time$ when it is not used
In some environments, goog.asserts.assert can cause an exception to be
thrown.  Therefore, we must avoid spurious assertion failures.

In this case, the assertion about $Time$ could fire even if $Time$ was
not being used in the URI template.

Change-Id: Idba351989cd439f5202373d1ecb71804b372705e
2018-08-13 09:59:28 -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
Joey Parrish 321896db3f Fix private annotations and names
These errors were discovered by a more up-to-date compiler.

Change-Id: Ic678e259406ac6fa43c4cb355ad72118cd563f57
2018-05-23 14:29:12 -07:00
Jacob Trimble 866b0e18ef Fix non-default namespace names in DASH.
XML allows namespace names to be any string.  So instead of looking
for the literal name 'cenc:pssh', we should be looking for the 'pssh'
name in the correct namespace.

Closes #1438

Change-Id: I724db3b7f0e60b4233b0fc40b1ed57698c6ce9ce
2018-05-21 20:02:18 +00:00
Michelle Zhuo 535de4db84 Refactor: Remove underscore from parameter names
Change-Id: Ie9e6fb59763f454f245175f23c6444f919ba8135
2018-05-08 19:21:51 +00:00
Sandra Lokshina 8065bd54a8 Change namespace from shakaExterns to shaka.externs
Change-Id: I16432351e2a266aa8fd175669aa27c44bfdffeae
2018-04-11 17:26:26 +00:00
Joey Parrish 772dc231c9 Remove non-nullable on implicit non-nullable types
This is a style cleanup to pass stricter checks from future versions
of the Closure linter.

Change-Id: Icca8f974af7c9f4834acf6bba69e4cef1f89e502
2018-04-09 14:52:59 -07:00
Jacob Trimble 938da032b5 Allow non-decimal formats in SegmentTemplate.
Fixes: 75988239
Change-Id: I023a1bd003662c6d651eb870b4aba025dc687327
2018-03-21 22:41:26 +00:00
Theodore Abshire 5ae80cc67d Typo fixes and rewording in comments, part 4
This makes a large number of small typo fixes. It also rewords a
number of comments and JSDoc descriptions, and does some
formatting standardization.

This doesn't fix every single issue, but it fixes a lot. Notably,
there were some formatting issues I declined to standardize due to
ambivalence on what the proper standardization would be; for example,
when and where empty lines should show up in JSDoc.

Change-Id: I5904ec91b96417a9ac5e19cb4f7b07a084f26ac8
2018-03-21 17:25:03 +00:00
Theodore Abshire dc17969822 Typo fixes and rewording in comments, part 1
This makes a large number of small typo fixes. It also rewords a
number of comments and JSDoc descriptions, and does some
formatting standardization.

This doesn't fix every single issue, but it fixes a lot. Notably,
there were some formatting issues I declined to standardize due to
ambivalence on what the proper standardization would be; for example,
when and where empty lines should show up in JSDoc.

Change-Id: I048b430e4c0bea2ccb9aec572d5e9ec6b606a87a
2018-03-14 17:59:26 +00:00
Jacob Trimble 624acc66b8 Add curly braces to all blocks.
Google style guide requires adding curly braces to all block statements
even if it is only has one line.  This fixes it by using eslint's
--fix flag followed by running clang-format to reformat the change.

Change-Id: Idc086c2aa8c02df5ef8b2140a11bfb9128eeb4bd
2018-02-21 11:23:34 -08: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