Though not part of the library, this corrects/normalizes the license
headers in the demo app to be consistent with those in the library.
Issue #2638
Change-Id: I4546c4c6970d72ff71a37489fd582623bd6e2ca3
The Closure Library's base.js, the Closure Compiler, and the Closure
deps-writer are all now loaded via NPM instead of commiting them
directly to the repo. This also updates both the library and compiler
to the latest version: 20200406.
We still have a fork of the Closure Library's URI parser. The latest
upstream version of that has too many dependencies on the rest of the
library to import directly from NPM.
Some internals of the build system have been refactored, and the
"complete" set of files in the build system now includes third_party.
Our forked URI parser does not pass lint checks yet, so the linter
does not run over third_party yet.
A couple of overly-severe sets of compiler checks have been disabled,
since even the latest Closure Library's base.js doesn't pass them.
The script-loader in load.js had to be updated for compatibility with
the new Closure Library. If you don't return "true" now, Closure's
base.js will stop loading subsequent source files.
Some local externs that we had written are now available from the
compiler, so our local copies have been deleted.
A few type-related changes have been made as well, removing casts that
were necessary with the old compiler, but not necessary with the new
one.
Finally, this corrects some type issues in the tests using the new
"typeof" annotation from the compiler. This allows us to type a
variable as a class defined elsewhere. For example, after loading the
compiled library, we can reference compiledShaka.Player, which has the
type "typeof shaka.Player". The compiler can then type-check all uses
of it in the tests.
Closes#2528 (bad polyfill code generated by the old compiler)
Change-Id: I62ec61e82d4edf342b2c576c2d4f89f11562ee65
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
The "scripts" variable's contents are determined by the build type; so
instead of setting them at the same time, we can just use an object
lookup once when the variable is needed.
Change-Id: I84c52b5c770974d5c18b6546ecd9f8d19ce259e0
This reduces the number of resources we have to load by using LESS to
import them into the compiled CSS bundle.
This also gets rid of a flash of unstyled content in compiled mode by
always including the compiled CSS in HTML directly, regardless of
mode. If the app is running in uncompiled mode, LESS is still loaded
and can override the compiled styles.
Change-Id: I8cde25c15c281029a129225fc85a8baee767f424
This is a complete replacement for the old demo page, made to be more
modern-looking and easier to maintain. It contains new features such as
remembering the URIs you provide for custom assets, and searching through
the default assets by feature.
This demo page is not quite ready for release yet, but it's getting close.
Change-Id: Iad01d1fc02c3cd238d73b9b9e02dbb4301cb6f2a
Browsers new enough to have ES6 arrow functions, but too old to have
async/await, should not be allowed to use uncompiled mode in the demo
app.
This also fixes a bug in which the disabled "uncompiled" link was
still clickable.
This came up while poking at Firefox 48. To be clear, this is NOT
a supported browser version anyway, due to apparent MediaSource bugs.
Change-Id: Ic055357e5149236722afae46d0652e51edaf90d0
As we convert Shaka Player to ES6, we will lose the ability to run the
demo app in uncompiled mode on older browsers, such as IE 11.
This detects ES6 syntax support and disables the link to uncompiled
mode in the demo app. It also prevents the loader from choosing
uncompiled mode by default in these older browsers.
Issue #1157
Change-Id: I13e3a80669daaabd38a056f5242ee713f3d014cc
In a previous change, urls with query strings were broken such that
if one contained a /, it caused the demo page to fail to load.
Therefore, legacy custom URLs from before we added URL fragments which
contain asset or license URIs stopped working.
This change accounts for that.
Fixes: 71509895
Change-Id: I9e631a83fc7a551e841419dd4bec2885a2fd0a07
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
The loader script for the demo uses document.write to add script tags.
This is not ideal, and currently generates these warnings in Chrome:
[Violation] Parser was blocked due to document.write(<script>)
[Violation] Avoid using document.write().
This replaces the import mechanism and hooks it into Closure library.
This also fixes uncompiled mode on Cobalt, which does not have
document.write. (http://cobalt.foo/)
Fixes: 37246436
Change-Id: I4b8acf41edb314be359bca42d224112020c30709
The demo app supports a "compiled" parameter to load the compiled
version of the library instead of the uncompiled (default). Support
for this was briefly broken when we transitioned to using URL
fragments.
Change-Id: I84e5a481a18caf0e1e5a17e171a1b925848b9540
There are two versions of the compiled library: a debug version and a
release version. A recent change altered the differences. Before, the
only difference was that the debug had the source mapping. Now the
debug version doesn't rename anything and exposes all internal members.
To get the source mapping, the demo used the debug version. Now both
versions have the source map, so we should be using the release
version of the compiled library in the demo.
Change-Id: I33b4af6532e0eaf0749ffd8341d4f9d72a1ff0fa
- IE did not get forEach until IE 9, so it can't be used in
polyfill.installAll().
- Object.keys, console, and console.log.bind may all be unavailable
on older browsers, so skip initialization of on-screen logging in
the demo app if they are missing. The support test will fail
anyway.
- 'catch' is a reserved word on older browsers, so use the two-arg
version of then() to catch promise failures.
With these fixes, the support test can again be used on old browsers,
and the compiled-mode demo app can report an error back to IE 6.
Change-Id: I3019468f24a510a265ad5b13df4f01cd1bb1f34d
Still missing custom controls for live, but otherwise functional.
UI design and CSS based on work by Sam Dutton.
Change-Id: I0ee41254fb3b145822b018dff87aa583d6bef179