Change a Cue start time in Popcorn.js?

736 Views Asked by At

I need to change a Cue point in a video using Popcorn.js. Is there a way to edit the time of a Cue event already sent to he Popcorn player via the Cue() method?

Thanks!

1

There are 1 best solutions below

0
On BEST ANSWER
var events = Popcorn.getTrackEvents();
for (var e in events) {
  Popcorn.removeTrackEvent(events[e]._id);
}
Popcorn.cue(newTime, newFunction);

Its not exactly the editing the event, but it works fine for me - i need to replace everything and then play video again.

There are also getTrackEvent(obj, id) and getLastTrackEventId(obj) - you can handle each event separately (i did not tested it).

It looks it will be implemented in new release 1.3