fix(capture): preview is now available after back

This commit is contained in:
wryk 2019-03-18 11:17:31 +01:00
parent 9691a18ac1
commit c2361f5a7c

View file

@ -42,14 +42,18 @@ export default {
methods: { methods: {
startCapture () { startCapture () {
this.$store.dispatch('capture') this.$store.dispatch('capture')
},
updatePreviewMediaStream() {
this.$refs.preview.srcObject = this.mediaStream
} }
}, },
watch: { watch: {
mediaStream: function (mediaStream) { mediaStream: function (mediaStream) {
this.$refs.preview.srcObject = mediaStream this.updatePreviewMediaStream()
} }
}, },
mounted: function () { mounted: function () {
this.updatePreviewMediaStream()
window.objectFitPolyfill(this.$refs.preview) window.objectFitPolyfill(this.$refs.preview)
document.body.classList.add('capture-body') document.body.classList.add('capture-body')
}, },