Since there were several questions that this sample doesn't work, I checked myself again.
Indeed, it seems to be broken, out-of-the-box.
I did the following to get it running:
- re-create the project under Rx10.4
- add the Main unit to the project
- check the Project/Forms tab, the main form should be auto-created
- Removing all unnecessary permissions and entitlements, keeping just Camera permission
- For some reason in uMain.pas, this line needed to be added.
I have not cxhecked the orginal file again, but maybe there was some non-standard form creation.
//21.08.20 added
var
CameraComponentForm : TCameraComponentForm;
- For testing before, I moved the first creation, until the Camera shall be really started.
This shouldn't be necessary, but I did that for testing to decouple the actions a little, und keep it in my final.
That means you have to press START twice, 1. Get Resolutions, 2. Start camera
procedure TCameraComponentForm.FormCreate(Sender: TObject);
begin
//21.08.20 PermissionsService.RequestPermissions([PermissionCamera], AccessCameraPermissionRequestResult, DisplayRationale);
...
procedure TCameraComponentForm.btnStartCameraClick(Sender: TObject);
begin
//21.08.20 Try get resolutions here at first
if cbResolutions.Items.Count = 0 then
PermissionsService.RequestPermissions([PermissionCamera], AccessCameraPermissionRequestResult, DisplayRationale)
else //only then start the camera with 2nd click
PermissionsService.RequestPermissions([PermissionCamera], ActivateCameraPermissionRequestResult, DisplayRationale);
end;
Et voilâ, camera is working for me.
I made some comments already, that I think the non-working samples and demos are a MAJOR SHOWSTOPPER,
especially for new customers.
If Embarcadero is making a trial, and CE version, they should better take most care that all samples will run out-of-the-box.
If new customers trying new tools are a little bit like me,
I will DROP the new tools immediately if I cannot get the basic demos and hello worlds running without major quirks.
Thats my proof or quality for any software or tool.
So its Embarcadero's marketing decision, not mine.