I think that saving a file from a web app will always save to the Downloads folder (otherwise a website could compromise the local file system).
The attached is a small improvement. There is a new WebCamera fcpx component, and the ".fcweb" file is an example that sets the aspect ratio of the snapshot image to the same as the video and also saves the image (to the "Downloads" folder).
App Developer: USB Webcam Component
-
Steve-Matrix
- Matrix Staff
- Posts: 1935
- http://meble-kuchenne.info.pl
- Joined: Sat Dec 05, 2020 10:32 am
- Has thanked: 289 times
- Been thanked: 452 times
Re: App Developer: USB Webcam Component
- Attachments
-
- WebCamera.fcpx
- (3.32 KiB) Downloaded 25 times
-
- WebCamera.fcweb
- (18.79 KiB) Downloaded 24 times
-
stefan.erni
- Valued Contributor
- Posts: 1251
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 231 times
- Been thanked: 250 times
Re: App Developer: USB Webcam Component
it's working very nice
The buttons can also be placed in the image, also the photo you've taken can be smal in the imagel.
To save the photo immediately, all I have to do is enter the macro command.
Autosave: The files are perfect.
I have a small problem with the time—it's showing two hours too early, and I haven't been able to find a setting to fix it.
The buttons can also be placed in the image, also the photo you've taken can be smal in the imagel.
To save the photo immediately, all I have to do is enter the macro command.
Autosave: The files are perfect.
I have a small problem with the time—it's showing two hours too early, and I haven't been able to find a setting to fix it.
-
Steve-Matrix
- Matrix Staff
- Posts: 1935
- Joined: Sat Dec 05, 2020 10:32 am
- Has thanked: 289 times
- Been thanked: 452 times
Re: App Developer: USB Webcam Component
Thanks, Stefan.
The date is UTC. Here is some code that will hopefully set the filename to the local time. This will replace the code int he first icon in the OnSaveImageClick macro.
The new lines are the 2 after the comment "adjust for local time".
The date is UTC. Here is some code that will hopefully set the filename to the local time. This will replace the code int he first icon in the OnSaveImageClick macro.
Code: Select all
var currentdate = new Date();
//adjust for local time
var offset = currentdate.getTimezoneOffset();
currentdate.setTime(currentdate.getTime() - (offset*60*1000));
FCL_SFILENAME = currentdate.toISOString();
FCL_SFILENAME = FCL_SFILENAME.replaceAll("T", "_");
FCL_SFILENAME = FCL_SFILENAME.replaceAll(":", "-");
FCL_SFILENAME = FCL_SFILENAME.substring(0, 19);
FCL_SFILENAME = "PIC_" + FCL_SFILENAME + ".png"
The new lines are the 2 after the comment "adjust for local time".
-
chipfryer27
- Valued Contributor
- Posts: 2008
- Joined: Thu Dec 03, 2020 10:57 am
- Has thanked: 441 times
- Been thanked: 656 times
Re: App Developer: USB Webcam Component
Hi Steve / Stefan
Very interesting posts.
Keen to hear more on how you get on as I think this will be a great component once released.
Regards
Very interesting posts.
Keen to hear more on how you get on as I think this will be a great component once released.
Regards
-
stefan.erni
- Valued Contributor
- Posts: 1251
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 231 times
- Been thanked: 250 times
Re: App Developer: USB Webcam Component
Hi Steve, Hi Lain
Yes, that's a useful feature and it works well.
The time is correct now.
It would also be helpful if I could send a command from the PC App to the Web App to take the photo.
Both programs are running on the same computer.
Yes, that's a useful feature and it works well.
The time is correct now.
It would also be helpful if I could send a command from the PC App to the Web App to take the photo.
Both programs are running on the same computer.
-
Steve-Matrix
- Matrix Staff
- Posts: 1935
- Joined: Sat Dec 05, 2020 10:32 am
- Has thanked: 289 times
- Been thanked: 452 times
Re: App Developer: USB Webcam Component
This may not be possible due to the way web browser security works. Activity such as using the camera and saving files cannot be automatic and must be initiated via a user gesture (e.g. a mouse click).
-
stefan.erni
- Valued Contributor
- Posts: 1251
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 231 times
- Been thanked: 250 times
Re: App Developer: USB Webcam Component
Hi Steve
If two cameras are connected, would it also be possible to choose which one to use?
Would it also be possible to record a video?
Only about 60 seconds long.
If two cameras are connected, would it also be possible to choose which one to use?
Would it also be possible to record a video?
Only about 60 seconds long.
-
Steve-Matrix
- Matrix Staff
- Posts: 1935
- Joined: Sat Dec 05, 2020 10:32 am
- Has thanked: 289 times
- Been thanked: 452 times
Re: App Developer: USB Webcam Component
I think when the web app asks for permission, you can choose the camera then.
I have just created a project which records and saved a video, so yes it can. But it has thrown up various issues. I will try to allocate some time to fix these issues over the next few days.
I have just created a project which records and saved a video, so yes it can. But it has thrown up various issues. I will try to allocate some time to fix these issues over the next few days.
-
stefan.erni
- Valued Contributor
- Posts: 1251
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 231 times
- Been thanked: 250 times
Re: App Developer: USB Webcam Component
Hi Steve
Firefox ask for permission, and which camera Edge ask for permission, but not for which camera For the Edge The camera you can choose if you type in edge line_
So I can use 2 cameras at the same time
“Record Video” will be missing soon
Firefox ask for permission, and which camera Edge ask for permission, but not for which camera For the Edge The camera you can choose if you type in edge line_
I added a second camera to the Web Appedge://settings/content/camera
So I can use 2 cameras at the same time
“Record Video” will be missing soon