Compare commits

...

3 Commits

Author SHA1 Message Date
Sam
6694c1e6cf Fix for Firefox full screen (fixes #343) 2016-08-23 00:34:43 +10:00
19ca906e50 Update changelog.md 2016-08-22 20:41:49 +10:00
12e94775d6 Global keyboard shortcut changes 2016-08-22 14:44:18 +10:00
7 changed files with 26 additions and 18 deletions

View File

@ -1,9 +1,15 @@
# Changelog
# v2.0.2
## v2.0.4
- Fix for Firefox full screen (fixes #343)
## 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
# v2.0.1
## v2.0.1
- Version bump for NPM
# v2.0.0

2
demo/dist/demo.css vendored

File diff suppressed because one or more lines are too long

2
dist/plyr.css vendored

File diff suppressed because one or more lines are too long

4
dist/plyr.js vendored

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{
"name": "plyr",
"version": "2.0.2",
"version": "2.0.4",
"description": "A simple, accessible and customizable HTML5, YouTube and Vimeo media player",
"homepage": "http://plyr.io",
"main": "src/js/plyr.js",

View File

@ -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.4/plyr.js"></script>
```
### CSS
@ -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.4/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.4/plyr.svg`.
## Advanced
@ -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>
@ -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>

View File

@ -1,6 +1,6 @@
// ==========================================================================
// Plyr
// plyr.js v2.0.2
// plyr.js v2.0.4
// https://github.com/selz/plyr
// License: The MIT License (MIT)
// ==========================================================================
@ -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.4/plyr.svg',
clickToPlay: true,
hideControls: true,
showPosterOnEnd: false,
disableContextMenu: true,
keyboardShorcuts: {
focused: true,
global: true
global: false
},
tooltips: {
controls: false,
@ -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,
@ -620,7 +620,7 @@
element: null,
prefix: ''
},
browserPrefixes = 'webkit o ms khtml'.split(' ');
browserPrefixes = 'webkit o moz ms khtml'.split(' ');
// Check for native support
if (!_is.undefined(document.cancelFullScreen)) {
@ -657,6 +657,8 @@
switch (this.prefix) {
case '':
return document.fullscreenElement === element;
case 'moz':
return document.mozFullScreenElement === element;
default:
return document[this.prefix + 'FullscreenElement'] === element;
}