()
| 21 | |
| 22 | // Provide fake video stream |
| 23 | export function setupFakeVideoStream() { |
| 24 | const width = 100; |
| 25 | const height = 200; |
| 26 | const canvasElement = document.createElement('canvas'); |
| 27 | const ctx = canvasElement.getContext('2d'); |
| 28 | ctx.fillStyle = 'rgb(1,2,3)'; |
| 29 | ctx.fillRect(0, 0, width, height); |
| 30 | // tslint:disable-next-line:no-any |
| 31 | const stream = (canvasElement as any).captureStream(60); |
| 32 | navigator.mediaDevices.getUserMedia = async () => { |
| 33 | return stream; |
| 34 | }; |
| 35 | } |
| 36 | |
| 37 | export async function replaceHTMLVideoElementSource( |
| 38 | videoElement: HTMLVideoElement) { |
no test coverage detected
searching dependent graphs…