- Home /
Unity WebGl does not free webcam when stopped
Good time of day, I want to make an image using the webcam. When I take image, call method texture.Stop(); but the camera is not freed anyway (white light is on). All work right in other platforms.
How to shut down a camera in WebGL?
The code method it taked image.
private void OnCaptureTake()
{
if (_captureImage.texture != null)
{
((WebCamTexture)_captureImage.texture).Stop();
OnTakeTexture.SafeInvoke(_captureImage);
_isOnClick = false;
_takeCaptureButton.SetActive(false);
_captureImage.gameObject.SetActive(false);
}
}
UPDATE
Link to the bug report on the unity bug report.
Comment