aboutsummaryrefslogtreecommitdiffstats
path: root/src/js/plyr.js
diff options
context:
space:
mode:
authorSam Potts <me@sampotts.me>2017-11-05 23:09:33 +1100
committerSam Potts <me@sampotts.me>2017-11-05 23:09:33 +1100
commit45df3198237644610aa140bbb12d676324157cb6 (patch)
treece6dd888a809fbf38c4b23e56e267ac529b67139 /src/js/plyr.js
parent6bebbe41530873e40b3615acb33e2f1fd55fb342 (diff)
downloadplyr-45df3198237644610aa140bbb12d676324157cb6.tar.lz
plyr-45df3198237644610aa140bbb12d676324157cb6.tar.xz
plyr-45df3198237644610aa140bbb12d676324157cb6.zip
Keyboard shortcut tweaks
Diffstat (limited to 'src/js/plyr.js')
-rw-r--r--src/js/plyr.js13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/js/plyr.js b/src/js/plyr.js
index 1cff4231..5c28887e 100644
--- a/src/js/plyr.js
+++ b/src/js/plyr.js
@@ -214,6 +214,9 @@ class Plyr {
this.elements.container = utils.createElement('div');
utils.wrap(this.media, this.elements.container);
+ // Allow focus to be captured
+ this.elements.container.setAttribute('tabindex', 0);
+
// Add style hook
ui.addStyleHook.call(this);
@@ -287,19 +290,13 @@ class Plyr {
// Rewind
rewind(seekTime) {
- this.currentTime = Math.min(
- this.currentTime - (utils.is.number(seekTime) ? seekTime : this.config.seekTime),
- 0
- );
+ this.currentTime = this.currentTime - (utils.is.number(seekTime) ? seekTime : this.config.seekTime);
return this;
}
// Fast forward
forward(seekTime) {
- this.currentTime = Math.max(
- this.currentTime + (utils.is.number(seekTime) ? seekTime : this.config.seekTime),
- this.duration
- );
+ this.currentTime = this.currentTime + (utils.is.number(seekTime) ? seekTime : this.config.seekTime);
return this;
}