Commit Graph

8 Commits

Author SHA1 Message Date
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 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 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 685e9d57cf Eliminate free calls of static methods
It is type-safe to alias a class, but not one of its static methods.
Aliasing the method without the class makes it a "free call" to invoke
the aliased method.

A "free call" is when you call a method without the context of its
instance of class.  There were several cases of this with static
methods.

This will be enforced by a future release of the compiler, which I
believe will lead into compiler support for "this" in static ES6
methods.  In ES6, you can use "this" in static methods to refer to the
class and call other static methods.  Closure compiler doesn't support
static "this" yet, but we will start using it as soon as it is
supported.

Change-Id: I4249db8b6dda9231ebba60ee0d4ad734a692c2fe
2019-05-03 18:43:35 +00:00
Michelle Zhuo 1b150eef04 Don't clear buffer with a small gap between playhead and buffer start
When the video is looping and there's a small gap between the playhead
and buffer start, we should jump the gap instead of clear the buffer and
download it again later.

Change-Id: Ieead1462ac8c1cfcc957c391a61890396b870d40
Closes: #1459.
2018-07-23 21:47:50 +00:00
Jacob Trimble b2bde18a3d Convert 'var' to 'let'/'const' (5 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: If4792c1bd3d5a82c24a4b2f0f84790d4eed22e67
2018-02-20 11:26:46 -08: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