Auto-zoom out 1% when Persona says 'Move further away'
This commit is contained in:
@@ -567,6 +567,7 @@ def process_account(driver, acc: dict, donor_video: Path | None,
|
|||||||
_draw();
|
_draw();
|
||||||
}};
|
}};
|
||||||
window.__seekDirection = function(dir) {{ _currentDir = dir; }};
|
window.__seekDirection = function(dir) {{ _currentDir = dir; }};
|
||||||
|
window.__zoomOut = function() {{ _scaleX *= 0.99; _scaleY *= 0.99; }};
|
||||||
|
|
||||||
if (navigator.mediaDevices) {{
|
if (navigator.mediaDevices) {{
|
||||||
navigator.mediaDevices.getUserMedia = function(constraints) {{
|
navigator.mediaDevices.getUserMedia = function(constraints) {{
|
||||||
@@ -645,6 +646,10 @@ def process_account(driver, acc: dict, donor_video: Path | None,
|
|||||||
log.info("Photo rejected, restarting browser")
|
log.info("Photo rejected, restarting browser")
|
||||||
driver.switch_to.default_content()
|
driver.switch_to.default_content()
|
||||||
return True
|
return True
|
||||||
|
if "further away" in body.lower() or "move back" in body.lower():
|
||||||
|
driver.execute_script("window.__zoomOut();")
|
||||||
|
log.info("Zoomed out (further away detected)")
|
||||||
|
time.sleep(1)
|
||||||
if "Session expired" in body:
|
if "Session expired" in body:
|
||||||
log.info("Session expired detected during verification")
|
log.info("Session expired detected during verification")
|
||||||
driver.switch_to.default_content()
|
driver.switch_to.default_content()
|
||||||
|
|||||||
Reference in New Issue
Block a user