Commit a95d39d9 by vincent

fixed looping issue in video example

parent 6fd645e1
......@@ -161,7 +161,7 @@
}
async function onPlay(videoEl) {
if(videoEl.paused || videoEl.ended || !isFaceDetectionModelLoaded())
if(!videoEl.currentTime || videoEl.paused || videoEl.ended || !isFaceDetectionModelLoaded())
return setTimeout(() => onPlay(videoEl))
......
......@@ -180,13 +180,11 @@
updateTimeStats(Date.now() - ts)
if (result) {
const drawFunction = withFaceLandmarks
? drawLandmarks
: drawDetections
const drawFunction = withFaceLandmarks
? drawLandmarks
: drawDetections
drawFunction(videoEl, $('#overlay').get(0), [result], withBoxes)
}
drawFunction(videoEl, $('#overlay').get(0), result || [], withBoxes)
setTimeout(() => onPlay())
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment