-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(ui): Add Quality, Language, Playback, Captions buttons to control panel #3465
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…l panel Quality, Language, Playback, and Captions buttons are now available to be placed in the control panel of the UI.
Corrects the behavior of a control panel event listener and fixes test structure.
theodab
requested changes
Jun 25, 2021
Corrects the construction of settings menus when present inside of the overflow menu.
michellezhuogg
approved these changes
Jul 13, 2021
Test Failure:
|
Removes additional requires for constants.
Thank you Shaka Bot, I incorrectly solved conflicts on my last upstream merge - Fixed it on my last commit! |
All tests passed! |
michellezhuogg
approved these changes
Jul 23, 2021
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The present pull request aims to provide a solution to #2676 (Add overflowMenuButtons to the UI bar) by making the Quality, Language, Playback and Captions buttons available in the UI control panel.
Preview
Configuration
Initialize the client with a
config
that includescaptions
,language
,captions
andquality
oncontrolPanelElements
, as follows.Changelog
The new buttons were added to the `controlPanelElements` list in the documentation.docs/tutorials/ui-customization.md
Additional unit tests were provided to check the submenus functionality.test/ui/ui_unit.js
Exposes the language button as a control panel option.ui/audio_language_selection.js
A click event listener is present to hide settings menus when clicking in the control panel, now that new buttons that open said menus are present in the control panel, this measure must be prevented to avoid an "instant open-close" behavior.ui/controls.js
An additional event listener was added to close other submenus when opening one.
New `CLOSE` and `CLOSED_CAPTIONS_OFF` icons were added, to be used in `ui/settings_menu.js` and `ui/text_selection.js` respectively.ui/enums.js
Previously, the captions button reflected the toggle status with a color change between black and grey. Now that the button is available on the control panel, this styles were removed as the change is signalized with an icon change to maintain the white color present in the other buttons of the panel.ui/overflow_menu.less
Another possible option would be changing between the "Material Icons Outlined" and "Material Icons Round" fonts which would require importing the former as new font.
Buttons that open submenus are initially built with a "Close" option. When present in the overflow menu, that option is replaced with a "Back" option to return to the main menu.ui/overflow_menu.js
Exposes the `playback_rate` button as a control panel option.ui/playback_rate.js
Exposes the `quality` button as a control panel option.ui/resolution_selection.js
Two CSS classes were added,`shaka-overflow-menu-only` (pre-existing) that hides the text label when present in the control panel, and `shaka-overflow-button` (new) which denies the "open-close" behavior described in `ui/controls.js`.ui/settings_menu.js
Settings menu are now also built with a close button by default, which is then replaced with a back button, in
ui/overflow_menu.js
, exclusively if they are part of the overflow menu.
Exposes the captions button as a control panel option, and replaces the previously existing color change on-toggle.ui/text_selecion.js