Skip to content

Instantly share code, notes, and snippets.

@justinyoo
Created March 2, 2017 23:31
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 justinyoo/a277ae55ccab65a95bb8ad3160d0e1dd to your computer and use it in GitHub Desktop.
Save justinyoo/a277ae55ccab65a95bb8ad3160d0e1dd to your computer and use it in GitHub Desktop.
Accessing to Camera on Mobile Devices from Vue.js + TypeScript + ASP.NET Core Applications
mounted (): void {
this._refs = <any>this.$refs;
this._video = <HTMLVideoElement>this._refs.video;
var md: MediaDevices = this.getMediaDevices();
md.getUserMedia({ video: true })
.then((stream) => {
this.src = window.URL.createObjectURL(stream);
this._stream = stream;
this._hasUserMedia = true;
}, (err) => {
console.log(err);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment