Commit Graph

78 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 d60cb13c47 fix(ui): Apply upstream styles for icons font
When we changed the font for the icons without changing the class
name, we lost upstream styles from the font server.  This was not
obvious in our demo, but was more obvious in other apps where the font
size was different.

By using the same class name as used by the font server, we get those
upstream styles applied correctly.

Issue #2633

Change-Id: I615c1dfd86e5b9802d03050c5db0154ac196c2ef
2020-06-09 19:16:23 +00:00
Joey Parrish 741424eef6 fix: Correct IMA SDK URLs in service worker and docs
The IMA SDK URLs in the service worker were http, and should have been
https.  This caused an issue when deploying v3.0.0 to appspot.

The IMA SDK URLs in the demo specified no protocol, but that is not
necessary, since https works in all contexts.

The IMA SDK URLs in the docs also specified no protocol, and one of
them was incorrect.

This corrects the mistaken URLs and makes them universally https.

Change-Id: I53dbf25ddb16ec882fcf3c070bcebed726277be1
2020-06-08 20:38:49 -07:00
Joey Parrish e6dff67b57 chore: Update receiver app ID for v3.0
Change-Id: Ied0311dcac4730eb4b72bb5404db20263993e9ba
2020-06-09 00:10:48 +00:00
Joey Parrish 1076b78465 Unfork Closure base and update the compiler
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
2020-04-30 19:32:30 -07:00
Joey Parrish 09147b1273 Update references to "search" tab to "all content"
Change-Id: I77dcc3055b58216db26de7a003b0fd980c779e76
2020-03-10 17:14:51 +00:00
Theodore Abshire 25396ce403 Load pwacompat through npm.
Loading pwacompat off of jsdelivr was flagged as a security issue
through an automated scan. Since Google does not control jsdelivr,
that is theoretically true.
This just loads a local version of pwacompat via npm, and uses that
instead.

Change-Id: Iba9288a1d440dfdfa039a32b530f6da981c5b055
2020-02-28 10:43:14 -08:00
Sandra Lokshina c445b6bcef Add small fixes for DAI and integrate with ad UI.
Issue #2367

Change-Id: Idcd0415359166965e974bbf0b0ee393c0828ae75
2020-02-24 18:33:21 +00:00
Sandra Lokshina a041bb6ea2 Add our new AdSense id to the demo page.
This is one of the steps required to set up
Google Ad Manager, which we need for SS ads testing.

Change-Id: I5ea467335897065a0502622bf0d30c5b3b0612b8
2020-02-07 22:26:31 +00:00
Joey Parrish cc640eb51c Drop references to CDNJS
CDNJS isn't updating correctly and maintenance of that mirror's config
is nearly impossible.

Also adds a reference to jsDelivr in the README, matching what's in
the demo app.

Closes #2343

Change-Id: I3a337ccd55ebc4c193ab205a7f8c8a77c33a4b4b
2020-01-16 22:36:32 +00:00
Theodore Abshire ffd3d100aa Fix message id of report bug button.
The correct message id is REPORT_BUG; we had it as DEMO_REPORT_BUG,
which is the id of the localized string.

Closes #2340

Change-Id: I7c737d7a74e5d0258db0d70e4f90f9d85abcd391
2020-01-14 05:20:21 +00:00
Joey Parrish b9b4118938 Add a polyfill for EME encryption scheme queries
Note that the encryptionScheme field isn't being used by Shaka Player
yet, but that this will enable us to experiment with it ahead of the
full launch of the feature in browsers.

See also:
 - https://wicg.github.io/encrypted-media-encryption-scheme/
 - https://github.com/WICG/encrypted-media-encryption-scheme/issues/13
 - https://github.com/w3c/encrypted-media/pull/457

Change-Id: I9e8c2b6ce4ce3f4fe634fa4164669c69959e7fde
2019-11-22 18:18:36 +00:00
Theodore Abshire 4c6325de08 Added localization system to demo.
No localizations exist currently, but this adds the framework for them.

