0

I'm working in a web application that allows user to create a scene using canvas element, and then using Web Audio Api the scene changes accordingly with extracted frequencies in real time (creating audio visualizations). I implemented the interactivity with canvas with eventListeners.

My question here is if there is a way to disable canvas interaction (stop eventListeners) while the song is playing (the scene is changing) and after user stops it, the scene can be modified again.

Thank you all.

  • If the events you want to disable are mouse generated, you can temporarely add `pointer-events: none` to the canvas. – a.barbieri May 30 '17 at 10:17
  • And what about if some of those events are generated by pressing DOM elements of the interface? (Like clicking buttons as "Add new shape"). Btw I'll try your solution. Thx @a.barbieri – Eduard Farré May 30 '17 at 10:24
  • 1
    Anything `pointer` related are covered by `pointer-events`. See [MDN documentation](https://stackoverflow.com/a/13456810/1498118) – a.barbieri May 30 '17 at 10:25

0 Answers0