editor-timeline
timeline for multimedia editors
example
var keycode = ;var timeline = 200;timeline;window;var play = document;timeline;timeline;
with some html:
>
bundle with browserify:
browserify timeline.js > bundle.js
methods
var timeline =
var t = timeline(pxps)
Create a new timeline t
given pxps
, the number of pixels per second.
t.appendTo(target)
Append the timeline element to the html element or query string target
.
var m = t.mark()
Create a new mark m
.
t.select(id)
Select the mark at id
.
t.removeMark(id)
Remove the mark at id
.
t.start()
Start playing.
t.stop()
Stop playing.
t.toggle()
Start playing if not playing, otherwise stop playing.
t.setTime(n)
Set the current time n
in seconds.
t.getTime()
Get the current time in seconds.
events
t.on('mark', function (m, elem) {})
When there is a new mark, this event fires.
t.on('show', function (m, index) {})
When the mark is activated, this event fires.
t.on('remove', function (m, index) {})
When a mark is removed, this event fires.
install
With npm do:
npm install editor-timeline
license
MIT