Change-Id: I81a8cab128884753c765a192181d5d88f0ed13f1
2019-11-18 19:41:58 +00:00
Sandra Lokshina c2105a362b Lay the ground for the Ad Insertion work.
This CL does:
- define CS IMA externs
- define Ad Insertion classes and sctructures
- add a (non-working) skeleton for the Ad UI
- provide a (working) early draft of the CS implementation

This CL does not:
- add any SS logic
- have a working ad UI
- provide a final and complete implementation for the CS logic
- fully follow the finalized Ad Insertion design

Change-Id: I645cdcb3a1d4041792b940c2d6faf011be5eb682
2019-10-03 20:01:38 +00:00
Theodore Abshire 9c15e80b7c Improve mobile Safari PWA support in demo.
Closes #2143

Change-Id: Ic0b1963ef0f040b637136b71255b7e4527e3985b
2019-09-16 15:04:24 -07:00
Sandra Lokshina 1e746e6551 Keep a mapping of compiled to extern player method names in cast proxy.
In compiled mode, UI calls player methods by their compiled, renamed names.
The proxy object doesn't know those, so an error used to be thrown while
casting in compiled mode. This change adds a map from compiled to extern
names that cast proxy can use.
It also cleans up proxy code a bit and points the demo to the nightly
build of cast receiver.

Closes #2130.

Change-Id: I39b83c6a1e050a68d70e7923d1a07ad8929daeeb
2019-09-11 11:20:30 -07:00
Theodore Abshire a84fd65d9e Added "report bug" button to demo.
Change-Id: I27e25f8b88effc596e2f836ec263f9ae9d2b5fc0
2019-09-04 22:51:03 +00:00
Theodore Abshire 37bc58d638 Still load tabs in noinput mode.
In noinput mode, we avoided loading the tabs, since they were unnecessary.
However, it turns out that we did need to load them if we wanted to load
custom assets, since they can only be loaded properly if the custom tab
exists.
This changes the demo to load the tabs, and just hide their contents.

Closes #2098

Change-Id: I2c4702fbaae3c88b44d86c7ac9e383728af42867
2019-08-13 17:27:53 +00:00
Theodore Abshire 2c51de2574 Re-added hidden 'noinput' param to demo.
Change-Id: I137fdaf04342f20c8e389340473d0994c527998c
2019-07-29 10:38:59 -07:00
Theodore Abshire 9ce78fe388 Convert demo to goog.require and goog.provide.
Previously, in uncompiled mode, we were loading Shaka Player using
goog.require calls, but loading the demo code directly. This meant that
the demo code was loaded before the Shaka Player, code, which lead to
issues if something needed the "shaka" namespace to exist during
load-time; for example, if a demo class wanted to extend a Shaka class.
This adds goog.provide calls to the demo, so that it can be loaded with
goog.require also while in uncompiled mode.

Change-Id: If6cc92db0ce05dd9c3f298e9bd1a5119452ad8a4
2019-06-27 22:02:36 +00:00
Theodore Abshire 96c1f8795c Switch to using tippy.js for tooltips.
Previously, we were using MDL tooltips for our tooltips.
They seemed fine at first, but proved very temperamental; we had to
jump through hoops to get them to work inside MDL cards, and they kept
breaking for various reasons.
This instead adds the third-party tippy.js module, and uses that to make
tooltips instead.

Change-Id: I37ae9c9ade4e3c4dd6cbb1b86601377ed5d9e54f
2019-05-21 16:46:02 +00:00
Joey Parrish a06965dbb4 Update path to dialog polyfill
When we upgraded the node modules, we missed the fact that this path
changed.  This broke the demo app on Firefox, but not on Chrome, where
the polyfill is not needed.

Closes #1947

Change-Id: If889c46f840df7e3ee4aa67ab5026f0cebec2a41
2019-05-16 16:52:36 +00:00
Joey Parrish d66d6c4255 Upgrade mux.js and use minified version
The new mux.js release fixes support for a minified build, so we
should use that from now on.

