Commit Graph

26 Commits

Author SHA1 Message Date
Joey Parrish c1b109aabc fix: Correct license headers in CSS/LESS
This corrects/normalizes the license headers in CSS and LESS files.
The LESS tool respects the same "/*!" syntax for forcing the inclusion
of a license header, but will not dedup these licenses.  So the LESS
files generally will not use this syntax.  Instead, the build system
prepends a license header after compilation.

The exception is for our SVG spinner, which is based on third-party
CSS from codepen.  The copyright header for this is forced into the
output to give proper credit to the original author.

Issue #2638

Change-Id: I4c58e2b082f2d5e550a6f0a30feaaf9ebf82a53a
2020-06-09 16:19:38 -07:00
Jacob Trimble 326f5cd02a Use short license in more files.
Some of the files still used the old long license.  This increased the
size of the compiled bundle since it had both versions.

Change-Id: Iec137f71547f91369a563145f870eb26ddc96a96
2020-02-11 19:09:44 +00:00
Joey Parrish 4a7aee1daf Customize default UI config for desktop/mobile
To match Chrome native controls, the default controls for desktop will
now contain the small play/pause button, but default controls for
mobile will now contain the large play/pause button.  Mobile controls
will also not contain the volume button.

This removes several CSS-based versions of these things in preference
for configuration.

Apps can still override the defaults, no matter the platform.  Apps
can also make their own mobile-based config choices in JS by checking
video.ui.isMobile() or change styles in CSS using ".shaka-mobile".

Change-Id: I4fb8391f7f3727c7086cd3bca2b1d5c93bd9e856
2020-01-18 23:24:33 +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
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 01cd0b0aa1 CSS: Keep border on buttons during mouse navigation.
We used to disable both outline and border for mouse
navigation on the UI, which isn't what we actually
want (if a button has border, it should still have
it on mouse nav), but none of out buttons had borders,
so we never noticed.

Now we have a skip ad button that has a border, and this became
apparent.

Change-Id: I5e1bcb696686c76c32042b806c6534d41db36f90
2019-10-14 10:56:26 -07:00
Sandra Lokshina f485772b6d Add ad elements to the UI layout.
This change adds an ad counter and a skip add
button to the DOM and styles them appropriately.
Please note that they don't work yet!
The elements are hidden for now.
To check them out, remove the 'shaka-hidden'
class from the 'shaka-ad-controls' div.
(data-shaka-player-container -> shaka-ad-controls-container ->
shaka-ad-controls).

Change-Id: I45a33d43abc6b0a023cc77f09abdae94a4cee014
2019-10-11 21:56:44 +00:00
Theodore Abshire f24c4a783f Added stylelint, a linter for our CSS/less files.
Also unified CSS/less style based on that.
This does have to use a forked version of stylelint, since there
is a bug (?) in the globbing library they use that causes it to
fail on our buildbot. I found the simplest solution was just to add
an option to disable globbing, a feature we weren't using anyway.

Closes #1867

Change-Id: I9295b01d5b15d060356e314938b64b551b75de6a
2019-08-08 18:38:19 +00:00
Joey Parrish c1730ab09c Match font size with Chrome's native controls
This adjusts the font size on the UI time display to match that of
Chrome's native controls (as of Chrome 75).

Change-Id: Ie28498669f21e528f919d118dcb0b52477ebda4f
2019-07-10 20:57:33 +00:00
Sandra Lokshina 382d16bcd7 Show spinner when buffering even if other controls are hidden.
Fixes #1921

Change-Id: If7cfac07e09893b3f087c033bd3bb2d7f66dc463
2019-06-03 18:31:08 +00:00
Joey Parrish 58cedb0367 Add @license to all LESS and CSS files
Change-Id: Ibefe715afcb3676d5a2694032b9c99fe98dd2c44
2019-05-10 17:26:14 +00:00
Joey Parrish 683d17f57e Hide volume button on mobile
Fixes b/131924038

Change-Id: I4c86cb14c240c8e795e18fdf54e8bee11a3cec61
2019-05-07 22:28:56 +00:00
Sandra Lokshina 5678bae39e Stop text displayer from interfering with controls' work.
Position the text container (for the custom text displayer)
'behind' the controls, so it doesn't block other elements.

Closes #1874
Closes #1873

Change-Id: I630e447d2c04a3e139a80eb4c646ac195a56bec5
2019-04-09 18:19:48 +00:00
Michelle Zhuo 8459362237 UI Ally: Make live stream timecode accessible
Closes #1861

