mirror of
https://github.com/SoPat712/videospeed.git
synced 2025-08-21 18:08:46 -04:00
show controller on keyboard input
This commit is contained in:
22
inject.js
22
inject.js
@@ -15,6 +15,7 @@ chrome.extension.sendMessage({}, function(response) {
|
||||
}
|
||||
};
|
||||
|
||||
var controllerAnimation;
|
||||
var readyStateCheckInterval;
|
||||
chrome.storage.sync.get(tc.settings, function(storage) {
|
||||
tc.settings.speed = Number(storage.speed);
|
||||
@@ -164,6 +165,27 @@ chrome.extension.sendMessage({}, function(response) {
|
||||
} else if (action === 'reset') {
|
||||
setSpeed(v, 1.0);
|
||||
}
|
||||
|
||||
// show controller on keyboard input
|
||||
var controller = v.parentElement
|
||||
.getElementsByClassName('tc-videoController')[0];
|
||||
controller.style.visibility = 'visible';
|
||||
if (controllerAnimation != null
|
||||
&& controllerAnimation.playState != 'finished') {
|
||||
controllerAnimation.cancel();
|
||||
}
|
||||
controllerAnimation = controller.animate([
|
||||
{opacity: 0.3},
|
||||
{opacity: 0.3},
|
||||
{opacity: 0.0},
|
||||
], {
|
||||
duration: 3000,
|
||||
iterations: 1,
|
||||
delay: 0
|
||||
});
|
||||
player.onfinish = function(e) {
|
||||
controller.style.visibility = 'hidden';
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user