From bcf1dc9b526b1d88e84b482574aae01564383b03 Mon Sep 17 00:00:00 2001 From: wryk Date: Fri, 15 Mar 2019 20:43:34 +0100 Subject: [PATCH] fix(capture): enable/disable capture button --- src/store.js | 2 ++ src/views/screens/capture.vue | 9 +++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/store.js b/src/store.js index ef97b1b..4282fce 100644 --- a/src/store.js +++ b/src/store.js @@ -40,6 +40,8 @@ export default new Vuex.Store({ if (state.mediaStream) { state.mediaStream.getTracks().forEach(track => track.stop()) } + + state.mediaStream = null }, inverseFacingMode (store) { store.capturing.shouldFaceUser = !store.capturing.shouldFaceUser diff --git a/src/views/screens/capture.vue b/src/views/screens/capture.vue index b4dd008..4ac70b8 100644 --- a/src/views/screens/capture.vue +++ b/src/views/screens/capture.vue @@ -6,10 +6,10 @@
- +
- + @@ -44,6 +44,11 @@ export default { this.$store.dispatch('capture') } }, + watch: { + mediaStream: function (mediaStream) { + this.$refs.preview.srcObject = mediaStream + } + }, mounted: function () { window.objectFitPolyfill(this.$refs.preview) document.body.classList.add('capture-body')