Add existing code

This commit is contained in:
Gennady Grishkovtsov
2018-07-23 12:00:58 +03:00
parent ff7cb590c5
commit 95a9700d50
22 changed files with 10295 additions and 2 deletions

22
src/lib/utils.js Normal file
View File

@@ -0,0 +1,22 @@
export function calculateLineHeadPosition (ev, element) {
let progressWidth = element.getBoundingClientRect().width
let leftPosition = ev.target.getBoundingClientRect().left
let pos = (ev.clientX - leftPosition) / progressWidth
try {
if (!ev.target.className.match(/^ar\-line\-control/)) {
return
}
} catch (err) {
return
}
pos = pos < 0 ? 0 : pos
pos = pos > 1 ? 1 : pos
return pos
}
export function convertTimeMMSS (seconds) {
return new Date(seconds * 1000).toISOString().substr(14, 5)
}