videojs/mux.js#173

Change-Id: I08cff8d33a520fe753c5490a4719cba3bb27f19e
2019-05-13 14:24:41 -07:00
Joey Parrish 23c79955a7 Fix inlining of external CSS
Importing in less is not enough.  It will not necessarily inline what
is imported by default.  The "inline" option, however, will force the
CSS file to be inlined.  Without this, some of the `@import`
statements are put directly into the output file, triggering
additional network requests at runtime.  This also adds the "css"
option, which forces less to treat these inputs as CSS and not as
LESS.

Finally, we import MDL for the demo app as a node dependency instead
of loading it from another origin.

This improves the demo's Lighthouse scores of "First Contentful Paint"
by 27% and "First Meaningful Paint" by 14%.

Change-Id: I28e627d3df494e3c4893d31b6bf818f09e8153e9
2019-05-13 17:43:40 +00:00
Joey Parrish 279add1c1b Pre-connect to external origins
This optimizes the demo app by establishing HTTPS connections early.

Change-Id: I600c89d24db91e36fa201939514b42cca804e57a
2019-05-13 17:42:00 +00:00
Theodore Abshire c92a876b8f Add link to support page in demo footer.
Change-Id: Ibf088c15957f9d7d1fdef3e2f5344752fadf988b
2019-05-09 21:21:22 +00:00
Joey Parrish 34585af993 Inline external CSS for quicker load
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
2019-05-09 19:05:17 +00:00
Theodore Abshire 64b5456c4e Change video-container into a class, from an id.
This is so that the video is properly fullscreen on Safari.
Changing video-container into a class changes its specificity, and thus
changes in which order the css properties are applied.

Change-Id: I8b1e9e9479724d009014b97973a1aa1271a33773
2019-05-07 18:07:06 +00:00
Joey Parrish 3b0250c2a1 Fix cast receiver ID (v2.5, not v2.3!)
With the correct ID, the receiver is now understanding our signals.
Everything on the screen advances and updates as it should.

Fixes b/131253795

Change-Id: Id779cf299e66b8dff863960867831a2b2bb38b65
2019-05-07 02:44:30 +00:00
Joey Parrish c02cd2e8c6 Switch back to unminified mux.js
It turns out that due to a mux.js bug, the minified version is unusable.
See videojs/mux.js#173

Change-Id: I8d028e3f2b01789b6c0f99df736b29ee2d7b0c4f
2019-05-02 14:48:50 -07:00
Joey Parrish 269b53b7a0 Improve lighthouse score
- Use a minified mux.js and awesomplete.js
 - Add rel=noopener to offsite target=_blank links for security
 - Improve contrast on selected nav button and footer text
 - Add empty alt attributes to asset images, since these are
   not necessary to understand the page

Change-Id: I253c7354243aaa0fe98e1f075dae304ddad4a3e2
2019-05-01 17:25:45 -07:00
Joey Parrish e8d95a474c Fix service worker resource list for the new demo
- Don't cache Roboto Condensed, which is no longer used
 - Add back style sheet to load the Roboto font, which is used
 - Cache dialog and datalist polyfills used by the demo app

Change-Id: I0e347748a9830d95db0e4ba6bbfda7033edd3ac1
2019-05-01 23:23:08 +00:00
Joey Parrish 598d330d52 Fix service worker cache response for other origin
The service worker should not only be deciding what to cache, but what
to pull from cache.  A recent refactor to this file overlooked this,
which caused resources from other origins not to be available offline,
even though they were cached.

Change-Id: I62d7c2f96827e778a991b06d0bd222c4f0cb336b
2019-05-01 23:23:08 +00:00
Theodore Abshire 6bfb35fc69 Use declarative ui setup in demo.
Also adds a getConfiguration method to the ui, so that the demo does
not need to construct a config object from scratch.

