From e75f4f0c6059c28093c07265e0bdee89f1593549 Mon Sep 17 00:00:00 2001 From: George Ogata Date: Sun, 31 May 2015 03:54:57 -0400 Subject: [PATCH] Don't update our video speed setting before the video is loaded. In this state, the playback rate is always 1, as we haven't had a chance to update it yet (which currently happens in the play callback). Fixes speed setting when jumping between YouTube videos. --- inject.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/inject.js b/inject.js index e46d0f9..5f32590 100644 --- a/inject.js +++ b/inject.js @@ -44,6 +44,9 @@ chrome.extension.sendMessage({}, function(response) { }); target.addEventListener('ratechange', function(event) { + if (target.readyState === 0) { + return; + } var speed = this.getSpeed(); this.speedIndicator.textContent = speed; tc.settings.speed = speed;