MCPcopy Create free account
hub / github.com/Wscats/chrome-devtools-cli / drawVideoFrame

Function drawVideoFrame

src/__tests__/MediaStreamRecorder.js:2111–2140  ·  view source on GitHub ↗
(time)

Source from the content-addressed store, hash-verified

2109 startTime = Date.now();
2110
2111 function drawVideoFrame(time) {
2112 if (isPaused) {
2113 setTimeout(drawVideoFrame, 500, time);
2114 return;
2115 }
2116
2117 lastAnimationFrame = requestAnimationFrame(drawVideoFrame);
2118
2119 if (typeof lastFrameTime === undefined) {
2120 lastFrameTime = time;
2121 }
2122
2123 // ~10 fps
2124 if (time - lastFrameTime < 90) {
2125 return;
2126 }
2127
2128 if (video.paused) {
2129 video.play(); // Android
2130 }
2131
2132 context.drawImage(video, 0, 0, imageWidth, imageHeight);
2133
2134 gifEncoder.addFrame(context);
2135
2136 // console.log('Recording...' + Math.round((Date.now() - startTime) / 1000) + 's');
2137 // console.log("fps: ", 1000 / (time - lastFrameTime));
2138
2139 lastFrameTime = time;
2140 }
2141
2142 lastAnimationFrame = requestAnimationFrame(drawVideoFrame);
2143

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected