Skip to content

Commit 2f905b0

Browse files
1 parent 5c05b58 commit 2f905b0

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

app/webapp/controller/App.controller.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -932,7 +932,8 @@ sap.ui.define("z2ui5/CameraPicture", [
932932
id: { type: "string" },
933933
value: { type: "string" },
934934
press: { type: "string" },
935-
autoplay: { type: "boolean", defaultValue: true }
935+
autoplay: { type: "boolean", defaultValue: true },
936+
facingMode: { type: "string", defaultValue: "environment" }
936937
},
937938
events: {
938939
"OnPhoto": {
@@ -1001,12 +1002,12 @@ sap.ui.define("z2ui5/CameraPicture", [
10011002
setTimeout(function () {
10021003
var video = document.querySelector('#zvideo');
10031004
if (navigator.mediaDevices.getUserMedia) {
1004-
navigator.mediaDevices.getUserMedia({ video: { facingMode: { exact: "environment" } } })
1005+
navigator.mediaDevices.getUserMedia({ video: { facingMode: { exact: this.getProperty("facingMode") } } })
10051006
.then(function (stream) {
10061007
video.srcObject = stream;
10071008
})
10081009
.catch(function (error) {
1009-
console.log("Something went wrong!");
1010+
console.log("Something went wrong! " + error );
10101011
});
10111012
}
10121013
}.bind(this), 300);

0 commit comments

Comments
 (0)