Skip to content

Commit

Permalink
Merge branch 'master' of github.com:videojs/video.js into pip-button
Browse files Browse the repository at this point in the history
  • Loading branch information
beaufortfrancois committed Jun 12, 2019
2 parents 14d27fe + 74fde94 commit 3aaaa20
Show file tree
Hide file tree
Showing 27 changed files with 3,273 additions and 3,137 deletions.
3 changes: 2 additions & 1 deletion .github/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ daysUntilClose: 7
exemptLabels:
- pinned
- a11y
- "Affects: a11y"
- confirmed
- security
- "[Status] Maybe Later"
Expand All @@ -22,7 +23,7 @@ exemptProjects: false
exemptMilestones: false

# Label to use when marking as stale
staleLabel: wontfix
staleLabel: outdated

# Comment to post when marking as stale. Set to `false` to disable
markComment: >
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
<a name="7.5.5"></a>
## [7.5.5](https://github.com/videojs/video.js/compare/v7.5.4...v7.5.5) (2019-05-30)

### Bug Fixes

* **fs:** feature detect el.matches() for IE11 ([#6007](https://github.com/videojs/video.js/issues/6007)) ([9954470](https://github.com/videojs/video.js/commit/9954470))
* group subtitles and captions when switching tracks ([#6008](https://github.com/videojs/video.js/issues/6008)) ([cd6be5b](https://github.com/videojs/video.js/commit/cd6be5b)), closes [#5741](https://github.com/videojs/video.js/issues/5741)
* **fs:** fix isFullscreen check for spec-api ([#6009](https://github.com/videojs/video.js/issues/6009)) ([47d60ae](https://github.com/videojs/video.js/commit/47d60ae)), closes [#5814](https://github.com/videojs/video.js/issues/5814)
* make sure hotkeys are not triggered outside the player or in form fields within the player ([#5969](https://github.com/videojs/video.js/issues/5969)) ([d251e97](https://github.com/videojs/video.js/commit/d251e97))

<a name="7.5.4"></a>
## [7.5.4](https://github.com/videojs/video.js/compare/v7.5.3...v7.5.4) (2019-04-12)

Expand Down
5,325 changes: 2,493 additions & 2,832 deletions package-lock.json

Large diffs are not rendered by default.

84 changes: 42 additions & 42 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "video.js",
"description": "An HTML5 and Flash video player with a common API and skin for both.",
"version": "7.5.4",
"version": "7.5.5",
"main": "./dist/video.cjs.js",
"module": "./dist/video.es.js",
"style": "./dist/video-js.css",
Expand Down Expand Up @@ -79,84 +79,84 @@
"url": "https://github.com/videojs/video.js.git"
},
"dependencies": {
"@babel/runtime": "^7.2.0",
"@videojs/http-streaming": "1.10.2",
"@babel/runtime": "^7.4.5",
"@videojs/http-streaming": "1.10.3",
"global": "4.3.2",
"keycode": "^2.2.0",
"safe-json-parse": "4.0.0",
"tsml": "1.0.1",
"videojs-font": "3.2.0",
"videojs-vtt.js": "0.14.1",
"videojs-vtt.js": "^0.14.1",
"xhr": "2.4.0"
},
"devDependencies": {
"@babel/cli": "^7.2.0",
"@babel/core": "^7.2.2",
"@babel/node": "^7.2.2",
"@babel/plugin-transform-runtime": "^7.2.0",
"@babel/preset-env": "^7.2.0",
"@babel/register": "^7.0.0",
"@babel/cli": "^7.4.4",
"@babel/core": "^7.4.5",
"@babel/node": "^7.4.5",
"@babel/plugin-transform-runtime": "^7.4.4",
"@babel/preset-env": "^7.4.5",
"@babel/register": "^7.4.4",
"access-sniff": "^3.2.0",
"autoprefixer": "^9.4.2",
"autoprefixer": "^9.6.0",
"babelify": "^10.0.0",
"bestzip": "^2.1.2",
"bluebird": "^3.5.3",
"bestzip": "^2.1.4",
"bluebird": "^3.5.5",
"browserify": "^16.2.3",
"browserify-istanbul": "^3.0.1",
"chokidar-cli": "^1.2.1",
"clean-css-cli": "^4.2.1",
"chokidar-cli": "^1.2.2",
"clean-css-cli": "^4.3.0",
"cli-table": "^0.3.1",
"conventional-changelog-cli": "^2.0.11",
"conventional-changelog-cli": "^2.0.21",
"conventional-changelog-videojs": "^3.0.0",
"cross-env": "^5.2.0",
"es5-shim": "^4.5.12",
"es6-shim": "^0.35.4",
"filesize": "^4.0.0",
"gh-release": "^3.4.0",
"humanize-duration": "^3.16.0",
"es5-shim": "^4.5.13",
"es6-shim": "^0.35.5",
"filesize": "^4.1.2",
"gh-release": "^3.5.0",
"humanize-duration": "^3.18.0",
"husky": "^1.2.0",
"jsdoc": "^3.5.5",
"karma": "^4.0.0",
"jsdoc": "^3.6.2",
"karma": "^4.1.0",
"karma-browserify": "^5.3.0",
"klaw-sync": "^6.0.0",
"lint-staged": "^8.1.0",
"markdown-table": "^1.1.2",
"lint-staged": "^8.2.0",
"markdown-table": "^1.1.3",
"maxmin": "^2.1.0",
"minimist": "^1.2.0",
"node-sass": "^4.10.0",
"node-sass": "^4.12.0",
"npm-merge-driver-install": "^1.1.1",
"npm-run-all": "^4.1.5",
"patch-package": "^6.0.2",
"postcss-cli": "^6.0.1",
"patch-package": "^6.1.2",
"postcss-cli": "^6.1.2",
"proxyquireify": "^3.2.1",
"qunit": "~2.9.1",
"qunit": "^2.9.2",
"remark-cli": "^6.0.1",
"remark-lint": "^6.0.4",
"remark-parse": "^6.0.3",
"remark-stringify": "^6.0.4",
"remark-toc": "^5.1.1",
"remark-validate-links": "^8.0.0",
"replace": "^1.0.0",
"rollup": "^1.0.1",
"rollup-plugin-alias": "^1.4.0",
"remark-validate-links": "^8.0.2",
"replace": "^1.1.0",
"rollup": "^1.15.1",
"rollup-plugin-alias": "^1.5.2",
"rollup-plugin-babel": "^4.0.3",
"rollup-plugin-commonjs": "^9.2.0",
"rollup-plugin-ignore": "^1.0.4",
"rollup-plugin-commonjs": "^9.3.4",
"rollup-plugin-ignore": "^1.0.5",
"rollup-plugin-json": "^3.1.0",
"rollup-plugin-node-resolve": "^4.0.0",
"rollup-plugin-progress": "^1.0.0",
"semver": "^5.6.0",
"rollup-plugin-node-resolve": "^4.2.4",
"rollup-plugin-progress": "^1.1.1",
"semver": "^5.7.0",
"shelljs": "^0.8.3",
"shx": "^0.3.2",
"sinon": "^7.3.2",
"tui-jsdoc-template": "^1.2.2",
"uglify-js": "^3.4.9",
"uglify-js": "^3.6.0",
"unified": "^7.0.2",
"videojs-flash": "^2.1.2",
"videojs-flash": "^2.2.0",
"videojs-generate-karma-config": "~5.2.0",
"videojs-languages": "^2.0.0",
"videojs-standard": "^8.0.2",
"watchify": "^3.11.0",
"videojs-standard": "^8.0.3",
"watchify": "^3.11.1",
"webpack": "^1.15.0"
},
"vjsstandard": {
Expand Down
9 changes: 4 additions & 5 deletions src/js/big-play-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,15 @@ class BigPlayButton extends Button {
// exit early if clicked via the mouse
if (this.mouseused_ && event.clientX && event.clientY) {
silencePromise(playPromise);
// call handleFocus manually to get hotkeys working
this.player_.handleFocus({});
this.player_.tech(true).focus();
return;
}

const cb = this.player_.getChild('controlBar');
const playToggle = cb && cb.getChild('playToggle');

if (!playToggle) {
this.player_.focus();
this.player_.tech(true).focus();
return;
}

Expand All @@ -69,10 +68,10 @@ class BigPlayButton extends Button {
}
}

handleKeyPress(event) {
handleKeyDown(event) {
this.mouseused_ = false;

super.handleKeyPress(event);
super.handleKeyDown(event);
}

handleMouseDown(event) {
Expand Down
19 changes: 13 additions & 6 deletions src/js/button.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,20 @@ class Button extends ClickableComponent {
*
* @listens keydown
*/
handleKeyPress(event) {
// Ignore Space or Enter key operation, which is handled by the browser for a button.
if (!(keycode.isEventKey(event, 'Space') || keycode.isEventKey(event, 'Enter'))) {

// Pass keypress handling up for unsupported keys
super.handleKeyPress(event);
handleKeyDown(event) {

// Ignore Space or Enter key operation, which is handled by the browser for
// a button - though not for its super class, ClickableComponent. Also,
// prevent the event from propagating through the DOM and triggering Player
// hotkeys. We do not preventDefault here because we _want_ the browser to
// handle it.
if (keycode.isEventKey(event, 'Space') || keycode.isEventKey(event, 'Enter')) {
event.stopPropagation();
return;
}

// Pass keypress handling up for unsupported keys
super.handleKeyDown(event);
}
}

Expand Down
81 changes: 22 additions & 59 deletions src/js/clickable-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,13 @@
*/
import Component from './component';
import * as Dom from './utils/dom.js';
import * as Events from './utils/events.js';
import * as Fn from './utils/fn.js';
import log from './utils/log.js';
import document from 'global/document';
import {assign} from './utils/obj';
import keycode from 'keycode';

/**
* Clickable Component which is clickable or keyboard actionable,
* but is not a native HTML button.
* Component which is clickable or keyboard actionable, but is not a
* native HTML button.
*
* @extends Component
*/
Expand All @@ -36,7 +33,7 @@ class ClickableComponent extends Component {
}

/**
* Create the `Component`s DOM element.
* Create the `ClickableComponent`s DOM element.
*
* @param {string} [tag=div]
* The element's node type.
Expand Down Expand Up @@ -83,7 +80,7 @@ class ClickableComponent extends Component {
}

/**
* Create a control text element on this `Component`
* Create a control text element on this `ClickableComponent`
*
* @param {Element} [el]
* Parent element for the control text.
Expand All @@ -109,7 +106,7 @@ class ClickableComponent extends Component {
}

/**
* Get or set the localize text to use for the controls on the `Component`.
* Get or set the localize text to use for the controls on the `ClickableComponent`.
*
* @param {string} [text]
* Control text for element.
Expand Down Expand Up @@ -146,7 +143,7 @@ class ClickableComponent extends Component {
}

/**
* Enable this `Component`s element.
* Enable this `ClickableComponent`
*/
enable() {
if (!this.enabled_) {
Expand All @@ -157,13 +154,12 @@ class ClickableComponent extends Component {
this.el_.setAttribute('tabIndex', this.tabIndex_);
}
this.on(['tap', 'click'], this.handleClick);
this.on('focus', this.handleFocus);
this.on('blur', this.handleBlur);
this.on('keydown', this.handleKeyDown);
}
}

/**
* Disable this `Component`s element.
* Disable this `ClickableComponent`
*/
disable() {
this.enabled_ = false;
Expand All @@ -173,27 +169,15 @@ class ClickableComponent extends Component {
this.el_.removeAttribute('tabIndex');
}
this.off(['tap', 'click'], this.handleClick);
this.off('focus', this.handleFocus);
this.off('blur', this.handleBlur);
this.off('keydown', this.handleKeyDown);
}

/**
* This gets called when a `ClickableComponent` gets:
* - Clicked (via the `click` event, listening starts in the constructor)
* - Tapped (via the `tap` event, listening starts in the constructor)
* - The following things happen in order:
* 1. {@link ClickableComponent#handleFocus} is called via a `focus` event on the
* `ClickableComponent`.
* 2. {@link ClickableComponent#handleFocus} adds a listener for `keydown` on using
* {@link ClickableComponent#handleKeyPress}.
* 3. `ClickableComponent` has not had a `blur` event (`blur` means that focus was lost). The user presses
* the space or enter key.
* 4. {@link ClickableComponent#handleKeyPress} calls this function with the `keydown`
* event as a parameter.
* Event handler that is called when a `ClickableComponent` receives a
* `click` or `tap` event.
*
* @param {EventTarget~Event} event
* The `keydown`, `tap`, or `click` event that caused this function to be
* called.
* The `tap` or `click` event that caused this function to be called.
*
* @listens tap
* @listens click
Expand All @@ -202,52 +186,31 @@ class ClickableComponent extends Component {
handleClick(event) {}

/**
* This gets called when a `ClickableComponent` gains focus via a `focus` event.
* Turns on listening for `keydown` events. When they happen it
* calls `this.handleKeyPress`.
* Event handler that is called when a `ClickableComponent` receives a
* `keydown` event.
*
* @param {EventTarget~Event} event
* The `focus` event that caused this function to be called.
*
* @listens focus
*/
handleFocus(event) {
Events.on(document, 'keydown', Fn.bind(this, this.handleKeyPress));
}

/**
* Called when this ClickableComponent has focus and a key gets pressed down. By
* default it will call `this.handleClick` when the key is space or enter.
* By default, if the key is Space or Enter, it will trigger a `click` event.
*
* @param {EventTarget~Event} event
* The `keydown` event that caused this function to be called.
*
* @listens keydown
*/
handleKeyPress(event) {
// Support Space or Enter key operation to fire a click event
handleKeyDown(event) {

// Support Space or Enter key operation to fire a click event. Also,
// prevent the event from propagating through the DOM and triggering
// Player hotkeys.
if (keycode.isEventKey(event, 'Space') || keycode.isEventKey(event, 'Enter')) {
event.preventDefault();
event.stopPropagation();
this.trigger('click');
} else {

// Pass keypress handling up for unsupported keys
super.handleKeyPress(event);
super.handleKeyDown(event);
}
}

/**
* Called when a `ClickableComponent` loses focus. Turns off the listener for
* `keydown` events. Which Stops `this.handleKeyPress` from getting called.
*
* @param {EventTarget~Event} event
* The `blur` event that caused this function to be called.
*
* @listens blur
*/
handleBlur(event) {
Events.off(document, 'keydown', Fn.bind(this, this.handleKeyPress));
}
}

Component.registerComponent('ClickableComponent', ClickableComponent);
Expand Down
Loading

0 comments on commit 3aaaa20

Please sign in to comment.