Change-Id: I1963d9edf42916bcc3f49dade8e6a436b153d3be
2019-04-09 10:21:28 -07:00
Álvaro Velad Galván 6f3241e696 Add SMPTE-TT Subtitle Images (#1859)
This change adds support for images via SMPTE-TT by adding background image support to the TTML text parser. This required changing region parsing to respect global extends.

Issue #840
2019-04-04 15:19:08 -07:00
Joey Parrish 1095ecb009 Move UI images to a folder
Change-Id: I70cad100344cffc06911444b4ebaa8f11232e6fa
2019-02-27 13:18:12 -08:00
Sandra Lokshina 40afb00f20 Add spacer element to the UI.
Issue #1673.

Change-Id: I8e01366f82e5e7d3b9365d8387f02eede877ad07
2019-01-18 21:48:31 +00:00
Joey Parrish 51c31468f4 Fix percentage-width sizing for play button
This takes a completely different approach to play button sizing.  The
intended effect is the same, but this method uses padding to achieve a
1:1 aspect ratio instead of the size of the spinner contained within.

Because the spinner was sometimes hidden with display:none, it would
not take up any space in that state, causing the play button size to
collapse as well.  By using padding and overlay mixins instead, the
play button size is independent of the spinner size.

Closes #1749

Change-Id: I2e46f067283001ca2f2db44c0c6ea675ea781f46
2019-01-14 22:34:35 +00:00
Joey Parrish 4f08dab6fb Stop resizing the play button in JS
Make the play button and spinner a simple 15% of video width.

Fixes b/116328412
Fixes #1715

Change-Id: I31708d0066a033e64ebdeb9fa603688c5f99860b
2018-12-18 22:40:10 +00:00
Joey Parrish 49fbade422 Simplify the buffering spinner layout
- Drop the containing div
 - Move the SVG inside the play button
 - Drop overlay semantics, let the button simply contain the spinner
 - Change SVG coordinates to fill the viewbox

The SVG size is now matched to the size of the play button, and only
the button needs to be resized to resize both the button and spinner.

Prework for b/116328412, #1715

Change-Id: Ie1386f5f269978763adb36b77defe040e3aab503
2018-12-12 15:34:04 -08:00
Joey Parrish 75174ba2ce Fix container size and resolve some TODOs
This fixes a small bug in the size of the video container (hardly
noticeable) and resolves some TODOs (documenting box-sizing and
abandoning a non-viable refactor TODO about font-family).

Change-Id: I6586e018e79fdf2d0d24a90c0c4c6ec10430e50f
2018-12-10 13:44:24 -08:00
Joey Parrish bd47e6e9b4 Fix focus styling and tab nav
This makes focus styling consistent across browsers and makes the
video element itself non-tab-navigable when the custom controls are
shown.  If native controls are turned on, we make the video element
tab-navigable again.

Fixes #1679 (tab nav styles inconsistent across browsers)
Fixes #1680 (tab nav on video element on Firefox)

Change-Id: I7f7a4af4cc8fc6ab1164d821f57684b5d726ebb7
2018-12-10 13:18:14 -08:00
Joey Parrish 28baafe11c Fix play button size
Make the play button a little bigger by default, to encompass the
default size of the SVG spinner.

This fixes display on browsers where our JS resizing code has no
effect, such as IE 11.

Fixes #1709

Change-Id: Ie91869884ab26cec90099a81143880077cefe3c1
2018-12-10 11:45:44 -08:00
Joey Parrish 2379c4485c Refactor and clean up CSS/Less, and controls JS
- Make shaka-overlay-parent a mixin instead of an actual class
   - Fox maximum stylability, it should be the job of the styles to
     position and overlay objects without JS code declaring that it be
     so.
 - The "seek to live" effect of clicking the current time no longer
   depends on the seek bar being used
 - The shaka-transparent class is not needed.  The controls are now
   set to be opaque based on an attribute.
 - Use an attribute for casting state as well.
 - Remove redundant opacity transition on play button.  It is already
   on the controls overlay as a whole.
 - Make layout more generic, which allows us to remove some explicit
   positioning and browser-specific layout hacks.
 - Rename user-select(), whose value is always the default of "none",
   to unselectable().
 - Remove unnecessary or redundant styles.
 - Apply the same default styles to all control elements, whether
   buttons, divs, or inputs.
 - Make overlay-parent() and overlay-child() more resilient with
   settings to fill space by default.
 - Consolidate the setting of displayed & hidden in JS.

Pre-work for #1703, #1709 (IE style fixes)

Makes progress on b/116651454 (hard-coded offsets)

Change-Id: I7ea579429979afa98f5b2c54f68114312c4f508d
2018-12-07 22:07:13 -08:00
Joey Parrish bab073932a Improve CSS/Less comments
This doesn't start refactoring, but does move a couple of lines around
to group them in clearer ways.  It also adds lots of comments
explaining what things are, what they are for, and where they appear.

Pre-work for #1703, #1709, and b/116651454

Change-Id: I77a76c569e4e426b040eaf55f900baa38414fc0c
2018-12-07 23:27:00 +00:00
Joey Parrish 9f2b4ef617 Split up less/CSS into several files
This doesn't change any styles.  It just splits related styles into
several separate files, so that things are easier to find.

Pre-work for #1703, #1709, and b/116651454

Change-Id: Icd3330a70ca6c8ff313991c127f8036238cae813
2018-12-07 10:09:37 -08:00