jeeliz/jeelizWeboji

How to destroy?

lacastorine opened this issue · 4 comments

jeelizFaceFilter have 'native' destroy method, how to do it correctly for jeelizWeboji?

There is no destroy() method for weboji

JEEFACETRANSFERAPI.destroy() should make the job now

It is not working as expected for me:

  • it is not stoping webcam stream
    workaround - stop manually before destroy : JEEFACETRANSFERAPI.get_video().srcObject.getTracks().forEach(track => track.stop());
  • it is not removing 'display:none;' style from canvas (when using JEEFACETRANSFERAPI.switch_displayVideo(false);)
    workaround - dynamically add and remove canvas in DOM (we can't pass dyrectly canvas element as in jeelizFaceFilter.init())
  • it is not possible to reinit api - it returns ALREADY_INITIALIZED error code, when I try to init api again
    workaround - manually set JEEFACETRANSFERAPI.initialized to false

--
edited - add possible workarounds

Hi @lacastorine
Thank you very much for your detailed feedbacks.
I have integrated them.