Commit Graph

16 Commits

Author SHA1 Message Date
Joey Parrish 562a2d567b chore: Strictly require jsdoc
This enables the eslint rule requiring jsdocs on all class
declarations, function declarations, and methods.

Unfortunately, there are two problems with this:

1. We don't use class _declarations_, we use class _expressions_,
which are not covered by this rule.  So it does not enforce jsdoc at
the class level.
2. We tend to document a class at the class-level, rather than at the
constructor.  But a constructor counts as a method for eslint, so it
requires docs on the constructor.  There is no way to configure it to
make an exception for trivial constructors.

So for all trivial (no-argument) constructors, we add empty jsdocs:
  /** */
  constructor() {

This was quicker and easier than setting up some alternative plugin in
eslint to make an exception for us.

The good news is that this rule caught several undocumented parameters
and places where the jsdoc comment was malformed.  So fixing those
also improves the compiler's ability to enforce types.

Change-Id: Icbc46ed690c94e53d354648a883119524f8fca45
2021-01-09 02:00:31 +00:00
Theodore Abshire 79f8331d5e feat(stats): Added completionPercent to stats.
Change-Id: I441bc7fafb6115aa5a2a41a71b318d36f8446929
2020-08-18 20:03:57 +00: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
Álvaro Velad Galván bafe18fadd Add maxSegmentDuration to stats (#2613)
Resolves #2610
2020-06-03 11:51:59 -07:00
Álvaro Velad Galván 6e7b9c363f Add liveLatency to stats (only MSE) (#2508)
Resolves #1872
2020-04-30 12:25:29 -07:00
Álvaro Velad Galván 02db99f567 Take into account the playbackRate in bandwidth calculations (#2329)
Resolves #812
2020-01-31 10:03:00 -08:00
Theodore Abshire 6a6a47c5ca Added stats for time taken in load stages.
Change-Id: I3b9c8397999468e606b241f160174a2063b23ae0
2020-01-29 18:57:45 +00:00
Álvaro Velad Galván e0045e5731 Add corruptedFrames to stats (#2328) 2020-01-10 15:46:20 -08:00
Álvaro Velad Galván cdbf8c5fbc Add licenseTime to stats (#2297)
This gives the cumulative time spent fetching licenses.
2020-01-06 11:11:28 -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
Aaron Vaage 31b94e8bd4 Set src= Load Mode
Create the src= load branches for the remaining public methods. This
should ensure that it is now safe to call the public methods when
playing src= content and expect to get the intended return values.

The tests to verify this are in a follow-up CL.

Issue #816
Issue #997

Change-Id: I088b6bbd2489b3960457030846debae07fd86d16
2019-04-10 18:44:35 +00:00
Álvaro Velad Galván 732f86b18a Track time in "pause" state in stats (#1855)
Before, we reported the total seconds spent in the "playing" and "buffering" states, but we did not track the total time spent in the "paused" state.

Now that we can derive the "total time spent in" via `StateHistory`, we can easily fetch the total amount of time spent in the "paused" state (which is tracked in our state history).

This adds a new field to `shaka.extern.Stats` for `pauseTime`, defined as "The total time spent in a paused state in seconds'.
2019-03-29 08:47:11 -07:00
Aaron Vaage 5018251aa1 Derive State Times From State History
We track how much time we spend in different states in the state
history, this means that we can derive the total time rather than
needing to track it separately.

Change-Id: I8ba0f8a7a842b54839cef14c5c42bf3c379549b0
2019-03-28 21:41:07 +00:00
Aaron Vaage 78aa5752fb Generalize State History
This change makes state history track any state by moving the idea of
buffering, playing, etc to the player.

This allowed the stats and state history to drop they connection to the
media element.

Change-Id: Ieed198a09b3ade33e4ee850445b809f251cf2558
2019-03-28 21:40:58 +00:00
Aaron Vaage b978ae83b5 Refactor Player to Use Walker
This is the initial integration between the walker and the player. In
order to make this simpler, this keeps all of "load" as one transition
and will slowly break it into multiple parts in later CLs.

Tests that focused on verifying the changes in states were moved from
the unit tests to the integration tests.

As of this CL we model the load graph as:

  Detached -> Attached -> Loaded -> Unloading
      ^         ^                       |
      |         |                       |
      +---------+-----------------------+

With this CL we lose:
  - Interrupting manifest load retries when interrupting a load.
  - Interrupting loading.
  - Pre-initializing media source.

We have immediate plans to add back:
  - Interrupting loading.
  - Pre-initializing media source.

We are still designing how to handle:
  - Interrupting manifest load retries when interrupting a load.

Issue #816
Issue #997
Issue #1570

Change-Id: Ie929621f94c2701f7d4e031b7a31dbd1c74a69c6
2019-02-26 23:42:36 +00:00
Aaron Vaage 0fb5805beb Create Stats Class
This change defines a class to make it easier to track and return our
external stats record.

We have an external stats type used to communicate internal details about
what is happening during playback. The code for creating and updating the
stats was all in Player. With our src= work, only some of this data will
be trackable. To help, this change defines an internal stats class that
handles partial updates and then creates the external stats type when
requested.

This CL moves some complexity out of player, allowing the player to
focus on providing meaning while the Stat's object focuses on tracking
and storing it.

Change-Id: I8c19c98fde26c198566f33f6cbfead2826e39053
2019-01-11 01:23:28 +00:00