Skip to content

Instantly share code, notes, and snippets.

@jefBinomed
Created December 3, 2020 12:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jefBinomed/9a4e3ff02a87ec57b078edb522193834 to your computer and use it in GitHub Desktop.
Save jefBinomed/9a4e3ff02a87ec57b078edb522193834 to your computer and use it in GitHub Desktop.
2020-fugu-user-media-helper
class UserMediaHelper {
/**
* @param canvas: the dom element corresponding to canvas
* @param video: the dom element corresponding to video
* @param videoArea: the dom element around the canvas (to fix the size of the output video)
**/
constructor(canvas, video, videoArea) {}
/**
* Method to call to receive the results of the detection
* @param type: the type of detector to use -> See the Helper Detector to have more information
* @param options: the options passed to the previous detector. If you want to use TextDetector, please give "null" as value
* @param callback: the callback function that will receive the results of the detection. The function should be like (detectedObject)=>{}
**/
addDetectorCallbak(type, options, callback) {}
/**
* Method to call if you want to draw something on the canvas based on the detection
* @param callBackFunction: the method call at every frame to draw on the canvas. The function should be like (context, video, canvas) => {}
**/
addCallbackDraw(callBackFunction) {}
/**
* This method should be called to stop the process of captation and detection
**/
stop() {}
/**
* Call this method to start the captation and detection process
**/
async getUserMedia() {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment