From 7f985963b7e6334b4810e69772b3ba3fe8f8d835 Mon Sep 17 00:00:00 2001 From: wryk Date: Sun, 10 Mar 2019 06:34:37 +0100 Subject: [PATCH] request front facing camera --- src/store.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/store.js b/src/store.js index d2ff883..db0453f 100644 --- a/src/store.js +++ b/src/store.js @@ -65,7 +65,14 @@ export default new Vuex.Store({ }, actions: { requestCamera ({ commit }) { - navigator.mediaDevices.getUserMedia({ video: true, audio: false }) + const constaints = { + video: { + facingMode: 'user' + }, + audio: false + } + + navigator.mediaDevices.getUserMedia(constaints) .then(mediaStream => { commit('updateMediaStream', mediaStream) })