Skip to content

Commit

Permalink
Global keyboard shortcut changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Potts committed Aug 22, 2016
1 parent df7f52d commit 12e9477
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 12 deletions.
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

# v2.0.3
- Set 'global' keyboard shortcut option to false as default, added `<textarea>` to editable elements to be ignored.

# v2.0.2
- Added 'global' keyboard shortcut option

Expand Down
2 changes: 1 addition & 1 deletion dist/plyr.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "plyr",
"version": "2.0.2",
"version": "2.0.3",
"description": "A simple, accessible and customizable HTML5, YouTube and Vimeo media player",
"homepage": "http://plyr.io",
"main": "src/js/plyr.js",
Expand Down
12 changes: 6 additions & 6 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ Include the `plyr.js` script before the closing `</body>` tag and then call `ply
If you want to use our CDN for the JavaScript, you can use the following:

```html
<script src="https://cdn.plyr.io/2.0.2/plyr.js"></script>
<script src="https://cdn.plyr.io/2.0.3/plyr.js"></script>
```

### CSS
Expand All @@ -135,11 +135,11 @@ Include the `plyr.css` stylsheet into your `<head>`
If you want to use our CDN for the default CSS, you can use the following:

```html
<link rel="stylesheet" href="https://cdn.plyr.io/2.0.2/plyr.css">
<link rel="stylesheet" href="https://cdn.plyr.io/2.0.3/plyr.css">
```

### SVG Sprite
The SVG sprite is loaded automatically from our CDN. To change this, see the [options](#Options) below. For reference, the CDN hosted SVG sprite can be found at `https://cdn.plyr.io/2.0.2/plyr.svg`.
The SVG sprite is loaded automatically from our CDN. To change this, see the [options](#Options) below. For reference, the CDN hosted SVG sprite can be found at `https://cdn.plyr.io/2.0.3/plyr.svg`.

## Advanced

Expand Down Expand Up @@ -322,8 +322,8 @@ Note the single quotes encapsulating the JSON and double quotes on the object ke
<tr>
<td><code>keyboardShortcuts</code></td>
<td>Object</td>
<td><code>{ focused: true, global: true }</code></td>
<td>Enable <a href="#shortcuts">keyboard shortcuts</a> for focused players only or global as well (if there's only one player in the document)</td>
<td><code>{ focused: true, global: false }</code></td>
<td>Enable <a href="#shortcuts">keyboard shortcuts</a> for focused players only or globally as well (this will only work if there's one player in the document)</td>
</tr>
<tr>
<td><code>tooltips</code></td>
Expand Down Expand Up @@ -873,7 +873,7 @@ More info on the respective API's here:
*Please note*: not all API methods may work 100%. Your mileage may vary. It's better to use the universal plyr API where possible.

## Shortcuts
By default, a player will bind the following keyboard shortcuts when it has focus. If you have the `global` option to `true` and there's only one player in the document then the shortcuts will work when any element has focus, apart from an element that requires input (such as an `<input>`, `<select>` or `[contenteditable]`).
By default, a player will bind the following keyboard shortcuts when it has focus. If you have the `global` option to `true` and there's only one player in the document then the shortcuts will work when any element has focus, apart from an element that requires input.

<table class="table" width="100%">
<thead>
Expand Down
8 changes: 4 additions & 4 deletions src/js/plyr.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// ==========================================================================
// Plyr
// plyr.js v2.0.2
// plyr.js v2.0.3
// https://github.com/selz/plyr
// License: The MIT License (MIT)
// ==========================================================================
Expand Down Expand Up @@ -43,14 +43,14 @@
displayDuration: true,
loadSprite: true,
iconPrefix: 'plyr',
iconUrl: 'https://cdn.plyr.io/2.0.2/plyr.svg',
iconUrl: 'https://cdn.plyr.io/2.0.3/plyr.svg',
clickToPlay: true,
hideControls: true,
showPosterOnEnd: false,
disableContextMenu: true,
keyboardShorcuts: {
focused: true,
global: true
global: false
},
tooltips: {
controls: false,
Expand All @@ -59,7 +59,7 @@
selectors: {
html5: 'video, audio',
embed: '[data-type]',
editable: 'input, select, [contenteditable]',
editable: 'input, textarea, select, [contenteditable]',
container: '.plyr',
controls: {
container: null,
Expand Down

0 comments on commit 12e9477

Please sign in to comment.