There’s a mistake in the generation of the reference document, the CaptureVideoOption is the type definition of the startVideo option. If you use the Video SDK via npm, there is a type hint.
P.S.
I will paste the option definition below:
interface CaptureVideoOption {
/**
* Id of the camera for capturing the video, if not specified, use system default
*/
cameraId?: string | MobileVideoFacingMode;
/**
* Customized width of capture, 640 as default
*/
captureWidth?: number;
/**
* Customized height of capture, 360 as
*/
captureHeight?: number;
/**
* Is self video mirrored
*/
mirrored?: boolean;
/**
* video element, only used in android platform or non-SharedArrayBuffer Chromium-like browser
*/
videoElement?: HTMLVideoElement;
/**
* Is capture 720P video
*/
hd?: boolean;
/**
* virtual background option
*/
virtualBackground?: {
/**
* image url for virtual background
* - If set a specific image, the url can be a regular http|https url, base64 format or ObjectURL
* - 'blur' : blur your background
* - undefined : no virtual backround
*/
imageUrl: string | 'blur' | undefined;
/**
* cropping the background image to an appropriate aspect ratio(16/9), default is false
*/
cropped?: boolean;
};
}
why does the device-change event get called when switching the microphone?
Because in the documentation, it is clearly mentioned that this event will get called only when some device is plugged or unplugged from the system.
If I call the muteShareAudio function just after startShareScreen then it is not working at all.
If I call this function in the share-audio-change event then it is working, but it is throwing an error - {type: 'INTERNAL_ERROR'}
and I think because of this error getShareAudioStatus is giving the value of isShareAudioMuted as false.
but in actuality, the shared tab audio is muted.
NOTE: Here I am Sharing the screen with the tab audio
Can you please look into this once?
Also, I request you to please work on your documentation, it has a lot of issues.
Like, in the chat section, to send a message to a specific participant, the “sendMessage” function is mentioned there, but it throws an error of “sendMessage is not a function”.
“send” is the actual function to do that.
In Video SDK, the microphone and chrome tab audio cannot work at the same time so far. As this article introduced, we provide the ‘share-audio-change’ event to notify the update.
The reason for sharing the details about the event is that after sharing the screen if I am calling muteShareAudio then I should have gotten a new event of { state: ‘off’ }
But I am not getting that, that means the tab audio is not muted.
Also, I found another issue: if I call startAudio() function without the microphone permission allowed in the browser, it throws an error of “USER_FORBIDDEN_MICROPHONE”.
But if I call this function again, it is not throwing any error.