Create a gist now

Instantly share code, notes, and snippets.

@justinyoo /Hello-3.ts Secret
Created Mar 2, 2017

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