Last active
August 12, 2018 22:04
-
-
Save iha2/74368c222ca8b4e72b7732fa898936d0 to your computer and use it in GitHub Desktop.
An implementation of a webcam processed by an observable.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function initializeWebcam( | |
videoElem: HTMLVideoElement, | |
canvasElement: HTMLCanvasElement | |
) { | |
return createWebcam(videoElem).pipe( | |
switchMap(_ => | |
timer(0, 40).pipe( | |
map(() => drawImageOnCanvas(videoElem, canvasElement)) | |
) | |
) | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment