aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSam Potts <me@sampotts.me>2016-07-23 11:11:17 +1000
committerSam Potts <me@sampotts.me>2016-07-23 11:11:17 +1000
commitd7cc29f2fbc046f8b78a558df9c5504f8e608326 (patch)
treef1f27b19c28b5ca404fdb82efde5da57ebdaf7c8 /src
parent0505e49038f76b353e78489ebb28b6cdf40f9a3e (diff)
downloadplyr-d7cc29f2fbc046f8b78a558df9c5504f8e608326.tar.lz
plyr-d7cc29f2fbc046f8b78a558df9c5504f8e608326.tar.xz
plyr-d7cc29f2fbc046f8b78a558df9c5504f8e608326.zip
Vimeo keyboard focus fix (Fixes #317), Fix for Vimeo on basic support devices
Diffstat (limited to 'src')
-rw-r--r--src/js/plyr.js28
1 files changed, 21 insertions, 7 deletions
diff --git a/src/js/plyr.js b/src/js/plyr.js
index 9cab9e09..c176f59b 100644
--- a/src/js/plyr.js
+++ b/src/js/plyr.js
@@ -1,6 +1,6 @@
// ==========================================================================
// Plyr
-// plyr.js v1.8.11
+// plyr.js v1.8.12
// https://github.com/selz/plyr
// License: The MIT License (MIT)
// ==========================================================================
@@ -43,7 +43,7 @@
displayDuration: true,
loadSprite: true,
iconPrefix: 'plyr',
- iconUrl: 'https://cdn.plyr.io/1.8.11/plyr.svg',
+ iconUrl: 'https://cdn.plyr.io/1.8.12/plyr.svg',
clickToPlay: true,
hideControls: true,
showPosterOnEnd: false,
@@ -1494,8 +1494,13 @@
}
// Vimeo
else if (plyr.type === 'vimeo') {
- // Create the YouTube container
- plyr.media.appendChild(container);
+ // Vimeo needs an extra div to hide controls on desktop (which has full support)
+ if (plyr.supported.full) {
+ plyr.media.appendChild(container);
+ }
+ else {
+ container = plyr.media;
+ }
// Set ID
container.setAttribute('id', id);
@@ -1517,6 +1522,7 @@
}
}
// Soundcloud
+ // TODO: Currently unsupported and undocumented
else if (plyr.type === 'soundcloud') {
// Inject the iframe
var soundCloud = document.createElement('iframe');
@@ -1744,10 +1750,18 @@
_displayDuration();
});
- // Captions
- if (config.captions.defaultActive) {
+ // TODO: Captions
+ /*if (config.captions.defaultActive) {
plyr.embed.enableTextTrack('en');
- }
+ }*/
+
+ // Fix keyboard focus issues
+ // https://github.com/Selz/plyr/issues/317
+ plyr.embed.on('loaded', function() {
+ if(_is.htmlElement(plyr.embed.element)) {
+ plyr.embed.element.setAttribute('tabindex', '-1');
+ }
+ });
plyr.embed.on('play', function() {
plyr.media.paused = false;