Which browser are you using on your ttablet? Normally there should not be any problems as long as you stop the camera first and select a device from the list before starting the camera again. Can you provide a minimal sample project that reproduces this?
I added the web project in the attachment.
Is not very big but the screen switch from front to rear
does not always display an image. Only after switching several times.
(in this version it happened better but still too often!)
System Environment: Samsung Galaxy Tab Active3
Do you have an explanation or a solution?
Thank you for your effort!
It looks like there seems to be a confusion about TWebCamera.CameraType in your project.
ctFront: This is used to get the default front camera. Some devices might be equipped with multiple front cameras, the browser picks one by default, we have no influence over this.
ctRear: This is used to get the default rear facing camera. Just as with the front facing camera, the browser picks one by default and we cannot influence this. This can be a problem if you have multiple back facing cameras that are of different types (wide-lens, macro, etc...).
None of the types above should be used in combination with SetSelectedCameraDevice. The fact that it works in your project could be just coincidence. There's a 3rd type:
ctSelected: This is what you actually need to set the camera type to if you are planning on using SetSelectedCameraDevice. With this you are telling the component to stop trying to get a default camera but use the one you select.
Try changing the CameraType in your project to ctSelected and see if it improves the behavior.
Thanks for the tip, but I've done that before. But always had a problem.
I solved it as follows, not pretty but works!
---> by a WebCamChange
---> after is WebCameraCameraDevicesInitialized event
if camState = Front then
WebCamera.CameraType := ctFront;
WebCamera.CameraType := ctRear;