diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2021-03-19 19:10:26 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2021-03-19 19:10:26 +0100 |
| commit | 17fb6581d305732e2cf0add7f3444e1aa80aec5c (patch) | |
| tree | 0da40c9f178d3ada44ced2517b6db82b96d8dc19 /frontend/app/utils/index.js | |
| parent | ccaa55434ff44e0149c5984f2e5968139bbe3baa (diff) | |
split tile handles into individual files. add video subsection loop
Diffstat (limited to 'frontend/app/utils/index.js')
| -rw-r--r-- | frontend/app/utils/index.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/frontend/app/utils/index.js b/frontend/app/utils/index.js index 6e5a909..d67d89a 100644 --- a/frontend/app/utils/index.js +++ b/frontend/app/utils/index.js @@ -63,6 +63,16 @@ export const timestamp = (n = 0, fps = 25) => { } return (n % 60) + ':' + s } +export const timestampToSeconds = time_str => { + const time_str_parts = (time_str || "").trim().split(":").map(s => parseFloat(s)) + if (time_str_parts.length === 3) { + return (time_str_parts[0] * 60 + time_str_parts[1]) * 60 + time_str_parts[2] + } + if (time_str_parts.length === 2) { + return time_str_parts[0] * 60 + time_str_parts[1] + } + return time_str_parts[0] +} export const percent = n => (n * 100).toFixed(1) + '%' |
