From 125843bfc20870f2eb731ab160bca0085b73a413 Mon Sep 17 00:00:00 2001 From: Jon Wong Date: Tue, 3 Jun 2014 23:47:40 -0700 Subject: [PATCH] Adjusting autoplay to properly wait for loadstart event. Since moving the loadstart into the `player.ready` function, there exists a race condition whereby the player emits a `play` event before the `loadstart` event, but since `onLoadStart` was waiting for that `play` event, the play button never goes away. --- src/js/media/html5.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/media/html5.js b/src/js/media/html5.js index 6cb8ff46c1..f79973a9df 100644 --- a/src/js/media/html5.js +++ b/src/js/media/html5.js @@ -56,7 +56,7 @@ vjs.Html5 = vjs.MediaTechController.extend({ player.ready(function(){ if (this.tag && this.options_['autoplay'] && this.paused()) { delete this.tag['poster']; // Chrome Fix. Fixed in Chrome v16. - this.play(); + this.one('loadstart', vjs.bind(this, this.play)); } });