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
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
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
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
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'.
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
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
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
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