Commit Graph

28 Commits

Author SHA1 Message Date
Nbcl adc3502d55 feat(ui): Add quality selection for audio-only content (#3649)
Replaces resolution menu with audio quality menu when content is audio-only.

Fixes: #2071
2022-04-21 15:43:51 -07:00
Nico d5769eeda4 feat(ui): Add tooltips to control panel buttons (#3572)
Adds configurable tooltips that display the function of buttons in the control panel.
Closes: #3269
2021-08-23 10:00:43 -07:00
Nico 481b378a4b feat(ui): Add Quality, Language, Playback, Captions buttons to control panel (#3465) 2021-07-23 12:12:16 -07:00
Álvaro Velad Galván 3b2f7dba04 Fix(UI): Stop using setAttribute for ARIA (#3489)
* Stop using setAttribute for ARIA
* Remove references to shaka.ui.Constants.ARIA_LABEL
2021-07-07 12:30:32 -07:00
Theodore Abshire 67a49d45e3 cleanup: Add missing requires.
This is a port of the internal changes: cl/329816039

Change-Id: If162e80e107ef7dc40956d6f4160d24f6d50858d
2020-09-14 22:50:49 +00:00
Joey Parrish 2d4f36f509 fix: Add missing require statements
Caught by a newer compiler

Change-Id: I27a392b35302cce0817c2e95cd25584df4c2b58d
2020-08-25 16:30:53 -07:00
Joey Parrish f539147d48 fix: Correct license headers in compiled output
This fixes all the license headers in the main library, which corrects
the appearance of the main license in the compiled output.

It seems that the `!` in the header forces the compiler to keep it in
the output.  I believe older compiler releases did this purely based
on `@license`.

Issue #2638

Change-Id: I7f0e918caad10c9af689c9d07672b7fe9be7b2f3
2020-06-09 16:05:09 -07:00
Joey Parrish 342d35f4f9 Fix issues with nullability of numbers
Various issues with the nullability of number types led to various
fixes, including:
 - defaulting a nullable number to 0 to avoid propagating a null value
   through calculations
 - adding an assertion or runtime check that something is not null
 - moving an existing null check to before the calculation
 - returning early on null during an iteration
 - changing a nullable number to non-nullable
 - defaulting to NaN instead of null

These issues were caught by a compiler upgrade.

Issue #2528

Change-Id: I86d516c74a42ee3624c33d7513d2d4c76d3ea589
2020-04-30 16:00:00 +00:00
Joey Parrish c1d849bc9b Fix UI button types
The compiler is very picky about the use of the "disabled" property on
HTMLElement, since it is only defined on certain subclasses of that.
This adds a method to create a button with the correct type to satisfy
the compiler.

Issue #2528

Change-Id: I31cacd62a35acc87b245ab362dbab55d791cf34d
2020-04-28 21:40:53 +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
Sandra Lokshina 5646184030 Add a SettingsMenu class for settings menus.
This extracts common code in our overflow menu settings
menus.
Text, Audio Language and Resolution selections now inherit
from this class. It also makes it easier to create new
overflow menu items.

Closes #2091

Change-Id: Ib68e1fb295ed3ec61cb7a072c039a5c7c4e22183
2019-08-20 17:40:47 +00:00
Sandra Lokshina 05cb3cf2e8 Add clearBufferOnQualityChange field to UI config.
Resolutions menu calls player.selectVariantTrack() when
a user selects a resolution. SelectVariant track has a
clearBuffer argument that we used to always set to true.
However, an app may want it to be false. This change
makes this behavior configurable.

Closes #1733.

Change-Id: I6a0dbcca99a8322d68abd0151afd66af31530856
2019-08-16 21:33:16 +00:00
Jacob Trimble d44430e66e Fix duplicate resolution entries in UI menu.
Closes #2085

Change-Id: Idfdcd0cf89f43bd6a624afbb88e504d7653c9ae3
2019-08-16 18:32:28 +00:00
Michelle Zhuo f67df3d7ad Use eventManager.listen() instead of addEventListener in UI
Issue #1924

Change-Id: I9870d4002fd5f0f99b5de164de41b107af1b3d9b
2019-06-05 16:25:26 -07:00
Jacob Trimble b4c1be72f3 Fix some missing ES6 conversions in UI.
Issue #1157

Change-Id: Ied0d37222680f4aa88638e7510b7a0e07844aa69
2019-05-21 21:02:00 +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
Jacob Trimble f130dffcef Enable eslint indentation rule.
This is a fully automated change.  The linter will fail because the
extra indentation caused line-length errors.  These won't be fixed
automatically.  They are fixed in a follow-up to make this one fully
automated.

Change-Id: I4d8cf9c998985add2bcd24a81c8d65495668c4f3
2019-05-13 22:31:09 +00:00
Jacob Trimble 47daf49f31 Use arrow functions for callbacks.
This is an automated change to convert use of "function" functions
to arrow functions.  This doesn't change all uses of bind() that
could be converted.  This also doesn't remove all "function" functions.

Change-Id: I40ac7d086bcef947a1be083359c8fd1d4499a9c3
2019-05-09 16:40:46 +00: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 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 56a48ec9b9 Fix resolution menu restoration
If the resolution menu sees audio-only content, it should be hidden.
But it should come back as soon as the audio-video content is seen.

This came up during work on #997 and #382

Change-Id: I3297847c905c867bcdd14cf7e525a408890a273a
2019-04-30 12:03:29 -07:00
Joey Parrish 182a7754e7 Simplify language-related calculations in the UI
Just some minor cleanup I did while working in this area.

Change-Id: I94993c3bc9337cfe23033570c4035bad94095d05
2019-04-26 21:09:54 +00:00
Sandra Lokshina 3721797cd2 Add abrstatuschanged event.
Add event to notify listeners when abr is being enabled/disabled.
The resolutions menu is listening for variantchanged events to
update itself. It's possible, however, that just enabled abr
will pick the same variant that's currently being played, in
which case, there'll be no variantchanged event. The resolution,
though, still needs to update to reflect the fact that 'Auto'
resolution is selected now and not a specific one.

Adding an event for when the abr state changes helps solve
this.

Fixes b/131099397

Change-Id: I63b218d7423cd0d389dd540c5ed05966e00b861c
2019-04-23 23:55:49 +00:00
Sandra Lokshina 6085a5cd09 Small refactors of resolution and language menus.
1) Resolutions: don't construct the 'Auto' button
twice.
2) Languages: don't update the entire menu on
localization events.

Change-Id: Ie9160f502513e46544ca14005cd91c002acf1e92
2019-04-18 14:32:47 -07:00
Sandra Lokshina 48ba5c75c0 Add integration tests for the resolutions menu.
Change-Id: I86e8d675daf48a19b477f8d92e80fc706f189d90
2019-04-18 18:29:37 +00:00
Joey Parrish 00442a9a7c Split up localization data for lazy loading
This changes the format of the localization data to enable apps to
trivially lazy-load translations.  It also adds --locales to the build
scripts to allow app developers to choose the compiled-in locales.
The generated output now goes into dist/ and is not checked into
revision control.  Finally, it adds "description" and "meaning" fields
to the source messages to allow us to more easily integrate with a
context-aware human translation service.  The "description" field
provides application context for the translator, while the "meaning"
field provides linguistic disambiguation for words with multiple
meanings or parts of speech in the original English.

Because the translation service wants to collapse messages with
identical text, we had to merge several messages together.  To this
end, we have removed the prefixes "ARIA_LABEL_" and "LABEL_" from the
messages themselves and collapsed what remained.

Issue #1688

Change-Id: I24c17e71c73f6663cf123cfdba118c486fa80ecc
2019-04-09 16:06:14 -07:00
Sandra Lokshina 493d459c47 Add a DOM util.
Change-Id: Ia0941868f20dbb42fa0fe02a639015ac244a65ed
2019-04-05 12:01:59 -07:00
Sandra Lokshina 4d41b7b90c Refactor the overflow menu to use components design.
Closes #1673.

Change-Id: I030745def928796a6abc813a91fb163cb2d76175
2019-02-21 13:14:28 -08:00