Commit Graph

27 Commits

Author SHA1 Message Date
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 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 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
Sandra Lokshina fcc27b144a Hide overflow menu while ads are playing.
Change-Id: Ia77f0996c919e78b0a08b90e878c5615dcccf5bf
2020-04-07 18:32:13 +00:00
Joey Parrish 714da55bbc Clean up FIXMEs in LESS code
- Drop unused classes
 - Drop shaka-displayed in favor of shaka-hidden
 - Move shaka-hidden to general.less and fix specificity issue

Change-Id: I9c91da637023607cccd6e7602d9b9ef30994dd82
2020-02-10 23:14:27 +00:00
Joey Parrish 22e8c29a0d Use CSS & container attributes to hide controls
This is now based solely on container attributes and CSS, as it used
to be, removing the need for a list of controls to hide in JavaScript.
This also does away with the "shaka-fade-out-on-mouse-out" CSS class.

Change-Id: Ic2f77c5b2f0691023279d9c99cfe3519f4b26cdd
2020-01-14 10:42:36 -08:00
Joey Parrish 55eb33d1c3 Overhaul UI opacity logic
- "Override CSS" could be set and unset from multiple places, such
   that the calls from the overflow menus were easily invalidated by
   mouse movements.  This flag is now gone.
 - "Show on mouse over" controls were implemented using mouseenter and
   mouseleave events on each element.  These listeners are now gone.
 - Casting state, used to compute if the controls are opaque, is now
   based on the same "casting" attribute used by the CSS to force them
   to be opaque.
 - Opacity decisions are now made by a single method, which accounts
   for video and ad pause state, the hover state of "show on mouse
   over" controls such as the overflow menus, and the recency of mouse
   movements (represented by a single flag maintained by the existing
   mouseover timers).
 - An opacity decision is now triggered on play state changes, so the
   UI content should always be correct when we pause a cast receiver.
 - An opacity decision is now triggered on keyboard navigation
   changes, so the UI should always be opaque when using keyboard
   navigation.

Closes #2314

Change-Id: I5062feaf4698595deb89a2471a37c06bc9762bb5
2020-01-14 03:04:45 +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 26283599a9 Make sure ad UI stays visible when other controls fade out.
This CL changes the way controls fade out on mouseout to make
sure ad controls stay visible even when other controls are not.
Instead of fading everything within the top level controls
container, it's now possible to hide some controls, but
leave the others. Controls that need to fade on mouseout
are tagged with a 'shaka-fade-out-on-mouse-out' class.

To try out the change, make the 'shaka-ad-controls'
div visible and mouse out of the video container.
Everything except for the ad controls should fade.
(Please note that ad controls don't do anything meaningful yet).

Change-Id: I4fcd1b6430df680699980c492ec1d612437a877d
2019-10-14 14:31:40 -07:00
Sandra Lokshina fdd2602acd Release old ui.Elements on controls.configure() calls.
The calls to controls.configure() deleted the old layout
in terms of the html elements, but the ui.Elements
owning the html still survived.
This CL fixes that. It also switches ui.Element from
IDestroyable to IReleasable to make the release synchronous.

Fixes #2089.

Change-Id: Ic4ce70e91a1b028ef4d971ac3fb9281d8a667ea8
2019-08-20 21:09:15 +00:00
Jacob Trimble 5c35108cb8 Avoid integer for loops.
Issue #1518

Change-Id: I3ba3cb6a439264e823022b2a64e7cdbd265494c7
2019-07-09 17:11:49 +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
Alan Huang 00c25ff8d2 Change instance attribute to local variable.
backToOverflowMenuButtons_ is only used in the constructor immediately
after it is set.

Change-Id: I7a320711eb604c70e69a84737ee7c26f6b2e8271
2019-05-15 14:35:21 -04: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 381274fbbd Enforce a consistent dot location.
Change-Id: Ic3b86c4c113023206bc37a117e96f672f351121b
2019-05-09 21:09:30 +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
Joey Parrish f39bade337 Add play/pause button in controls
This is different from the giant play/pause button that sits over the
video container.

Change-Id: I4629b3a64a5208f23c65b383f4fb992e6ddfd334
2019-05-07 17:57:59 +00:00
Joey Parrish e5620f3891 Thoroughly wipe out references in UI destroy
There are some cases in testing where held references cause issues,
such as video elements lingering between tests on Tizen.  This does a
better job of clearing out resources in destroy() methods in the UI.

Change-Id: Ib1434ed11561216cd41ec247535ea7b32c1154d1
2019-05-06 16:13:39 +00:00
Joey Parrish 62c8762fdd Destroy UI child elements in controls.destroy
The IUIElement interface include destroy(), so we should make sure to
call it.

Change-Id: I91b9f2cc7b94ba8659e9fe65a2fe7df4da9ddfa2
2019-05-03 20:45:33 +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
Theodore Abshire d02759bdea Fix cast button on ui.
Previously, the cast button would not show up on the ui.
This was due to a typo in an event listener (it was looking for
'caststatuschange' rather than 'caststatuschanged'), and due to
the ui starting the button out hidden and only revealing it on
cast status change.
This fixes that typo, and changes the button to start out in an
appropriate state.

Issue #1803

Change-Id: I06a18015511fd897b15606d2bb75b3a448e124c7
2019-02-20 21:39:12 +00:00
Sandra Lokshina f07f39c716 Remove aria-pressed state from the captions button.
Captions selection used to be a simple on/off button
and having aria-pressed state on it made sense. Now
that it's a gateway to text language selection the
state is no longer applicable.

Change-Id: I3780501afc8d3f5efa835ae9f015b44763c78c0e
2019-02-08 20:03:01 +00:00
Sandra Lokshina 6e687ef216 Set aria-labels on buttons when they are loaded
Change-Id: Ib880c818b2dbc3ff060d668311885b15ef0306c0
2019-02-08 16:45:03 +00:00
Sandra Lokshina 121b615c3e Break UI into components design.
What's already done:
- UIElement and IUIElement interface
- All elements register themselves with controls
- Each element is responsible for its' behavior
- A bit of clean up with constants/enums moving to
their own files

What is not done yet:
- Overflow menu is a dumping ground now. Its'
elements will move to the UIElement model eventually, too.
- Build files are hacked a bit and will need more attention.
- No clean up has been done except for the constants/enums.

Change-Id: I9917aa705e85158a2f26830bd988552fe177e53b
2019-01-17 21:58:12 +00:00