brownhci / WebGazer

WebGazer.js: Scalable Webcam EyeTracking Using User Interactions
https://webgazer.cs.brown.edu
Other
3.54k stars 536 forks source link

fix error in removing the video container children on end #238

Closed hanadi92 closed 2 years ago

hanadi92 commented 3 years ago

This line of code makes the videoElement a child of the videoContainerElement: https://github.com/brownhci/WebGazer/blob/966b1c149575871e4021bcca8a2d90760d122622/src/index.mjs#L556 And this line of code is called inwebgazer.end(): https://github.com/brownhci/WebGazer/blob/966b1c149575871e4021bcca8a2d90760d122622/src/index.mjs#L707 Removing the videoElementas if it is a child of the document.body is causing a JavaScript error. Therefore, I fixed the issue in this pull-request by removing the videoContainerElement in webgazer.end() since it's created on webgazer.begin() and holds the videoElement and the videoElementCanvas.

jeffhuang commented 2 years ago

lgtm, thanks