Commit Graph

22 Commits

Author SHA1 Message Date
Joey Parrish c9bd9a5dc9 fix: Correct license headers in demo app
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
2020-06-09 16:07:06 -07:00
Theodore Abshire e90b3e0013 v2.5.x search hash parameters compatibility
When backporting the search parameters in hash feature to v2.5.x,
the mechanism behind it was modified to handle that branch's lack
of localized strings.
This updates the master version of the feature to follow that change;
now, instead of storing the value of the feature, we store the key.

Change-Id: Ic18aa2ff3d138a68cb3acc154aeb8c7e992daef3
2020-03-24 11:46:17 -07:00
Theodore Abshire a8927828e8 Add search filters to the URL.
Closes #2422

Change-Id: I567ad6b0368badcf1e8e2535a640adc650f4daea
2020-03-12 12:03:09 -07:00
Theodore Abshire 277dd859b4 Replace Live search boolean with a drop-down.
This adds an option for searching for VOD. It also changes the Live
search option to be a drop-down instead of a toggle, so as to prevent
users from trying to search for assets that are both Live and VOD.

Change-Id: Ib03a64128aea6d06baff23fc1d909090fdf7ef79
2020-02-27 21:34:51 -08:00
Theodore Abshire 192cb9d1f7 Replaced "Undefined" with "---" in demo.
"Undefined" was a bit confusing as a search term... does it mean
that you aren't searching for anything, or that you are searching for
things with "Undefined" as a value?
Hyphens are a clearer non-search value.

Change-Id: Ie2a542620265ae1f1ca167f18ca311d15d76acf7
2020-02-27 15:22:52 -08:00
Sandra Lokshina a38f61b1b6 Integrate ad experience into the demo page.
Different ads have been added to three assets.
Demo search CSS has been adjusted a bit for better
experience.
Feature name has been changed from "AD" to "ADS" to
reflect the fact that a single asset can have more
than one ad.

Issue #2222:

Change-Id: I12a63b813fb4bac79362f1689b485a824f5a9682
2020-01-29 18:21:16 +00:00
Theodore Abshire c702ce18a8 Added asset feature for "AD".
Change-Id: I16a90c0b9846c4e90df7be53fecc1aeddd0a22e4
2020-01-15 13:21:05 -08:00
Theodore Abshire 5cd3bebd5c Support re-loading page when locale changes.
Change-Id: I8c9a8801be445f62c292e049018fecf11ccc820c
2019-11-22 23:42:07 +00: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
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
Theodore Abshire 83ed3559c1 Moved the config field checks into actual tests.
Also added a cleanup procedure for the demo, for use in tests.

Change-Id: Ic26a8c7b012e66cdd88c09eb8d478ceeb6743ab4
2019-09-11 22:11:09 +00:00
Jacob Trimble 7764ff609f Don't put space before '=' in arg comment.
This standardizes how we handle the spacing in argument comments.  The
other way is much more common, so we standardized on that.  This add a
new linter rule to catch and automatically fix those issues.

Change-Id: I8ea54c47ae4d34cf8e1646e56c6ed8142b42afbe
2019-09-06 13:49:10 -07:00
Theodore Abshire b8c709b374 Added tooltips to the search filters on the demo.
Change-Id: I1a0633da938e615be6d3a6cea403bfc30d6adb2f
2019-09-04 22:51:11 +00:00
Sandra Lokshina a62bd79a33 Add 'audio only' to the search terms on the demo page.
This also centers the search options a bit to accommodate
an additional field.

Change-Id: Ic05a4faa7b820d69e03e16a9e526c39e8cde58c0
2019-08-23 22:15:45 +00:00
Theodore Abshire edc77647ea Made shakaDemo namespace for demo.
Change-Id: I53508d808f9b1d868f4c797095dcc9829cac7871
2019-06-28 10:50:19 -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
Sandra Lokshina dbb774fa9f Convert ui utils to ES6 and merge duplicate utils.
Both DOM and UI utils had a removeAllChildren method
that did the same thing. This change removes it from
the UI util and replaces all calls to it with calls
to the DOM util.

Issue #1157.

Change-Id: Iaf7998c460c03416d8651e2efd53c96bdcc9a258
2019-05-20 11:08:22 -07:00
Joey Parrish 05e0b80db2 Defer creating contents until shown
Each of the three pages in the demo app displays asset cards.  In some
cases, these can take a long time (hundreds to thousands of
milliseconds) to create the DOM elements and load the images.  To
improve startup performance for the app, defer creating the contents
of any given page until the page is shown.

This improves the demo's performance score in Lighthouse from 54 to
82, the "First Contentful Paint" score by 43%, and the "First
Meaningful Paint" score by 10%.

This incidentally fixes a race condition between the asset setup and
calculation of the platform's capabilities, so that the buttons are
always in the correct state on startup.

Change-Id: I73a70dec89e13cc16566dde7ef8659b3e1c64b17
2019-05-13 09:54:04 -07: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
Theodore Abshire 0ddff4f7ea Add support for multiple concurrent downloads.
At the moment, the storage manager does not support multiple concurrent
downloads. This modifies the demo to create a new storage instance every
time a storage operation is desired, then dispose of that instance after
the operation is complete.
This also refactors out the shaka-main-offline-changed event, which was
no longer necessary after allowing asset cards to re-load their buttons.

Issue #1432

Change-Id: I1312cf74a92f877279adb461e423a38e93bcfa0f
2019-05-07 16:31:15 -07:00
Theodore Abshire 5eebd021d2 Allow asset cards to re-load only buttons.
Change-Id: I47bca9eb70e0933b132544c851e79328f1ccaa04
2019-05-06 22:39:19 +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