Description
In Chrome, the preview camera feature is NOT throwing an error, when the camera is already in use by another app (or) if camera permission is denied to the browser by the host OS settings.
Accessing camera in actual calls throw an error successfully for the above mentioned situations, but the preview doesn’t throw an error.
Throwing an error will allow us to catch it and show appropriate error message to the user, but as of now there is no way to alert the user as no error is thrown by the web VideoSDK for preview camera.
Which Web Video SDK version?
2.1.0
Video SDK Code Snippets
// Actual Video Calls
try {
await stream.startVideo();
} catch (e) {
// handle error
// error received if camera is already in use (or)
// if camera system level permissions denied
}
// Preview Camera
try {
const localTrack = ZoomVideo.createLocalVideoTrack(camera.deviceId);
await localTrack.start(document.querySelector("#local-preview-video"));
// (OR)
await localTrack.switchCamera(camera.deviceId);
} catch (e) {
// NO error received if camera is already in use (or)
// if camera system level permissions denied
}
Additional context
Throwing the right error will help us to show appropriate error message or next steps to the user.
Please note, the above behavior is in Chrome. Also, while the happy paths work fine, the error case scenarios show different behavior/error messages for different browsers (Chrome vs Firefox).
Can we have preview camera to throw appropriate errors on error scenarios same as of actual video calls?
Is there any way to throw consistent error messages for all browsers?
We’ve been having the same issue where the preview camera does not start and is not throwing an error on chrome. The error of ‘permissions denied’ looks to be resolved but I believe in other cases, it still does not throw the error.
We have reports of this issue multiple times a week and randomly experience this ourselves in testing. When this happens, refreshing fixes the video preview, but we would like to have error handling functionality. We are on web videosdk version 2.3.0. Thanks in advance for your help
I’d like to understand further: when you use localVideoTrack for preview, which element are you using? a video player, a video element, or a canvas element?
Thank you for the update. I was wondering if you had the list of specific video capture errors that may be leading to this issue. It would be helpful to note the extent of the issue pending the next release.
After analysis, we believe a possible cause is similar to the video exceptions in the active-media-failed event. However, since the user is not yet in session, this event is not triggered.
We will improve the relevant exceptions in the local video track.