Skip to content
This repository has been archived by the owner on Feb 19, 2024. It is now read-only.

feature request: manually call setupMedia and assign canvas Element by object refs #61

Open
nickfan opened this issue Aug 12, 2020 · 1 comment

Comments

@nickfan
Copy link

nickfan commented Aug 12, 2020

  1. is that possible to add a property something like 'autosetup' to control Whether call this.setupMedia() on mounted or not?
autosetup: {
      type: Boolean,
      default: true
    },

so that we can give user to show some guide ui before the browser pop up the permission request on page load.

  1. i want to integration something like opencv or face detect api that required to setup a canvas element .
    /**
     * get canvas
     */
    getCanvas() {
      let video = this.$refs.video;
      if (!this.ctx) {
        let canvas = document.createElement("canvas");
        canvas.height = video.videoHeight;
        canvas.width = video.videoWidth;
        this.canvas = canvas;
        this.ctx = canvas.getContext("2d");
      }
      const { ctx, canvas } = this;
      ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
      return canvas;
    }

so is that possible to add a property something like 'canvasEl'

canvasEl: {
      type: Object,
      default: null
    },

so change code into something like this:

if(this.$refs.canvasEl !==null){
	let canvas = this.$refs.canvasEl
}

@nickfan
Copy link
Author

nickfan commented Aug 12, 2020

i created a PR for this, maybe it could be helpful.
#62

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant