aboutsummaryrefslogtreecommitdiffstats
path: root/src/js/utils/elements.js
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'develop' into css-variablesSam Potts2020-04-241-0/+20
|\ | | | | | | | | | | | | | | | | # Conflicts: # src/js/captions.js # src/js/config/defaults.js # src/js/fullscreen.js # src/js/listeners.js # src/js/plyr.js
| * This is a PR to allow for contextual content to be included in fullscreen ↵Som Meaden2020-04-041-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (or fallback) mode. This means arbitrary elements (extensions to the basic player UI) can be overlaid and remain visible when the player switches to fullscreen. Example use-cases include: - display of video title or other metadata (see the included demo) - alternative access to menu items, such as a searchable captions list (in cases where many hundreds of languages are available) - custom share dialogs - integrated playlists with 'playing next' overlays This approach / PR is just an example of how this feature could work and aims to keep Plyr complexity to a minimum (while enabling some fairly interesting integrations). It utilises a single config option, and does away with the need for injecting bespoke APIs or elements into the player context on a per-project basis. Or trying to mess with what is a pretty slick, but tightly coupled system. For the user: A new `fullscreen.container` attribute is used to provide a container selector. The container must be an ancestor of the player, otherwise it's ignored. When toggling fullscreen mode, this container is now used in place of the player. Hovering over any children of the container is the same as hovering over the controls. The exception is where the player and the child share a common ancestor (that's not the fullscreen container) ... sounds complex but it's not. You can also gain pretty fine control this way with pointer events. Under the hood: it adds a `utils/elements/closest` helper method to find the right ancestor. If found this is returned as the fullscreen target in place of the player container. Fullscreen is instantiated slightly earlier in the setup so this container is available for the `listeners.controls` call. In here we add some more 'mouseenter/mouseleave' listeners to any direct descendants of the container, that aren't also ancestors of the player. And that's it. No extra classes, nothing else. There are some style changes to the demo (top margin on the player) but these would be project specific. Thanks for reading.
* | Converted to 2 space indentationSam Potts2020-04-111-168/+168
| |
* | Formatting fixesSam Potts2020-03-301-1/+1
|/
* Merge branch 'develop' of github.com:sampotts/plyr into developSam Potts2020-03-291-1/+1
|\ | | | | | | | | | | # Conflicts: # package.json # yarn.lock
| * Fix prototype used for selector matcher functionJesper2020-03-101-1/+1
|/
* Focus trap improvementsSam Potts2020-02-091-35/+0
|
* Bail out of focus trap if fullscreen is not activeKimberley Jensen2020-02-071-1/+2
| | | | - detailed in https://github.com/sampotts/plyr/issues/1665
* Aspect ratio tweaksSam Potts2019-06-031-5/+2
|
* Linting changesSam Potts2019-06-011-5/+2
|
* Fix merging classSam Potts2019-04-251-7/+8
|
* Prevent scroll on focusSam Potts2018-11-031-1/+1
|
* Fix issue where enter key wasn’t setting focus correctlySam Potts2018-08-051-18/+4
|
* Keyboard and focus improvementsSam Potts2018-07-151-18/+23
|
* Work on key bindings for menuSam Potts2018-06-281-0/+15
|
* Work on controlsSam Potts2018-06-181-1/+12
|
* Merge branch 'develop' into a11y-improvementsSam Potts2018-06-171-22/+0
| | | | | | | | | | | | | | | | | # Conflicts: # dist/plyr.js # dist/plyr.js.map # dist/plyr.min.js # dist/plyr.min.js.map # dist/plyr.polyfilled.js # dist/plyr.polyfilled.js.map # dist/plyr.polyfilled.min.js # dist/plyr.polyfilled.min.js.map # src/js/controls.js # src/js/fullscreen.js # src/js/plyr.js # src/js/ui.js # src/js/utils.js
* 120 line width, package upgradeSam Potts2018-06-171-1/+6
|
* Filter out null / undefined in elements.setAttributesAlbin Larsson2018-06-151-3/+5
|
* Remove line breaks in arraysAlbin Larsson2018-06-131-4/+1
|
* Use toggleListener in trapFocusAlbin Larsson2018-06-121-6/+2
|
* Utils broken down into seperate files and exportsSam Potts2018-06-131-0/+307