mirror of https://github.com/vladmandic/human
fix pause restart
parent
72836738b3
commit
da811353ab
|
@ -197,8 +197,10 @@ function runHumanDetect(input, canvas) {
|
||||||
// if video not ready, just redo
|
// if video not ready, just redo
|
||||||
const live = (input.srcObject.getVideoTracks()[0].readyState === 'live') && (input.readyState > 2) && (!input.paused);
|
const live = (input.srcObject.getVideoTracks()[0].readyState === 'live') && (input.readyState > 2) && (!input.paused);
|
||||||
if (!live) {
|
if (!live) {
|
||||||
if (!input.paused) log(`Video not ready: state: ${input.srcObject.getVideoTracks()[0].readyState} stream state: ${input.readyState}`);
|
if (!input.paused) {
|
||||||
setTimeout(() => runHumanDetect(input, canvas), 500);
|
log(`Video not ready: state: ${input.srcObject.getVideoTracks()[0].readyState} stream state: ${input.readyState}`);
|
||||||
|
setTimeout(() => runHumanDetect(input, canvas), 500);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (ui.useWorker) {
|
if (ui.useWorker) {
|
||||||
|
|
Loading…
Reference in New Issue