An issue with screen sharing in Safari.
The issue occurs only in Safari.
Screen sharing works fine in all other browsers.
When using screen sharing in Safari, a WebSocket connection failure occurs:
In “socket.io-client” we get the ‘disconnect’ event, and in Zoom, we also get the ‘network-quality-change’ event with a level value of 0. This happens after about 30 seconds of using screen sharing in Safari
const onScreenShareClick = useCallback(async () => {
if (isScreenSharing) return;
const selfShareCanvas = document.getElementById(mediaStream.isStartShareScreenWithVideoElement() ? SELF_SHARE_VIDEO : SELF_SHARE_CANVAS);
if (mediaStream?.getShareStatus() === ShareStatus.End && selfShareCanvas) {
await mediaStream?.startShareScreen(selfShareCanvas, {
optimizedForSharedVideo: true,
});
}
closeControl();
}, [mediaStream, isScreenSharing]);
import { io } from "socket.io-client";
...
const socket = io(url, {
secure: !isLocalhost,
transports: ['websocket', 'polling', 'flashsocket']
});
socket.on('disconnect', (reason) => {
console.info(`Socket was disconnected because ${reason}`);
});
Socket was disconnected because ping timeout
zmClient.on('network-quality-change', onNetworkChange);
const onNetworkChange = useCallback((payload) => {
const { userId, type, level } = payload;
const currentUserId = zmClient.getSessionInfo().userId;
if (currentUserId === userId) {
const data = {
date: Date.now(),
networkQualityLevel: level
};
if (level === 0) {
store.dispatch(sendZoomStatistics({
networkQualityLevelData: data,
method: 'FE useParticipantNetworkQualityLevel',
message: 'NetworkQualityLevel is equal to 0',
}, 'Network Quality Level'));
}
networkQualityLevelDataRef.current = [
...networkQualityLevelDataRef.current,
data
];
}
...
}, [zmClient]);
SharedArrayBuffer is disabled
Zoom Video SDK 1.11.6
React 17.0.2
socket.io-client: 4.7.5
OS: macOS Sonoma 14.4
Browser: Safari Version 17.4