Playback rate (#411)

* update
This commit is contained in:
Harvey Zack authored and GitHub committed 2022-10-29 21:14:17 +08:00
1 parent efc9cf7362
commit 6715bc457a
16 files changed
+268 -267

No files matched your search

+6 -2
View File
@@ -2,8 +2,12 @@ export function clamp(num, a, b) {
return Math.max(Math.min(num, Math.max(a, b)), Math.min(a, b));
}
export function capitalize(str) {
return str.charAt(0).toUpperCase() + str.slice(1);
}
export function secondToTime(second) {
const add0 = num => (num < 10 ? `0${num}` : String(num));
const add0 = (num) => (num < 10 ? `0${num}` : String(num));
const hour = Math.floor(second / 3600);
const min = Math.floor((second - hour * 3600) / 60);
const sec = Math.floor(second - hour * 3600 - min * 60);
@@ -13,7 +17,7 @@ export function secondToTime(second) {
export function escape(str) {
return str.replace(
/[&<>'"]/g,
tag =>
(tag) =>
({
'&': '&amp;',
'<': '&lt;',