mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-22 16:37:52 +01:00
add cpu warning
This commit is contained in:
parent
fdb2c1d12e
commit
b25841a667
1 changed files with 30 additions and 20 deletions
12
css/app.js
12
css/app.js
|
@ -332,9 +332,19 @@ loopOption.addEventListener("click", function() {
|
|||
});
|
||||
|
||||
speedOption.addEventListener("click", function() {
|
||||
|
||||
var currentSpeed = video.playbackRate;
|
||||
var newSpeed = getNextSpeed(currentSpeed);
|
||||
|
||||
if (navigator.hardwareConcurrency < 3) {
|
||||
var userChoice = confirm(
|
||||
"Your system has less than 3 CPU cores ;_; Increasing the video speed will CPU usage and affect performance - Do u want to continue?"
|
||||
);
|
||||
|
||||
if (!userChoice) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
video.playbackRate = newSpeed;
|
||||
document.getElementById("aud").playbackRate = newSpeed;
|
||||
speedOption.innerHTML = "<i class='fa-light fa-gauge'></i> Speed: " + newSpeed.toFixed(2) + "x";
|
||||
|
|
Loading…
Reference in a new issue