prepareCanva(options) {

        // clear any running event
        if (this.runningEvent) {
            clearInterval(this.runningEvent);
        }
         
        // Display welcome message if defined
        this.clearDisplay();
        if(options && options.welcome) {
            this.display(options.welcome, 'message');
        }

        // set whether or not the video is to be visible
        if (options && options.puppeteer) {
            this.media.classList.replace('show', 'hide');
        } else {
            this.media.classList.replace('hide', 'show');
        }

        // create a canva from the video media and match its size to the video size
        // If the canva exists then remove it first
        const existingCanva = document.getElementById('detectfaces') || null;
        if (existingCanva) {
            existingCanva.parentNode.removeChild(existingCanva);
        }

        // Create the canva on top of the video and add it to the document
        const canvas = faceapi.createCanvasFromMedia(this.media);
        canvas.id = "detectfaces";
        document.getElementById('detector').append(canvas);

        return canvas;

    }
/* 
     * Method that creates and prepares the canva for the application selected
     * @options: the application selected options are provided
     */
Method that creates and prepares the canva for the application selected
@options: the application selected options are provided
Method that creates and prepares the canva for the application selected @options : the application selected options are provided
prepareCanva(options) {
        if (this.runningEvent) {
            clearInterval(this.runningEvent);
        }
        this.clearDisplay();
        if(options && options.welcome) {
            this.display(options.welcome, 'message');
        }
        if (options && options.puppeteer) {
            this.media.classList.replace('show', 'hide');
        } else {
            this.media.classList.replace('hide', 'show');
        }
        const existingCanva = document.getElementById('detectfaces') || null;
        if (existingCanva) {
            existingCanva.parentNode.removeChild(existingCanva);
        }
        const canvas = faceapi.createCanvasFromMedia(this.media);
        canvas.id = "detectfaces";
        document.getElementById('detector').append(canvas);
        return canvas;
    }
prepareCanva ( options ) { if ( this . runningEvent ) { clearInterval ( this . runningEvent ) ; } this . clearDisplay ( ) ; if ( options && options . welcome ) { this . display ( options . welcome , 'message' ) ; } if ( options && options . puppeteer ) { this . media . classList . replace ( 'show' , 'hide' ) ; } else { this . media . classList . replace ( 'hide' , 'show' ) ; } const existingCanva = document . getElementById ( 'detectfaces' ) || null ; if ( existingCanva ) { existingCanva . parentNode . removeChild ( existingCanva ) ; } const canvas = faceapi . createCanvasFromMedia ( this . media ) ; canvas . id = "detectfaces" ; document . getElementById ( 'detector' ) . append ( canvas ) ; return canvas ; }
Method that creates and prepares the canva for the application selected
 @options: the application selected options are provided
Method that creates and prepares the canva for the application selected @options : the application selected options are provided
// clear any running event // Display welcome message if defined // set whether or not the video is to be visible // create a canva from the video media and match its size to the video size // If the canva exists then remove it first // Create the canva on top of the video and add it to the document