0

Fabricjs seems to use fabric.Image to create both an image or a video. In multiple use cases if I'm getting some fabric object, through an event, or looping through the fabric canvas, I need to differentiate if that object is an image or a video. If I use fabricObject.type I will get "image" type for both the video object and the image object. Is there some other property I can check to determine which is which? Perhaps there is a way to add metaData to the fabric.Object to help differentiate objects.

Ariel Frischer
  • 1,406
  • 2
  • 12
  • 20

1 Answers1

0

Ok, so I found out that I can use the data field inside a fabric object to store any type of data I want, without fabric messing with it. This will help immensely and I've tested that it works.

Ariel Frischer
  • 1,406
  • 2
  • 12
  • 20