Added basic time editing.

The button presses don't work yet as YouTube steals the events.
This commit is contained in:
Ajay Ramachandran
2020-04-01 20:06:46 -04:00
parent 513a140754
commit 0d08e11b1d
4 changed files with 183 additions and 16 deletions

View File

@@ -256,6 +256,14 @@ class Utils {
xmlhttp.send();
}
getFormattedMinutes(seconds: number) {
return Math.floor(seconds / 60);
}
getFormattedSeconds(seconds: number) {
return seconds % 60;
}
getFormattedTime(seconds: number, precise?: boolean) {
let minutes = Math.floor(seconds / 60);
let secondsNum: number = seconds - minutes * 60;
@@ -275,6 +283,10 @@ class Utils {
return formatted;
}
getRawSeconds(minutes: number, seconds: number): number {
return minutes * 60 + seconds;
}
/**
* Is this Firefox (web-extensions)
*/