a call to StartRecording() results in an unhandled null reference exception when the webcam has been disabled. (this is not the case when other webcam errors occur, like when the webcam is taken by another application).
Our application provides a fallback scenario to make an audio recording when the webcam is not available, in order for this to work it would be preferable to be able to call the StartRecording() method without causing a crash, and to still have the RecordingStarted event triggered, just like in the case of a "camera unavailable" error.
I am glad this works for you, Xavier.
Regards,
Ivan Petrov
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.
Hi Xavier,
I can confirm the discrepancy in the behavior in these two cases.
As a workaround I can suggest you check the RadWebCam's HasError property inside the StartRecording event handler and setting the Cancel property of the event arguments to true if there is an error. This will prevent the execution of the code that throws the exception. Here is a code snippet:
private void Camera_RecordingStarted(object sender, RecordingStartedEventArgs e)
{
if (this.camera.HasError)
{
e.Cancel = true;
}
}
Regards,
Ivan Petrov
Progress Telerik
Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.