mirror of
https://github.com/GuerillaStudio/souvenir.git
synced 2025-01-20 18:50:21 +00:00
request front facing camera
This commit is contained in:
parent
2b89fba51a
commit
7f985963b7
1 changed files with 8 additions and 1 deletions
|
@ -65,7 +65,14 @@ export default new Vuex.Store({
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
requestCamera ({ commit }) {
|
requestCamera ({ commit }) {
|
||||||
navigator.mediaDevices.getUserMedia({ video: true, audio: false })
|
const constaints = {
|
||||||
|
video: {
|
||||||
|
facingMode: 'user'
|
||||||
|
},
|
||||||
|
audio: false
|
||||||
|
}
|
||||||
|
|
||||||
|
navigator.mediaDevices.getUserMedia(constaints)
|
||||||
.then(mediaStream => {
|
.then(mediaStream => {
|
||||||
commit('updateMediaStream', mediaStream)
|
commit('updateMediaStream', mediaStream)
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue