Adding "mechanism" and "cell" fields to offline uri. But since
they are not used anywhere, this change sets them to dummy values
so that all the constructors could be updated.
Moved the manifest reconstruction code into a instance class as
the mechanism and cell for the asset is needed in order to create
all the segment uris.
Change-Id: I2b5738805b17c4aa33d39b3166fddf1528aed489
This breaks Player.load into a number of async sub-methods, which are
called using await.
This should improve readability, and make load somewhat less
intimidating.
This also removes cancelable chain, which after the refactor is no
longer used anywhere in the codebase.
Closes#1336
Change-Id: I85ad22b9c8c6b7f72b27471ddd762763e6591a71
Storage Muxer is responsible for finding the correct cell for a
given operations. For example, when writing new content, you need
a cell that supports add-operations, the muxer will find one.
Issue: #1248
Change-Id: Ifd9fd32f9487c0b9bc011ae8b004eec4ee75f7c4
This adds attach/detach methods to replace the media element in the
Player constructor. Now applications can take back control of the
media element or provide a reference later in the Player's life cycle.
This also allows applications to decide whether or not to set up
MediaSource in advance, through an optional argument on attach and
unload. The default will be to set up MediaSource in advance, which
maintains current behavior. This advanced setup of MediaSource can
improve load latency later.
This change also introduces async/await for the first time in the
project, which required changes to eslint config, Closure build
arguments, Babel & Babel-polyfill setup, and the esprima parser used
by our extern generator.
The use of async/await will improve readability in many places, and
these infrastructure changes to enable async/await should also unblock
issues #1336 and #1337.
Closes#1087
Change-Id: I0d6b4e0e2af27a6520a3d070fa92b7139b2cb8b0
Since the database schemes for idb versions 2 and 3 used the same
data types (shaka offline version 2) this storage cell can be used
for both. The only difference is that idb version 2 has a fixed
key space.
Issue: #1248
Change-Id: Iac5cb1d57f93fdb81729b59d67d6736e29c9968c
Now each EME polyfill can be removed independently; this allows
someone to remove just the IE11 polyfill while still keeping the
others.
This adds a priority ordering to the polyfills so the nop polyfill
will be run last as a fallback if there are no other polyfills.
Issue #1261
Change-Id: I865e1c0d6a73a079dd91505e96572e215e6f6c6a
Created base classes that will be used when working with indexeddb.
These classes are used to manage connections and transaction is a
more promise-friendly way.
Issue: #1248
Change-Id: Iafd001072bee8572f41af7069532f3a1ccd39fbc
Created a memory storage system that holds all data in main memory. This
system will be used in tests.
Needed to update the eslint rules to allow us to have an instance-level
method that does not use |this|.
Issue: #1248
Change-Id: If1ebbec62bfdae57ee06df9fdef9955b30579d52
- Translate uncaught Promise rejections into test failures
(Chrome only until the event is more widely implemented)
- Clean up uncaught Promise rejection caused by exceptions thrown
after destroy() in:
- CastProxy
- CastReceiver
- NetworkingEngine
- StreamingEngine
- Clean up uncaught Promise rejection caused by test cases in:
- CancelableChain unit tests
- DrmEngine unit tests
- StreamingEngine unit and integration tests
- Player unit and integration tests
- Speed up rejection in NetworkingEngine when we should not retry
- Add --delay-tests to test.py, to aid in debugging uncaught
Promise rejections and other types of async test pollution
Closes#1323
Change-Id: I5a8f5702a22430929babeb071bf6650c52c5ad17
This adds a new script which should simplify the process of installing
prereqs on Debian and Ubuntu-based Linux distributions. This also
updates the required versions of NodeJS and Git.
Closes#1175
Change-Id: If298cc46650bfd0ebe726c8fa3184dd0d063bfaf
Now both all.py and check.py will forward --fix to eslint so it can
automatically fix style violations.
Change-Id: Ic6048e58cfb35c7c5719a45200f23940b7590735
This splits some of the independent code from Playhead into several
new helper classes. This allows Playhead to be simpler and easier to
understand.
This keeps the new behaviors and classes as private pieces of Playhead
to keep Playhead conceptually in-charge of handing the Playhead. It
still has the same responsibilities, but the code is split into other
files.
Issue #1224
Change-Id: Ia828f902ba9490d128f4ca9cb1e34119ec93f188
This plugin is preferred over the XHR plugin, if available.
This plugin requires AbortController, which is only present on
Firefox 57 and Edge 16, so this will not be active on every platform.
This also adds a simple mock for the Fetch API for use with Jasmine.
Closes#829
Change-Id: Ifb79d29334fbfcfd175afe0706da5a3d5e452e2f
This updates jsdoc to the latest version from npm and forks a copy of
the default jsdoc template.
In subsequent commits, we will reapply our customizations to the
template and to a jsdoc plugin.
This also fixes several bad annotations that the new jsdoc failed to
parse.
Issue #1259
Change-Id: I00a47270ea4754e1c96c43ca900d5cf889ab72e6
A bug in our Promise polyfill caused issues with the recently-added
AbortableOperation class on IE11. Since external polyfills for this
are smaller, it is easier to remove ours in favor of a third-party
polyfill. Applications that wish to support IE11 must now load this
additional polyfill.
We are using the "es6-promise-polyfill" module from npm, but any
compliant polyfill should suffice.
One feature our own polyfill offered was the ability to flush all
Promises, which allowed us to write synchronous unit tests that
simulated async processes. To get this ability back, we are now
using the "promise-mock" module in our tests.
Getting "promise-mock" to load correctly involved switching from
"requirejs" to "cajon", which builds on requirejs and supports
AMD modules more directly.
Closes#1260
Change-Id: I5de48e88a910736ae5c1897a7a509bc5641acb70
This adds a general interface for abortable operations, and a specific
implementation of that interface for use internally. This should
simplify the transition to abortable network requests and others.
Issue #829
Change-Id: Icf54e23028f7454640f5ec76ca97d8a8ed5915ed
This removed all of DBUpgrade (lib and test) as it was not accomplishing
its requirements.
Now instead, if DBEngine detects that there needs to be an upgrade, it will
abort the upgrade and message the app with |UNSUPPORTED_UPGRADE_REQUEST|.
Change-Id: If65bc013b0482c9b0c6e71e644e9132584984414
In the test launcher, it is useful to resolve the list of default
browsers after parsing command-line arguments. This allows derived
tools to use command-line arguments to influence the set of default
browsers.
Bug: 72452551
Change-Id: I309e48fc3f0335ee6107510fe35ed2d46367e65d
This avoids line-length limits on Windows in the node module's
pass-through shell script.
The long list of files, combined with a node module's bin file,
tripped the Windows command-line length limit of 8k. The transition
to eslint, therefore, broke the Windows build.
Issue #1157Closes#1228
Change-Id: Ie57624efbbbfb4a27035e82ab12e788d18652ae3
This digests and organizes many of the automatic settings in eslint,
and changes several of them to be more strict. This also fixes the
following errors:
- array-callback-return
- no-catch-shadow
- no-multi-spaces
- no-new
- no-throw-literal
- no-useless-call
- no-useless-concat
- no-useless-return
Several checks have been organized into a group of checks we should
use, but need more time to implement and fix. Some other checks have
been delegated to the Closure compiler, which can more precisely
whitelist exceptions.
Issue #1157
Change-Id: I8fe4966959e08050f8159e6a1fee161e7d71177e
The eslint configuration is derived from analyzing the style of our
sources as they are now, plus a few tweaks.
In particular, we have disabled checks for undefined variables and use
of console, both of which the compiler handle with greater precision.
The compiler already knows what is defined in the environment through
our externs, and has specific exceptions for the use of console (demo,
tests).
We have also disabled a few checks that we should use, but will
require many changes to the code: no-unused-vars, no-redeclare,
and comma-dangle.
This commit also fixes several types of eslint errors that were easy:
- no-useless-escape (unneccessary escape characters in Regexp)
- no-constant-condition (using true/false/0/1/etc in if/while)
- no-fallthrough (caught an actual bug in one EME polyfill)
- no-irregular-whitespace (we had a UTF-8 nbsp in externs)
- no-cond-assign (using an assignment inside a conditional)
To satisfy stricter provide/require checks in the Closure Compiler
Linter, we will no longer use provide/require at all in tests. We
will still use provide in test utilities (test/test/util/) since it
sets up the namespace for us. But we will not use require there
because there is no deps management for test code.
Issue #1157
Change-Id: Icc44f51feeb568ea7d3980e693e92e560d897afd
Note that until we replace gjslint, the linter will still not accept
ES6 syntax. So we cannot yet merge any commits which use ES6.
But this should allow us to start experimenting with ES6 locally by
bypassing the old linter.
Issue #1157
Change-Id: Ic0902f57a34f61b0a7831c3e019425cee6e0308f
Changed build/build.py to use argparse in its main method to help standardized
how all our scripts parse command line arguments.
Change-Id: Ib766d7fe7a8629fd42014cba8312eb1e09917bef
Added a DB Upgrade path for converting content from version 1
to the version 2 format.
Issue #1047
Change-Id: Id8dc626d8289b08ca300c40b137173c0c6ec9d35
Create the pattern for how to handle database upgrades. As of this
change the only upgrade supported is from version 0 (no database).
Issue #1047
Change-Id: I9f889a9e39a190e926cf06f0720a5371bc3c59af
This adds extra conformance checks:
- A ban on @expose, which we already got rid of in 775d7552
- A ban on unresolved types, which did not generate any failures
- A ban on global variables
- A more comprehensive ban on console logging
None of these caught any real bugs in the existing code base.
In one test suite (MediaSourceEngine unit tests), the compiler was
unable to determine the type of one of the mocks, leading it to
suspect that it could possibly violate the new ban on console.error.
The goog.define('GIT_VERSION', ...) line in player.js was seen
(correctly) as a global variable. This has been fixed and simplified
as a result.
The only custom conformance checks we are not using are "BanNullDeref"
(too many false negatives) and "BanThrowOfNonErrorTypes" (for which
we have our own, more restrictive version).
Since we have now tried all custom conformance rules provided by the
compiler today, this closes the associated issue.
Closes#1130.
Change-Id: Iad9040d0f5ee397c7d46b1d64bc5bebf2def57bc
To help standardize how we parse arguments across all our build scripts,
this changes build/all.py to use the argparse library (the same as
build/test.py).
Change-Id: Id492675e289f35e42d9445ade3008a4159067e38
This change enables an additional conformance check in the compiler
which prevents us from committing code where the compiler fails to
infer what "this" means.
None of these changes constituted actual bugs, just inference failures
in the compiler.
Issue #1130
Change-Id: If9b18203768e197258042a9b4339530f371ed831
Moved all the logic that is used to construct and parse uris for
manifests and segments into the offline scheme file.
Change-Id: Ie4dbd12256667296e3c67ed0ecf47f1752dd86eb
Rather than using the -debug suffix for uncompiled builds, use
-uncompiled. This also changes the version for debug compiled builds
to use the -debug suffix.
Change-Id: I3c0c1c3b849d5f817c4d7f7bcfd7f967a00d1aaf
This also modifies the build scripts to produce debug builds of the
demo and the receiver when doing debug builds.
Change-Id: I386a7b8f541332594a5022955a69970ebbe79200
This adds a service worker, which will cache application resources to
make the application itself available offline in browsers which
support service workers.
Issue #876
Change-Id: I13096b2d4b9236d2a3f220af6b1dfce43d7a0004
When using the compiled version of the library, use a compiled version
of the demo app, as well. This makes use of the generated externs, so
we now have additional confidence that they are correctly generated.
Refactor the load.js script to use a configurable list of sources.
This enables us to use the same load.js in both the demo and cast
receiver.
This, ultimately, makes it easier to cache demo resources in our PWA.
Issue #876
Change-Id: I274660fe2ea23236ceea3c2d3c97572762d2f785
Added externs for error.js and removed the @expose declarations from the
actual error.js file. Updated the jscompiler flags and docs.
Change-Id: I2aa95ef1c82fc7bd349c637cca3141d5a003b646
This helps catch a certain class of error before we do a release.
Otherwise, we only find out that the generated externs are broken
when someone tries to build an app against them.
Change-Id: I6aa000ee9129c40fffcaa9c8e2cc73d3eb17a144
Generated externs should include member assignments from constructors.
Without them, the generated externs may not appear to implement the
full interface. The alternative is to re-declare these members on the
prototype, but that is more difficult to maintain. Instead, the
extern generator can convert them for us.
Example code:
/** @interface @exportInterface */
FooLike = function() {};
/** @exportInterface @type {number} */
FooLike.prototype.bar;
/** @constructor @export @implements {FooLike} */
Foo = function() {
/** @override @exportInterface */
this.bar = 10;
};
Example externs:
/** @interface */
FooLike = function() {};
/** @type {number} */
FooLike.prototype.bar;
/**
* @constructor @implements {FooLike}
*/
Foo = function() {}
/**
* @override
*/
Foo.prototype.bar;
Change-Id: I435ba1800d5eefbf68c27851d6454c1a572cc6f6
ArrayBuffer.slice isn't supported with two arguments on Tizen 2016.
This is a temporary fix that can be cherry-picked to v2.2. A better
fix will be handled in a follow-up change.
Issue #1022
Change-Id: Iae6a0b2ef0cf17843f42f22f0ea0962a56e8be68