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

Function drawImage

src/__tests__/MediaStreamRecorder.js:483–527  ·  view source on GitHub ↗
(video, idx)

Source from the content-addressed store, hash-verified

481 }
482
483 function drawImage(video, idx) {
484 if (isStopDrawingFrames) {
485 return;
486 }
487
488 var x = 0;
489 var y = 0;
490 var width = video.width;
491 var height = video.height;
492
493 if (idx === 1) {
494 x = video.width;
495 }
496
497 if (idx === 2) {
498 y = video.height;
499 }
500
501 if (idx === 3) {
502 x = video.width;
503 y = video.height;
504 }
505
506 if (typeof video.stream.left !== 'undefined') {
507 x = video.stream.left;
508 }
509
510 if (typeof video.stream.top !== 'undefined') {
511 y = video.stream.top;
512 }
513
514 if (typeof video.stream.width !== 'undefined') {
515 width = video.stream.width;
516 }
517
518 if (typeof video.stream.height !== 'undefined') {
519 height = video.stream.height;
520 }
521
522 context.drawImage(video, x, y, width, height);
523
524 if (typeof video.stream.onRender === 'function') {
525 video.stream.onRender(context, x, y, width, height, idx);
526 }
527 }
528
529 function getMixedStream() {
530 isStopDrawingFrames = false;

Callers 1

drawVideosToCanvasFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected