MCPcopy Create free account
hub / github.com/ACM-VIT/conclave / clickButton

Function clickButton

scripts/debug-video-effects-headless.mjs:864–892  ·  view source on GitHub ↗
(cdp, label, timeout = 5000)

Source from the content-addressed store, hash-verified

862 debug?.rawTrack?.readyState === "live" ||
863 debug?.localStream?.videoTracks?.some?.((track) => track.readyState === "live") ||
864 false;
865 const liveVideoFromElement = Array.from(document.querySelectorAll("video")).some((video) => {
866 const stream = video.srcObject;
867 const tracks = stream && typeof stream.getVideoTracks === "function"
868 ? stream.getVideoTracks()
869 : [];
870 return tracks.some((track) => track.readyState === "live");
871 });
872 const alreadyOn =
873 debug?.isCameraOff === false && (liveVideoFromDebug || liveVideoFromElement);
874 const turnOnButton = Array.from(document.querySelectorAll("button")).find(
875 (candidate) =>
876 candidate.getAttribute("aria-label") === "Turn on camera" ||
877 (candidate.textContent || "").includes("Turn on camera")
878 );
879 const turnOnReady = Boolean(turnOnButton && !turnOnButton.disabled);
880 if (!alreadyOn && !turnOnReady) return false;
881 return {
882 alreadyOn,
883 turnOnReady,
884 connectionState: debug?.connectionState ?? null,
885 isCameraOff: debug?.isCameraOff ?? null,
886 liveVideoFromDebug,
887 liveVideoFromElement,
888 };
889 })()`,
890 30000,
891 );
892 emit("turn_camera_on_if_needed_state", { label, cameraState });
893 if (cameraState.alreadyOn) return;
894
895 await clickButton(cdp, "Turn on camera", 10000);

Callers 10

openMeetingEffectsPanelFunction · 0.70
turnCameraOnIfNeededFunction · 0.70
selectCombinedBackgroundFunction · 0.70
runMeetVideoPipeProbeFunction · 0.70
runPrejoinHandoffProbeFunction · 0.70
runFunction · 0.70

Calls 5

collectProbeFunction · 0.85
nowMethod · 0.80
evalValueFunction · 0.70
sleepFunction · 0.70
emitFunction · 0.70

Tested by

no test coverage detected