Comparing version 1.0.0 to 2.0.0
{ | ||
"name": "vue-webcam", | ||
"version": "1.0.0", | ||
"version": "2.0.0", | ||
"description": "A Vue component for capturing image from webcam.", | ||
@@ -24,4 +24,4 @@ "main": "VueWebcam.js", | ||
"peerDependencies": { | ||
"vue": "^1.0.26" | ||
"vue": ">=2.0.0" | ||
} | ||
} |
const Vue = require('vue'); | ||
const WebcamComponent = Vue.extend({ | ||
render: function (h) { | ||
return h('video', { | ||
ref: 'video', | ||
attrs: { | ||
width: this.width, | ||
height: this.height, | ||
src: this.src, | ||
autoplay: this.autoplay, | ||
style: this.styleObject | ||
} | ||
}); | ||
}, | ||
props: { | ||
@@ -26,12 +38,2 @@ autoplay: { | ||
}, | ||
template: ` | ||
<video | ||
v-el:video | ||
:width="width" | ||
:height="height" | ||
:src="src" | ||
:autoplay="autoplay" | ||
:style="styleObject" | ||
></video> | ||
`, | ||
data () { | ||
@@ -83,3 +85,3 @@ return { | ||
}, | ||
ready () { | ||
mounted: function () { | ||
this.video = this.$els.video; | ||
@@ -98,3 +100,3 @@ navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia || navigator.oGetUserMedia; | ||
}, | ||
beforeDestroy () { | ||
beforeDestroy: function () { | ||
this.video.pause(); | ||
@@ -104,3 +106,3 @@ this.src = ''; | ||
}, | ||
destroyed () { | ||
destroyed: function () { | ||
console.log('Destroyed'); | ||
@@ -110,4 +112,2 @@ } | ||
const VueWebcam = Vue.component('vue-webcam', WebcamComponent); | ||
module.exports = VueWebcam; | ||
module.exports VueWebcam = Vue.component('vue-webcam', WebcamComponent); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5219
99