Commit Graph

26 Commits

Author SHA1 Message Date
Aditya Mishra 415ebdc52e feat(UI): Add live subtitle style preview on hover (#10077) 2026-05-12 13:24:17 +02:00
Andy(김규회) f1c0468f70 feat(UI): Improve shaka player UI accessibility (#10023)
### ARIA attributes
  - Add `aria-hidden="true"` to all decorative SVG icons (`icon.js`)
- Implement missing `aria-label` for ad controls (`skip_ad_button.js`,
`ad_info.js`)
- Add `aria-pressed` to toggle buttons (mute, fullscreen, pip, loop,
statistics, remote, stereoscopic)
- Remove incorrect `aria-pressed` from one-shot action button
(`recenter_vr.js`)
- Add `role="menu"`, `aria-haspopup`, `aria-expanded` to menus
(`overflow_menu.js`, `settings_menu.js`, `context_menu.js`)
- Add `role="menuitemradio"` and `aria-checked` to selection menus
(resolution, language, text, playback rate, etc.)
- Add `role="toolbar"` to control panel (`controls.js`)
- Add `role="heading"` to content title (`content_title.js`)
  
### Focus management
- Restore focus to trigger button when menus close
  - Maintain focus on fullscreen button after toggle     

 ### CSS
- Add `forced-colors` media query for Windows high contrast mode
  ### Other
- Add `alt=""` to seek bar thumbnail image
- Add `aria-hidden="true"` to watermark canvas
  - Add accessibility unit tests for ARIA attributes
- Remove redundant `aria-hidden` from checkmark icon (`ui_utils.js`)
  - Add ARIA terms to project spell-check dictionary  

Issue https://github.com/shaka-project/shaka-player/issues/3146
2026-04-23 14:53:23 +02:00
Álvaro Velad Galván 268fb19719 feat(UI): Add showMenusOnTheRight config (#9838)
Close https://github.com/shaka-project/shaka-player/issues/9833
2026-03-18 13:17:24 +01:00
Álvaro Velad Galván 93080cd9d3 fix(UI): Add a gap to settings menu to avoid overlapping with the edge of the video (#9765)
Before:
<img width="863" height="372" alt="Before"
src="https://github.com/user-attachments/assets/1f5876fc-8e6c-441a-9948-b2f39041d9f4"
/>

After:
<img width="863" height="372" alt="After"
src="https://github.com/user-attachments/assets/98823e15-2217-4820-b2a1-b51017093c5a"
/>
2026-02-27 06:20:47 +01:00
Álvaro Velad Galván 2d02ae3f6d feat(UI): Allow all items registered in overflow to be in the context menu (#9527) 2025-12-19 09:23:07 +01:00
Soumalya Bhattacharya da7bb4d276 fix(UI): Make Overflow/Settings Menu position dynamic (#9395)
Close #9287

---------

Co-authored-by: Álvaro Velad Galván <ladvan91@hotmail.com>
2025-12-15 10:41:32 +01:00
Álvaro Velad Galván 0f4e849acf fix(UI): Fix position of sub menus (#9485)
Now the submenus are rendered within the overflow menu
2025-12-10 13:28:40 +01:00
Phyo Wai Lin e7b1e5a0f6 feat(UI): Ability to change UI icons (#9115)
## How to register a custom icon?

**Icons need to be registered before initializing the player.**

Register a custom icon from  Material Symbols:

```js
shaka.ui.IconRegistry.register('<PATH_VALUE>');
```

Register a custom Icon from any icon set:

```js
shaka.ui.IconRegistry.register('<NAME>', {
  path: '<PATH_VALUE>',
  viewBox: '<VIEW_BOX>',
  size:  24, // optional
});
```

Register a custom Icon (that contains multiple paths) from any icon set:

```js
shaka.ui.IconRegistry.register('<NAME>', {
  path: ['<PATH_VALUE_1>', '<PATH_VALUE_2>'],
  viewBox: '<VIEW_BOX>',
  size:  24, // optional
});
```

Register a custom Icon using URL of the icon:

```js
shaka.ui.IconRegistry.register('<NAME>', {
  url: '<URL>',
  size:  24, // optional
});
```

Closes: #9045

---------

Co-authored-by: Álvaro Velad Galván <ladvan91@hotmail.com>
2025-09-19 11:59:17 +02:00
Phyo Wai Lin 7d61334759 feat(UI): Replace icon font with SVG icons (#8986)
* Update all UI components to use SVG icons instead of icon fonts
* Adjust some icon sizes to 32px

Replacing icon fonts with inline SVGs removes the loading delay caused
by font fetching. Icons now appear immediately with zero delay.

Close https://github.com/shaka-project/shaka-player/issues/2467
2025-08-19 12:40:53 +02:00
Álvaro Velad Galván c7d2a38fa6 fix(UI): Resize overflow and settings menus when necessary (#8742) 2025-06-12 14:29:45 +02:00
Álvaro Velad Galván 1c8539698c feat(UI): Modernization of the UI (#8409)
Changes:
- The look has been changed to make it more similar to YouTube:
  - The main background color is now black, and the font is white.
  - Presentation time has been moved to the bottom.
  - Cast and airplay buttons are now more accessible.
  - Tooltips have been enabled except on mobile platforms.
- The ad information has been moved to appear in the same position as
the presentation time when the ad is present.
- A mark indicating the current quality has been added (e.g.: HD, 2K,
4K, 8K)
- The spinner has been replaced with one that works well on Smart TVs
and is very similar to the current one. The animation is included in the
SVG element itself rather than through CSS.
- More LESS variables have been added to make customization easier in
forks.
- The maximum size of the menus is dynamically calculated so that they
never extend outside the video container.
- The size of the subtitle container when the UI appears is now
calculated dynamically.
- The Demo has been updated to show the seekbar when trickplays are
enabled.
- UI performance on Smart TVs has been improved (Tested on Tizen 5.0)
- Many offsets that were hardcoded have been removed, but not all (in
CSS).

Close https://github.com/shaka-project/shaka-player/issues/8406
2025-04-08 13:46:23 +02:00
Álvaro Velad Galván ea0790727d fix(UI): Don't allow click on the buttons when the UI is not visible (#8396) 2025-04-04 12:32:17 +02:00
Álvaro Velad Galván 5fc0fecd16 feat(UI): Close submenu or context menu on option click (#8193)
Close https://github.com/shaka-project/shaka-player/issues/8192
2025-03-03 08:25:06 +01:00
Gonzalo Rodríguez b40b6e7669 fix: focus on first element when back to the settings menu (#4653)
Going to the configuration menu using the keyboard and entering some
menu, when going back the focus is lost because the first element of the
HTML tree is hidden. This makes it difficult to use the player using
accessibility shortcuts.

Closes #4652

Co-authored-by: Gonzalo Rodriguez <pgonzalorodriguez@gmail.com>
2022-11-04 09:48:55 -07:00
Nico 481b378a4b feat(ui): Add Quality, Language, Playback, Captions buttons to control panel (#3465) 2021-07-23 12:12:16 -07:00
Joey Parrish 5001086901 fix(ui): Fix renaming of UI base class protected members
This fixes the renaming of the protected members of SettingsMenu and
RangeElement, both of which are useful to apps building custom UI
plugins.

In order for those app-level plugins to access the protected members
of the base class, they needed to be part of an external interface.
Otherwise the compiler would rename them.

Closes #2923

Change-Id: I2edb9f1428789fac1e6c60ec6a68b20cdd249ae5
2020-10-20 15:51:54 +00: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 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
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 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 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