Change: audio player shows time remaining and percent #122, Add: experimental bookmarks start #115

This commit is contained in:
advplyr 2021-10-24 18:25:44 -05:00
parent f9bf846b30
commit c5eafdfa8a
9 changed files with 284 additions and 21 deletions

View file

@ -0,0 +1,32 @@
class AudioBookmark {
constructor(bookmark) {
this.title = null
this.time = null
this.createdAt = null
if (bookmark) {
this.construct(bookmark)
}
}
toJSON() {
return {
title: this.title || '',
time: this.time,
createdAt: this.createdAt
}
}
construct(bookmark) {
this.title = bookmark.title || ''
this.time = bookmark.time || 0
this.createdAt = bookmark.createdAt
}
setData(time, title) {
this.title = title
this.time = time
this.createdAt = Date.now()
}
}
module.exports = AudioBookmark