mirror of
https://github.com/GuerillaStudio/souvenir.git
synced 2024-11-09 16:31:52 +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: {
|
||||
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)
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue