diff options
author | Sam Potts <sam@potts.es> | 2020-08-30 15:45:24 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-30 15:45:24 +1000 |
commit | f75820fbd369fabe2cdc002549529c6186c1009f (patch) | |
tree | 88d3ba2181b07119a1bdf947c1fec7d8a0ff7ec2 | |
parent | 8b0d84a9a44111f9032ec4e5445189eac4bbbd2f (diff) | |
parent | 9076d054b93c2d0837ad37dcc3aab5eccd3d335f (diff) | |
download | plyr-f75820fbd369fabe2cdc002549529c6186c1009f.tar.lz plyr-f75820fbd369fabe2cdc002549529c6186c1009f.tar.xz plyr-f75820fbd369fabe2cdc002549529c6186c1009f.zip |
Merge pull request #1931 from SBGSports/Autoplay-issue
Fix for Slow loading videos not autoplaying
-rw-r--r-- | src/js/plyr.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/js/plyr.js b/src/js/plyr.js index 7835d779..f2eb3afb 100644 --- a/src/js/plyr.js +++ b/src/js/plyr.js @@ -309,7 +309,7 @@ class Plyr { // Autoplay if required if (this.isHTML5 && this.config.autoplay) { - setTimeout(() => silencePromise(this.play()), 10); + this.once('canplay', () => silencePromise(this.play())); } // Seek time will be recorded (in listeners.js) so we can prevent hiding controls for a few seconds after seek |