mirror of
https://github.com/SoPat712/videospeed.git
synced 2025-08-22 02:18:45 -04:00
Update our speed setting when the speed is changed externally.
e.g. Coursera videos have their own speed controls. If the speed is changed from A to B via their controls, then the video is paused & resumed, our play callback would reset the speed to A. We now ensure our speed setting is accurate by updating it in the ratechange callback, which happens no matter how the speed is updated.
This commit is contained in:
@@ -46,6 +46,8 @@ chrome.extension.sendMessage({}, function(response) {
|
||||
target.addEventListener('ratechange', function(event) {
|
||||
var speed = this.getSpeed();
|
||||
this.speedIndicator.textContent = speed;
|
||||
tc.settings.speed = speed;
|
||||
chrome.storage.sync.set({'speed': speed});
|
||||
}.bind(this));
|
||||
|
||||
target.playbackRate = tc.settings.speed;
|
||||
@@ -126,8 +128,6 @@ chrome.extension.sendMessage({}, function(response) {
|
||||
|
||||
function setSpeed(v, speed) {
|
||||
v.playbackRate = speed;
|
||||
tc.settings.speed = speed;
|
||||
chrome.storage.sync.set({'speed': speed});
|
||||
}
|
||||
|
||||
function runAction(action) {
|
||||
|
Reference in New Issue
Block a user