Closed msjaber closed 4 years ago
This is currently not possible, but I think it should be. I'll have a look into it, as implementing this will require some changes to the way the point/segment attributes are handled.
Please take a look at the segment-attributes
branch. You can now set custom attributes using peaks.segments.add()
and segment.update()
:
peaks.segments.add({
startTime: 1,
endTime: 3,
editable: true,
color: "#ff0000",
labelText: "My label",
foo: "bar" // additional attributes
});
segment.update({ foo: "baz" });
Thank you so much @chrisn! 🙏🏻
It works perfectly.
Thank you :-) I'll merge this and publish a new release to npm.
Hey,
Is it possible to add additional attributes to the Segment object?
If no, can I make a pull request for it?
My use case is that I wanna add an attribute of
shouldSkip
, and listen to the cue events in order to behave based on the attribute's value.Thanks