After a previous bugfix to the preload system, we ended up with a
situation where the
overall progress in the preload was tracked by two promises:
`successPromise_`, which is resolved when the preload finishes
successfully.
`destroyPromise_`, which is rejected with an error when the preload
process trips an error condition.
These two promises were confusingly named; it sounds like destroyPromise
is related to the destroy process,
but really it has more to do with errors.
They were also completely redundant, as a single promise can be used to
carry both a resolved and
rejected state.
This PR simply combines the two promises into one.
---------
Co-authored-by: Joey Parrish <joeyparrish@google.com>
- Fix bogus assertion failure in tests on Safari (#6272)
- This test should not be seeking so close to the duration (10ms) as to
cause flakiness on certain browsers. Adjusting the seek time fixes the
assertion without compromising the purpose of the test.
- Fix uncaught rejections in load graph tests (#6274)
- These tests had calls that were interrupted by the teardown process
that occurs after the test body. Waiting for the operations before
ending the test fixes the issue.
- Fix interrupted load in test on Tizen (#6274)
- This test triggers a deliberate DRM error without waiting for load().
On most platforms in the lab, the load() operation completed before the
error. Not so on Tizen. This exposed a general problem in which we
should be catching errors in this test. Only timing saved us on most
platforms.
Closes#6272Closes#6274
Interrupting load() was causing two concurrent sets of load() operations
to happen at once, which led the asset URI for the second operation to
be overwritten by the first.
This was exposed by a test failure on Safari. There is nothing special
about Safari, but the timing happened to work out such that the
concurrent load() calls would intefere with each other.
This fixes the issue by acquiring the mutex in load() for the
preloadManager.start() operation.
This issue did not affect any releases.
Closes#6225
Adds a new player method, preload. This asynchronous method creates a PreloadManager object, which
will preload data for the given manifest, and which can be passed to the load method (in place of an asset URI)
in order to apply that preloaded data. This will allow for lower load latency; if you can predict what asset will
be loaded ahead of time (say, by preloading things the user is hovering their mouse over in a menu),
you can load the manifest before the user presses the load button.
Note that PreloadManagers are only meant to be used by the player instance that created them.
Closes#880
Co-authored-by: Álvaro Velad Galván <ladvan91@hotmail.com>
The state engine mechanism, designed for the player class, was
over-engineered. The structure of the class makes debugging player
errors unnecessarily annoying, by obfuscating the code-path the error
followed, and in general
has created a significant amount of technical debt.
This changes the player to use an async-await setup for the top-level
operations, laying things out much more cleanly
and linearly.
---------
Co-authored-by: Álvaro Velad Galván <ladvan91@hotmail.com>
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
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
This method should probably never have been in the library, since it
creates a fixed-sized, muted element.
Change-Id: I53b474305465bef34d43ce40ec5e7dedceb20a25
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
This moves some of the tests around to have each file use only one
top-level describe() block. This removes some Player integration tests
that are already tested elsewhere.
There are two cases where there are two top-level describe() blocks
left: the segment reference and http plugin tests.
Change-Id: Iab7365919cfba739d4710184f079b6d2638192b6