Change-Id: Ic583fbcc0815494c7668242f6c798b8c15f09697
2019-05-01 20:53:47 +00:00
Theodore Abshire efc2ed3df1 Added new demo page.
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
2019-05-01 19:58:18 +00:00
Joey Parrish c3afb84209 Allow demo to play video inline on iOS
Without this attribute, iOS playbacks will force fullscreen mode.

Issue #997

Change-Id: I32bbe3d16f68d91c5fb3083c5d5862967140d140
2019-04-15 16:02:48 -07:00
Sandra Lokshina 6b1ca2d229 Initial release of Shaka Player UI
Other contributors:
 - @joeyparrish
 - @michellezhuogg
 - @TheModMaker
 - @theodab
 - @vaage

Change-Id: If6df33d9ab5035d1ead4402004f7de37ee8470f4
2018-11-16 14:40:37 -08:00
Joey Parrish 7a3b352023 An external Promise polyfill is no longer required
At some point, a compiler upgrade introduced a built-in polyfill for
Promise.  A third-party polyfill for Promises on IE11 is no longer
required.

Change-Id: Ie5a649232d949b0bba0c6c68ea54ceed6fb30891
2018-09-13 22:12:04 +00:00
Theodore Abshire b37a450aed Add availabilityWindowOverride configuration.
This config lets you override the availability window of a live stream.
It is in config.manifest, and passed along on start.
This will let users configure the parser so that they can seek with HLS
live streams, for example.

Closes #1177
Closes #1307

Change-Id: Icd3c1d81c6b52ebdbb72137df42fc91cd73a0207
2018-07-16 17:13:53 +00:00
Joey Parrish c13ac1fef1 Add preferred audio channel config field to demo
Issue #1013

Change-Id: I55cf86bd7b41d98155a4b4346277869cb4baa15c
2018-04-16 13:25:38 -07:00
Jacob Trimble 2f681146e1 Add unload button to demo.
Change-Id: I013d5b1b70dd63dd8aba05adbc89654aa8731068
2018-03-13 20:30:54 +00:00
Joey Parrish 82357486a6 Replace buggy Promise polyfill
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
2018-01-30 23:10:04 +00:00
Chris Fillmore 54d2c0d199 Add certificate field in the custom asset section of the demo. (#1136)
Fixes #1135
2017-11-20 13:02:58 -08:00
Joey Parrish 7e7a58d4d5 Rename demo "Autoplay" to "LoadOnRefresh"
This is to disambiguate with video.autoplay and to more clearly state
what this checkbox does.

Closes #1114

Change-Id: I23138957bda1fe6159b42bd4ae3327a426d379f9
2017-11-10 10:54:04 -08:00
Michelle Zhuo e516a64487 Transmux from Transport Stream to MP4
Supporting Transport Stream by transmuxing it to MP4, with mux.js
library.

Issue #887

Change-Id: I70361bb364721fc5e72cba7d0fabc311ce0ba8b5
2017-10-20 18:14:02 +00:00
Jacob Trimble 117ed46bd5 Add links to switch between compiled and uncompiled
This also modifies the build scripts to produce debug builds of the
demo and the receiver when doing debug builds.

Change-Id: I386a7b8f541332594a5022955a69970ebbe79200
2017-10-17 17:26:37 +00:00
François Beaufort 7a9fcbf1cb Add robustness suggestions for Widevine (#1008) 2017-10-03 13:48:09 -07:00
Joey Parrish d749a0325d [PWA] Allow user scaling
For accessibility reasons, we should allow user scaling.

Reported by Lighthouse.

Issue #905

Change-Id: I12c47f0fe0300fa24c61e24259eb40da45cbcb9b
2017-10-02 11:19:10 -07:00
Joey Parrish 51263249f6 [PWA] Do not block rendering to load JavaScript
Reported by lighthouse

Issue #905

Change-Id: Iee9623ab4fabe1432cca72bb9d329e8a07d26bb8
2017-10-02 11:19:10 -07:00
Joey Parrish 958e1c68dd [PWA] Compile the demo app and cast receiver app
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
2017-10-02 11:19:10 -07:00