Commit a95d39d9 by vincent

fixed looping issue in video example

parent 6fd645e1
...@@ -161,7 +161,7 @@ ...@@ -161,7 +161,7 @@
} }
async function onPlay(videoEl) { async function onPlay(videoEl) {
if(videoEl.paused || videoEl.ended || !isFaceDetectionModelLoaded()) if(!videoEl.currentTime || videoEl.paused || videoEl.ended || !isFaceDetectionModelLoaded())
return setTimeout(() => onPlay(videoEl)) return setTimeout(() => onPlay(videoEl))
......
...@@ -180,13 +180,11 @@ ...@@ -180,13 +180,11 @@
updateTimeStats(Date.now() - ts) updateTimeStats(Date.now() - ts)
if (result) {
const drawFunction = withFaceLandmarks const drawFunction = withFaceLandmarks
? drawLandmarks ? drawLandmarks
: drawDetections : drawDetections
drawFunction(videoEl, $('#overlay').get(0), [result], withBoxes) drawFunction(videoEl, $('#overlay').get(0), result || [], withBoxes)
}
setTimeout(() => onPlay()) 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