From c2361f5a7c165e6818d2b3cb0542fddb45cb50bd Mon Sep 17 00:00:00 2001 From: wryk Date: Mon, 18 Mar 2019 11:17:31 +0100 Subject: [PATCH] fix(capture): preview is now available after back --- src/views/screens/capture.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/views/screens/capture.vue b/src/views/screens/capture.vue index 4ac70b8..2118874 100644 --- a/src/views/screens/capture.vue +++ b/src/views/screens/capture.vue @@ -42,14 +42,18 @@ export default { methods: { startCapture () { this.$store.dispatch('capture') + }, + updatePreviewMediaStream() { + this.$refs.preview.srcObject = this.mediaStream } }, watch: { mediaStream: function (mediaStream) { - this.$refs.preview.srcObject = mediaStream + this.updatePreviewMediaStream() } }, mounted: function () { + this.updatePreviewMediaStream() window.objectFitPolyfill(this.$refs.preview) document.body.classList.add('capture-body') },