Skip to content

Commit 2643acf

Browse files
auto-bsp-changes
1 parent 35adf3a commit 2643acf

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/02/z2ui5.wapa.controller_-app.controller.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -922,7 +922,7 @@ sap.ui.define("z2ui5/SmartMultiInputExt", ["sap/ui/core/Control", "sap/m/Token",
922922
sap.ui.define("z2ui5/CameraPicture", [
923923
"sap/ui/core/Control",
924924
"sap/m/Dialog",
925-
"sap/m/Button",
925+
"sap/m/Button",
926926
"sap/ui/core/HTML"
927927
], function (Control, Dialog, Button, HTML) {
928928
"use strict";
@@ -932,6 +932,8 @@ sap.ui.define("z2ui5/CameraPicture", [
932932
id: { type: "string" },
933933
value: { type: "string" },
934934
press: { type: "string" },
935+
width: { type: "string" , defaultValue: 200 },
936+
height: { type: "string" , defaultValue: 200 },
935937
autoplay: { type: "boolean", defaultValue: true },
936938
facingMode: { type: "string" },
937939
deviceId: { type: "string" }
@@ -953,8 +955,8 @@ sap.ui.define("z2ui5/CameraPicture", [
953955
var video = document.querySelector("#zvideo");
954956
var canvas = document.getElementById('zcanvas');
955957
var resultb64 = "";
956-
canvas.width = 200;
957-
canvas.height = 200;
958+
canvas.width = parseInt( this.getProperty("width") );
959+
canvas.height = parseInt( this.getProperty("height") );
958960
canvas.getContext('2d').drawImage(video, 0, 0, 200, 200);
959961
resultb64 = canvas.toDataURL();
960962
this.setProperty("value", resultb64);
@@ -976,7 +978,7 @@ sap.ui.define("z2ui5/CameraPicture", [
976978
content: [
977979
new HTML({
978980
id: this.getId() + 'PictureContainer',
979-
content: '<video width="600px" height="400px" autoplay="true" id="zvideo">'
981+
content: '<video width="' + this.getProperty("width") + 'px" height="' + this.getProperty("height") + 'px" autoplay="true" id="zvideo">'
980982
}),
981983
new Button({
982984
text: "Capture",
@@ -1039,6 +1041,7 @@ sap.ui.define("z2ui5/CameraPicture", [
10391041
});
10401042
});
10411043

1044+
10421045
sap.ui.define("z2ui5/CameraSelector", [
10431046
"sap/m/ComboBox",
10441047
"sap/ui/core/Item",

0 commit comments

Comments
 (0)