Description
I have microphone permissions and I await startAudio after starting meeting. It unmutes the user. After that if I try to mute user, 1/10 times it gives me an error, INVALID_OPERATION: no audio joined. How can I confirm if audio is joined before muting the user ?
Browser Console Error
{type: ‘INVALID_OPERATION’, reason: ‘no audio joined’}
Which Web Video SDK version?
Video SDK- 1.5.5
Video SDK Code Snippets
const muteLocalTile = useCallback(async () => {
try {
await zmStream.current.muteAudio();
} catch (e) {
console.log(e)
}
}, []);
const startAudio = useCallback(async () => {
if (isSafari) {
if (audioDecode.current && audioEncode.current) {
await zmStream.current.startAudio();
isAudioStarted.current = true;
} else {
logger.info('desktop safari audio init has not finished');
}
} else {
await zmStream.current.startAudio();
isAudioStarted.current = true;
}
}, [isSafari, logger]);
const startMeeting = useCallback(
async ({ meetingInfo }) => {
try {
await zmClient.current.join(meetingInfo.sessionName, meetingInfo.token, name, meetingInfo.passcode);
} catch (error) {
console.log(e)
}
zmStream.current = zmClient.current.getMediaStream();
if (!isSafari) {
try {
await startAudio();
} catch (e) {
console.error(e);
}
}
await validateConfigOnMeetingInit();
try {
zmClient.current.getAllUser().forEach(user => {
if (
user.bVideoOn &&
user.userId !== zmClient.current.getCurrentUserInfo().userId &&
remoteCanvasRef.current
) {
zmStream.current?.renderVideo(remoteCanvasRef.current, user.userId, 960, 540, 0, 0, 2);
}
});
} catch (e) {
console.error(e);
}
},
[ isSafari, name, startAudio, validateConfigOnMeetingInit]
);
const validateConfigOnMeetingInit = useCallback(async () => {
if (isAudioStarted.current && !micEnabled) {
try {
await muteLocalTile();
} catch (e) {
updateConfiguration({ type: ACTION_TYPES.UNMUTE });
}
}
}, [ updateConfiguration, muteLocalTile, micEnabled]);
To Reproduce(If applicable)
The issue is intermittent, happens on starting a meeting with mute configuration.
Screenshots
NA
Troubleshooting Routes
NA
Device (please complete the following information):
- Device: MacBook Pro
- OS:12.2.1 (21D62)
- Browser: Safari
- Browser Version: 15.3 (17612.4.9.1.8)
Additional context
sessionId: “bPNiByxHQFeUNViiCAAVJw==”
participantId: 83887104