MCPcopy Create free account
hub / github.com/dedsec1121fk/DedSec / index

Function index

Scripts/ButSystem.py:10283–10295  ·  view source on GitHub ↗

index. Route handler or application helper. This docstring was expanded to make future maintenance easier. Returns: Varies.

()

Source from the content-addressed store, hash-verified

10281 let lastErr = null;
10282 for (const constraints of seq){
10283 try { return await navigator.mediaDevices.getUserMedia(constraints); }
10284 catch(err){ lastErr = err; }
10285 }
10286 throw lastErr || new Error('camera_failed');
10287 }
10288
10289 async function waitForVideo(){
10290 if(videoEl.readyState >= 2 && videoEl.videoWidth > 0) return;
10291 await new Promise((resolve, reject) => {
10292 let done = false;
10293 const ok = () => { if(done) return; done = true; cleanup(); resolve(); };
10294 const bad = () => { if(done) return; done = true; cleanup(); reject(new Error('video_not_ready')); };
10295 const cleanup = () => { videoEl.removeEventListener('loadedmetadata', ok); videoEl.removeEventListener('canplay', ok); clearTimeout(timer); };
10296 videoEl.addEventListener('loadedmetadata', ok, {once:true});
10297 videoEl.addEventListener('canplay', ok, {once:true});
10298 const timer = setTimeout(bad, 6000);

Callers 1

landingFunction · 0.70

Calls 1

is_logged_inFunction · 0.70

Tested by

no test coverage detected