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

Function MultiStreamsMixer

src/__tests__/MediaStreamRecorder.js:321–727  ·  view source on GitHub ↗
(arrayOfMediaStreams)

Source from the content-addressed store, hash-verified

319// --------------------------------------------------
320
321function MultiStreamsMixer(arrayOfMediaStreams) {
322
323 // requires: chrome://flags/#enable-experimental-web-platform-features
324
325 var videos = [];
326 var isStopDrawingFrames = false;
327
328 var canvas = document.createElement('canvas');
329 var context = canvas.getContext('2d');
330 canvas.style = 'opacity:0;position:absolute;z-index:-1;top: -100000000;left:-1000000000; margin-top:-1000000000;margin-left:-1000000000;';
331 (document.body || document.documentElement).appendChild(canvas);
332
333 this.disableLogs = false;
334 this.frameInterval = 10;
335
336 this.width = 360;
337 this.height = 240;
338
339 // use gain node to prevent echo
340 this.useGainNode = true;
341
342 var self = this;
343
344 // _____________________________
345 // Cross-Browser-Declarations.js
346
347 // WebAudio API representer
348 var AudioContext = window.AudioContext;
349
350 if (typeof AudioContext === 'undefined') {
351 if (typeof webkitAudioContext !== 'undefined') {
352 /*global AudioContext:true */
353 AudioContext = webkitAudioContext;
354 }
355
356 if (typeof mozAudioContext !== 'undefined') {
357 /*global AudioContext:true */
358 AudioContext = mozAudioContext;
359 }
360 }
361
362 /*jshint -W079 */
363 var URL = window.URL;
364
365 if (typeof URL === 'undefined' && typeof webkitURL !== 'undefined') {
366 /*global URL:true */
367 URL = webkitURL;
368 }
369
370 if (typeof navigator !== 'undefined' && typeof navigator.getUserMedia === 'undefined') { // maybe window.navigator?
371 if (typeof navigator.webkitGetUserMedia !== 'undefined') {
372 navigator.getUserMedia = navigator.webkitGetUserMedia;
373 }
374
375 if (typeof navigator.mozGetUserMedia !== 'undefined') {
376 navigator.getUserMedia = navigator.mozGetUserMedia;
377 }
378 }

Callers

nothing calls this directly

Calls 3

drawVideosToCanvasFunction · 0.85
getVideoFunction · 0.85
resetVideoStreamsFunction · 0.85

Tested by

no test coverage detected