aboutsummaryrefslogtreecommitdiffstats
path: root/src/js/controls.js
diff options
context:
space:
mode:
authorSam Potts <sam@potts.es>2020-02-10 18:34:05 +0000
committerSam Potts <sam@potts.es>2020-02-10 18:34:05 +0000
commit1619510dcf9e3ccc1693caa20a173aaf2789e346 (patch)
tree900d8a12a10ded90a058600ad459d3ed048c3ad1 /src/js/controls.js
parentff8dedd4ec2235131a630635ec7927c75d0a3c16 (diff)
downloadplyr-1619510dcf9e3ccc1693caa20a173aaf2789e346.tar.lz
plyr-1619510dcf9e3ccc1693caa20a173aaf2789e346.tar.xz
plyr-1619510dcf9e3ccc1693caa20a173aaf2789e346.zip
Speed settings logic improvements
Diffstat (limited to 'src/js/controls.js')
-rw-r--r--src/js/controls.js11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/js/controls.js b/src/js/controls.js
index 1cce51f6..66ec7139 100644
--- a/src/js/controls.js
+++ b/src/js/controls.js
@@ -9,7 +9,7 @@ import captions from './captions';
import html5 from './html5';
import support from './support';
import { repaint, transitionEndEvent } from './utils/animation';
-import { dedupe, fillRange } from './utils/arrays';
+import { dedupe } from './utils/arrays';
import browser from './utils/browser';
import {
createElement,
@@ -1053,13 +1053,8 @@ const controls = {
const type = 'speed';
const list = this.elements.settings.panels.speed.querySelector('[role="menu"]');
- // Determine options to display
- // Vimeo and YouTube limit to 0.5x-2x
- if (this.isVimeo || this.isYouTube) {
- this.options.speed = fillRange(0.5, 2, 0.25).filter(s => this.config.speed.options.includes(s));
- } else {
- this.options.speed = this.config.speed.options;
- }
+ // Filter out invalid speeds
+ this.options.speed = this.options.speed.filter(o => o >= this.minimumSpeed && o <= this.maximumSpeed);
// Toggle the pane and tab
const toggle = !is.empty(this.options.speed) && this.options.speed.length > 1;