diff options
author | Sam Potts <sam@potts.es> | 2017-11-21 21:14:44 +1100 |
---|---|---|
committer | Sam Potts <sam@potts.es> | 2017-11-21 21:14:44 +1100 |
commit | 4b82e89845157d364dd3a459a5906b622f1db4dc (patch) | |
tree | b9bb25e4186106bbd63b6060df05948557d8a818 /src/js/ui.js | |
parent | d3b31e595a323208972f9422bf458b792da8c185 (diff) | |
download | plyr-4b82e89845157d364dd3a459a5906b622f1db4dc.tar.lz plyr-4b82e89845157d364dd3a459a5906b622f1db4dc.tar.xz plyr-4b82e89845157d364dd3a459a5906b622f1db4dc.zip |
Fix for playing getter as currentTime check is flaky
Diffstat (limited to 'src/js/ui.js')
-rw-r--r-- | src/js/ui.js | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/js/ui.js b/src/js/ui.js index 062331dc..3807d9f3 100644 --- a/src/js/ui.js +++ b/src/js/ui.js @@ -138,19 +138,17 @@ const ui = { // Check playing state checkPlaying() { - window.setTimeout(() => { - // Class hooks - utils.toggleClass(this.elements.container, this.config.classNames.playing, this.playing); - utils.toggleClass(this.elements.container, this.config.classNames.stopped, this.paused); - - // Set aria state - if (utils.is.array(this.elements.buttons.play)) { - Array.from(this.elements.buttons.play).forEach(button => utils.toggleState(button, this.playing)); - } + // Class hooks + utils.toggleClass(this.elements.container, this.config.classNames.playing, this.playing); + utils.toggleClass(this.elements.container, this.config.classNames.stopped, this.paused); + + // Set aria state + if (utils.is.array(this.elements.buttons.play)) { + Array.from(this.elements.buttons.play).forEach(button => utils.toggleState(button, this.playing)); + } - // Toggle controls - this.toggleControls(!this.playing); - }, 100); + // Toggle controls + this.toggleControls(!this.playing); }, // Check if media is loading |