1
0
mirror of https://github.com/videojs/video.js.git synced 2024-12-23 02:04:34 +02:00
Commit Graph

4118 Commits

Author SHA1 Message Date
Carlos Javier Villaseñor Castillo
ec69d5e620
feat(player): Make 'searchForTrackSelect_' private & use 'el' as parameter in function 'getIsFocusable' (#8697) 2024-04-18 12:57:27 -06:00
Borut Zizmond
21b4a5225b
feat: implement spatial navigation (#8570)
* feat(player): add spatialNavigation feature

Adds spatialNavigation feature to enhance user experience

- Implemented spatial navigation in slider component
- Enhanced player functionality for improved navigation

* feat(player): add spatialNavigation class
Adds spatialNavigation class to manage spatial-navigation-polyfill
- Set class SpatialNavigation on its own file
- Imported SpatialNavigation class on component class

* feat(player): update spatialNavigation class
Adds 3 methods to spatialNavigation class to manage spatial-navigation-polyfill
- Added start() to: Start listen of keydown events
- Added stop() to: Stop listen key down events
- Added getComponents() to: Get current focusable components

* feat(player): modify spatialNavigation class & modify component class
Modify spatialNavigation class:
-Remove unrequired version of function ‘getComponents’
Modify component class:
-Add function ‘getIsFocusable’

* Added methods getPositions, handleFocus and handleBLur for spatial navigation needs

* feat(player): modify Component class, BigPlayButton class & ClickableComponent class
Modify Component class:
-Add method getIsAvailableToBeFocused
-Modify method getIsFocusable to only focus on finding focusable candidates
Modify spatialNavigation class:
-Remove unrequired method ‘getIsFocusable’
Modify component class:
-Remove unrequired method ‘getIsFocusable’

* Added import in player.js, Created base methods inside spatial-navigation.js

* feat(player): modify Component class & SpatialNavigation class
Modify Component class:
-Modify method getIsAvailableToBeFocused to be more strict on candidates
Modify spatialNavigation class:
-Modify method getComponents to get all focusable components

* feat(player): modify Component class
Modify Component class:
-Add documentation to ‘isVisible’ function

* added keydown event logic for spatial-navigation

* feat(player): modify SpatialNavigation class
Modify SpatialNavigation class:
-Modify documentation of functions

* feat(player): modify SpatialNavigation class
Modify SpatialNavigation class:
-Add ‘clear’ & ‘remove’ methods

* feat(player): modify SpatialNavigation class
Modify SpatialNavigation class:
-Add documentation of functions

* feat(player): modify SpatialNavigation class
Modify SpatialNavigation class:
-Add function ‘getCurretComponent’‘’

* feat(player): modify SpatialNavigation class
Modify SpatialNavigation class:
-Add documentation for ‘findBestCandidate’ method

* Added logic for moving focus to the best candidate

* Implemented move, findBestCandidate, isInDirection, and calculateDistance methods for spatial navigation logic

* Added a new player option enableKeydownListener, Added gap: 1px to control-bar for spatial-navigation-polyfill needs

* feat(player): modify SpatialNavigation class  & Component class
Modify SpatialNavigation class:
-Add function ‘handlePlayerBlur’
-Add function ‘handlePlayerFocus’
Modify Component class:
-Modify ‘handleBlur’
-Modify ‘handleFocus’

* Removed enableKeydownListener flag, as user should start the SpatialNavigation manually

* Added functionality to track changes in the focusableComponents list (custom event focusableComponentsChanged)

* feat(player): modify SpatialNavigation class, ModalDialog  & Component class
Modify SpatialNavigation class:
-Add ‘lastFocusedComponent’
-Add function ‘refocusComponent’
Modify ModalDialog class:
-Add condition on ‘close’ function
Modify Component class:
-Modify ‘handleBlur’ to store blurred component

* feat(player): modify ModalDialog
Modify ModalDialog:
-Add condition to close Modal on Backspace

* Refactor SpatialNavigation to use player.spatialNavigation

* Added a new custom event endOfFocusableComponents

* Added new styles for focused elements in case spatial navigation is enabled

* feat(player): modify SpatialNavigation class:
-Add condition so getComponents can get as candidates the UI elements from the playlist-ui

* Changed to window.SpatialNabigation to this.player_.spatialNavigation

* feat(player): modify text-track-settings, created test-track-settings-colors.js, text-track-settings-font.js,text-track-fieldset.js & text-track-select.js:
Modify text-track-settings class:
- Add changes so newly created components can work as content of the modal.
- Create new components as a refactor of  the contents of text-track-settings

* changed handleKeyDown inside component.js, getComponents method is now iterating player.children

* feat(player): create TrackSettingsControls Component & Modify TextTrackSettings
Create TrackSettingsControls Component:
-Create Component to show buttons reset & done as components.
Modify TextTrackSettings:
-Add Component TrackSettingsControls in TextTrackSettings

* feat(player): Modify ModalDialog
Modify ModalDialog:
-Add condition for stop propagation of event inside of ModalDialog when spatialNavigation is enabled

* getIsFocusable and getIsAvailableToBeFocused methods are now accepting el as a parameter, added a new methods findSuitableDOMChild and focus for spatialNavigation class

* feat(player): Modify TextTrackSettings:
Modify TextTrackSettings:
-Remove unrequired methods to create DOM elements since now those are created by Components.

* feat(player): Modify CaptionSettingsMenuItem:
Modify CaptionSettingsMenuItem:
-Add condition to focus component of TextTrackSelect when modal is open

* feat(player): Modify TextTrackSelect & TextTrackFieldset:
Modify TextTrackSelect :
Modify TextTrackFieldset:
-Add comments to certain functions to explain the code

* feat(player): Modify TrackSettingsControls:
Modify TrackSettingsControls:
-Remove unrequired comments & add comments to certain functions to explain the code

* feat(player): Modify SpatialNavigation, Component & ModalDialog:
Modify SpatialNavigation:
Modify Component:
Modify ModalDialog:
-Add & update comments of documentation.

* Handle ENTER keydown in Modals when spatial navigation is enabled

* feat(player): Modify ModalDialog, spatialNavigation, TrackSettingsControls, TextTrackFieldset, TextTrackSelect, TrackSettingsColors, TrackSettingsFont:
Modify ModalDialog:
Modify spatialNavigation:
Modify TrackSettingsControls:
Modify TextTrackFieldset:
Modify TextTrackSelect:
Modify TrackSettingsColors:
Modify TrackSettingsFont:
-Add & update comments of documentation.

* Implement additional RCU controls

* feat(player): Modify Component class:
Modify Component :
-Remove unrequired condition inside of handleFocus method.

* feat(player): Modify ModalDialog & CaptionSettingsMenuItem
Modify ModalDialog:
Modify CaptionSettingsMenuItem:
-Modify spatialNavigation condition to be more specific regarding spatialNavigation implementation.

* feat(player): Modify SpatialNavigation class:
Modify SpatialNavigation :
-Fix bug where ‘enter’ press was not working properly on select component inside of the ‘vjs-text-track-settings’ modal.

* feat(player): Modify SpatialNavigation class:
Modify SpatialNavigation :
-Minor improvements on the loops of certain functions to stop when they have found the element they are looking for.
-Implement minor spacing formatting on switch statement.

* Update src/js/component.js

More understandable documentation.

Co-authored-by: Dzianis Dashkevich <98566601+dzianis-dashkevich@users.noreply.github.com>

* Update src/js/component.js

More understandable documentation.

Co-authored-by: Dzianis Dashkevich <98566601+dzianis-dashkevich@users.noreply.github.com>

* feat(player): Modify SpatialNavigation & Component class:
Modify Component class :
Modify SpatialNavigation class :
-Modify ‘getIsFocusable’ function to use ‘this.el_’ instead of ‘el’ parameter

* feat(player): Modify SpatialNavigation class:
Modify SpatialNavigation class :
-Refactor onKeyDown function to use static data & return when pause is true.

* feat(player): Modify SpatialNavigation class:
Modify SpatialNavigation class :
-Refactor to use ‘.el()’ instead of ‘.el_’

* Update src/js/spatial-navigation.js

Co-authored-by: Walter Seymour <walterseymour15@gmail.com>

* feat(player): Modify ModalDialog class & MenuItem class:
Modify ModalDialog class :
Modify MenuItem class :
-Correct typo of ‘isSpatialNavlistening’ to  ‘isSpatialNavListening’.

* removed unused property, remove this.focus, which was added for testing purposes

* Changed parameters to private, removed redundant code, removed initialFocusedComponent parameter, change STEP_SECONDS to static

* feat(player): solve remaining  conflict:
Modify Spatial Navigation class :
- Solve conflict

* feat(player): Rename TrackSettingsColors & TrackSettingsFont

* feat(player): Remove unrequired functions calls from components TextTrackSettingsColors & TextTrackSettingsFont.

* feat(player):  Update spatial-navigation.js's keypress return keyword.

* bind focus and blur just if spatial navigation is enabled, add 1px gap if spatial navigation is enabled

* feat(player): Modify calls on 'isListening' & 'isPaused' for ModalDialog & TextTrackMenuItem

* feat(player): remove unrequired object on component 'TrackSettingsControls'

* Removed 1px gap

* feat(player): Rename function ‘getComponents’ to ‘updateFocusableComponents’

* Changed SpatialNavigation class to extend EventTarget, removed redundant methods for events

* fix(player): fix call of 'getIsAvailableToBeFocused' that was throwing an error.

* removed Static maps for key presses and extended keycode with the missing keys

* refactor(player): Modify functions of 'getIsDisabled', 'getIsExpresslyInert' & 'getIsFocusable' to be more in pair when stablished code of the player.

* Conditional assignment for keycode.codes.back based on platform, changed Backspace to Back key for Modal closing

* Extend the  object for reverse lookup, prenet Up/down keys to open a menu if spatial navigation is anabled

* refactor(player): Refactor 'SpatialNavKeycodes' file to not patch 'keycode' dependency

* fix(pllayer): fix issue related to 'back' not  being used properly in function 'isEventKey'

* feat(player): Rename imports  of 'spatial-navigation-keycode' to have their extension

* feat(player): Add example of use of 'Client app uses a global spatial-navigation solution'

* feat(player): rename 'spatial-navigation-keycode.js' filename

* Fix on src chnage issue, ESC button closing modal, expand vjs-modal-dialog

* change file name and object name

* fix: Update ids of labels to use 'guid' so unit test works properly

* fix: update localized text in text-track-settings-font & text-track-settings

* Mark some methods as private

* fix: modify content of modal 'text-track-settings' to change language properly

* fix: add missing '.' in jsdoc of text-track components

* feature: add unit test for 'text-track-select' component

* Add test for Spatial Navigation

* test(player): Add minor test related to 'handleBlur' & 'handleFocus'

* feat(player): Remove unrequired files from 'react-video-nav-app'

* test(player): Add small test to check if 'getPositions' returns required properties

* test(player): add test to verify 'getPositions()' properties are not empty

* Add missing tests for performMediaAction_ and move

* test(player): add test to for 'component.js' related to 'handleBlur'

* test(player): add minor test in component related to test keypress propagation event

* test(player): add test for component related to 'getIsAvailableToBeFocused' function

* test(player): add test for Modal Dialog related to call function of spatial navigation

* test(player): add tests  for 'spatial-navigation-key-codes'

* test(player): add tests for keycodes related to 'should return event name if keyCode is not available'

* test(player): add minor test for case when not required parametters are passed

* test(player): add test for 'caption-settings-menu-item'

* feat(player): remove 'react-video-nav-app'

* Move handleFocus and handleBlur from components.js to spatial-navigation.js

* refactor(player): refactor 'searchForTrackSelect' to be handled in the spatial navigation

* remove unrequired code in function 'searchForTrackSelect'

* update documentation comment to be in pair to its current use

* remove spatial navigation keydown from modal dialog and move it to spatial navigation class, modify the modal-dialog test accordingly

* remove useless tests

* Remove caption-settings-menu-item.test.js

* Add minor test to 'searchForTrackSelect' in spatial-navigation.test.js

* Add unit test for back key and listening to events

---------

Co-authored-by: CarlosVillasenor <carlosdeveloper9@gmail.com>
Co-authored-by: Dzianis Dashkevich <98566601+dzianis-dashkevich@users.noreply.github.com>
Co-authored-by: Walter Seymour <walterseymour15@gmail.com>
Co-authored-by: Carlos Villasenor Castillo <cvillasenor@Carloss-MacBook-Pro.local>
2024-04-17 19:34:52 -06:00
Adam Waldron
582c35f96b 8.12.0 2024-04-16 09:00:40 -07:00
Adam Waldron
12310ed997
chore: update VHS to v3.12.1 (#8687) 2024-04-16 08:55:26 -07:00
Gary Katsevman
d715e0fe03
feat(emulated-tracks): add class to force cues to be center aligned (#8625)
https://github.com/videojs/http-streaming/pull/1408 updated 608 captions to default to be left aligned. This may be unwanted by some folks and we should provide an easier way to force them to be centered.
This PR adds a player level class that will override the text alignment to be `center`. It also overrides the `width` to `80%` because otherwise the cue box isn't set up correctly to be 10% from the right of the display area (a side effect of hardcoding a width value and using inset in the generation of the cues).
2024-04-12 20:45:50 +02:00
mister-ben
3f32de30ca
fix(build): Use quoted dbl quotes to support Windows (#8681) 2024-04-12 18:54:17 +02:00
mister-ben
af06f50d09
chore: update GitHub Actions version and remove xvfb (#8682)
* uncovered change to a file

* update codecov action

* revert temp test change

* bump other action versions

* remove xvfb action
2024-04-12 18:06:35 +02:00
Si
ee07382f91
feat(lang): added arabic seek button translations (#8616)
* feat(lang): added arabic seek button translations

* added localization support to skipButtons controlText
2024-04-12 02:39:44 -04:00
SImonAllen
4ccedc1527
chore: Remove unused type.js file (#8658) 2024-04-12 02:19:38 -04:00
Fabio Bonelli
4a17426484
fix(i18n): better Italian translation for "captions" (#8513)
"Didascalie" is the better translation for "captions" in Italian

See also: https://www.w3.org/Translations/WCAG22-it/#h-note-76
2024-04-12 02:10:54 -04:00
Rajnikant Phadake
80429fae71
feat(lang): Add support for Marathi Language (#8596)
* Support for Marathi Language added

Support for indian lanuage marathi is added for multilingual support

* Comments Resolved for suggestions

---------

Co-authored-by: Rajnikant Phadake <bzwizapp@gmail.com>
2024-04-12 01:55:17 -04:00
Pat O'Neill
8e5870f984
feat: add browser.IS_SMART_TV and class names for CSS targeting devices (#8676) 2024-04-10 10:07:31 -04:00
Harisha Rajam Swaminathan
50f14bd66d
fix: time tooltip truncated (#8527) 2024-04-10 18:51:39 +05:30
Adam Waldron
caf6d30c36
fix: add additional and remove unused error const (#8656) 2024-03-25 11:15:33 -07:00
wseymour15
2f1cc6c2b3 8.11.8 2024-03-12 14:32:18 -05:00
Walter Seymour
66b74ebd57
chore: update VHS to v3.12.0 (#8637) 2024-03-12 14:29:29 -05:00
Adam Waldron
42fe1e61ba
chore: add contrib-eme errors (#8634) 2024-03-12 12:10:34 -07:00
Dzianis Dashkevich
9977a937c6 8.11.7 2024-03-06 15:13:44 -05:00
Dzianis Dashkevich
d113ce5328
chore(package): update quality-levels version (#8630)
Co-authored-by: Dzianis Dashkevich <ddashkevich@brightcove.com>
2024-03-06 15:04:39 -05:00
Walter Seymour
b59a89b1ce
fix: typo in error const (#8628) 2024-03-04 16:17:25 -06:00
wseymour15
26265d7d17 8.11.6 2024-03-04 13:36:38 -06:00
Walter Seymour
7ed47de29d
chore: additional vjs ad errors (#8623) 2024-03-04 13:23:12 -06:00
mister-ben
04d10ef3dd
chore: Add action to validate PR titles (#8614) 2024-03-04 17:54:33 +01:00
Dzianis Dashkevich
d7757d880e 8.11.5 2024-02-28 13:59:06 -05:00
Dzianis Dashkevich
1f76abd7cd
chore: update vhs version (#8621)
Co-authored-by: Dzianis Dashkevich <ddashkevich@brightcove.com>
2024-02-28 13:54:31 -05:00
Dzianis Dashkevich
a57b07a418 8.11.4 2024-02-21 11:16:53 -05:00
Dzianis Dashkevich
ac2eb84539
chore: update vhs to 3.11.2 (#8603)
Co-authored-by: Dzianis Dashkevich <ddashkevich@brightcove.com>
2024-02-21 11:16:21 -05:00
wseymour15
b0d84ee1c5 8.11.3 2024-02-20 13:09:15 -06:00
Walter Seymour
4c1f63b711
chore: update pip enter event with window metadata (#8591) 2024-02-20 11:11:00 -06:00
Walter Seymour
395d608761
chore: update playbackRates jsdoc (#8583) 2024-02-13 11:35:36 -05:00
Alex Barstow
54e3a0614b 8.11.2 2024-02-13 11:19:05 -05:00
Alex Barstow
7f7e2a3662
chore: update http-streaming to v3.11.1 (#8584) 2024-02-13 10:59:01 -05:00
Harisha Rajam Swaminathan
6eb0230078
fix: error-display (#8529) 2024-01-30 11:32:58 -05:00
Adam Waldron
c964bec3f5 8.11.1 2024-01-29 12:16:48 -08:00
Adam Waldron
14b5fde524
fix: browser util flagging smart TV as Safari (#8566) 2024-01-26 09:46:53 -08:00
wseymour15
edb6daf642 8.11.0 2024-01-25 08:59:58 -06:00
Walter Seymour
43941a801f
feat: improved error interface (#8564) 2024-01-25 08:57:16 -06:00
Sarah Rimron-Soutter
6fe68e5dad 8.10.0 2024-01-17 12:42:34 +00:00
Essk
eebcc07dac
chore: update to http-streaming v3.10.0 (#8558) 2024-01-17 12:40:55 +00:00
mister-ben
46c9907a9b
fix: Fixes form markup in text track settings (#8557) 2024-01-16 17:43:39 +01:00
Carlos Javier Villaseñor Castillo
7345768575
feat(error): remove confusing decorative X from error display modal (#8553)
Modify _error:
-Remove the ‘x’ decorative element from the error display modal.
2024-01-10 14:32:27 -06:00
Peter Petraník
abdfaacd90
feat: expose version from player.version() (#8543)
Add a `Player#version()` method which returns an object with the Video.js version under the `video.js` property name, to match the package name.

This could then be extended to support adding plugin, tech, and source handler versions as part of the version call.

Fixes #8538
2024-01-04 09:35:23 -05:00
Dzianis Dashkevich
09c9bfba05 8.9.0 2024-01-02 13:25:50 -05:00
Dzianis Dashkevich
17506b1316
chore: update vhs to 3.9.1 (#8539)
Co-authored-by: Dzianis Dashkevich <ddashkevich@brightcove.com>
2024-01-02 13:24:27 -05:00
André
608a585dcb
feat: Seek bar smooth seeking (#8287)
* refactor(player): decrease the indentation level in the currentTime method

* fix(player): cache_.currentTime is not updated when the current time is set

Updating cache_.currentTime as soon as the currentTime is set avoids having to wait for the timeupdate event, which results in:

- making cache_.currentTime more reliable
- updating the progress bar on mouse up after dragging when the media is paused.

See also: #6232, #6234, #6370, #6372

* feat: add an option to handle smooth seeking

Adds a player option called enableSmoothSeeking, which is false by default,
to provide a smoother seeking experience on mobile and desktop devices.

Usage:
```javascript
// Enables the smooth seeking
const player = videojs('player', {enableSmoothSeeking: true});

// Disable the smooth seeking
player.options({enableSmoothSeeking: false});
```

- **player.js** add an `option` called `enableSmoothSeeking`
- **time-display.js** add a listener to the `seeking` event if `enableSmoothSeeking` is `true` allowing to update the `CurrentTimeDisplay` and `RemainingTimeDisplay` in real time
- **seek-bar.js** `update` the seek bar on `mousemove` event  if `enableSmoothSeeking` is `true`
- add test cases
2024-01-02 13:11:55 -05:00
Tsachi Shlidor
af0fca3623
fix(skip-forward): a11y (#8532) 2023-12-21 17:12:59 +01:00
Adam Waldron
d2dc5b9056 8.8.0 2023-12-14 14:05:24 -08:00
Adam Waldron
fe7cf98745
feat: update VHS to v3.9.0 (#8526) 2023-12-14 13:59:38 -08:00
Dzianis Dashkevich
1fff5c0698
chore: update player public interface for types visibility (#8525)
Co-authored-by: Dzianis Dashkevich <ddashkevich@brightcove.com>
2023-12-14 13:07:17 -05:00
Dzianis Dashkevich
6a5e1ee4fe 8.7.0 2023-12-04 14:31:37 -05:00