Search code examples
konvajskonvajs-reactjs

Konvajs - overlay with transparency over existing video or embed video inside Konvajs canvas?


I am trying to do a drawing over a paused video. For this I want to use Konvajs.

I guess I could try to embed the video inside Konvajs as a layer, but I could also just overlay the Konvajs element on top of the video and add transparency to it.

The second approach looks simpler to me in the context of my existing application. Should I expect a performance difference between the two?

Thanks!


Solution

  • If video is paused, the difference will be not noticeable. Both approached are totally valid.

    But if you are going to play video at some point, the first approach (Konva.Stage on top of video) should work better. Drawing playing video into canvas is not so simple in terms of code complexity and performance. It may be much simpler to manage video if it is inserted directly into the DOM.