request front facing camera

This commit is contained in:
wryk 2019-03-10 06:34:37 +01:00
parent 2b89fba51a
commit 7f985963b7

View file

@ -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)
})