Screen Sharing is not working on Safari after a couple of times

Description
I’m encountering an issue with the share screen on Safari. When I’m in a session, the first few times it works, but if i turn it on and off, eventually it doesn’t anymore. The shared screen is appearing on Safari (the sender), but not on the receiving side (Chrome, Safari). After about 30 seconds, i get an “OPERATION_TIMEOUT” error on the receiving browser after calling startShareView. On Safari, eventually, it says I’m out of memory and it stops working (I also added a listener on active-media-failed). I have SharedArrayBuffer enabled and I’m using different canvases for viewing/sharing.

Also, in the recording, the share appears blank

Browser Console Error
On the receiving browser:
{
“type”: “OPERATION_TIMEOUT”
}

On Safari:

[Warning] Aborted() (a90dd0d6-f707-4b25-99a2-67db8931a989, line 1)

[Log] >>> Set_Share_Mode_js (0c2df656-ea0d-4388-ac71-d05f5bced12a, line 1)

[Error] Unhandled Promise Rejection: RuntimeError: Aborted(). Build with -sASSERTIONS for more info.

abort (a90dd0d6-f707-4b25-99a2-67db8931a989:1:8872)

_abort (a90dd0d6-f707-4b25-99a2-67db8931a989:1:104991)

<?>.wasm-function[12113] <?>.wasm-function[10738] <?>.wasm-function[3683] <?>.wasm-function[3688] <?>.wasm-function[3690] <?>.wasm-function[4550] <?>.wasm-function[733] <?>.wasm-function[350]

(anonymous function) (a90dd0d6-f707-4b25-99a2-67db8931a989:1:135274)

(anonymous function) (0c2df656-ea0d-4388-ac71-d05f5bced12a:1:298488)

Br (0c2df656-ea0d-4388-ac71-d05f5bced12a:1:298543)

(anonymous function) (0c2df656-ea0d-4388-ac71-d05f5bced12a:1:301794)

[Log] {payload: {message: “Uh-oh! You’re running low on memory. Please close all browsers and rejoin the meeting.”, type: “video”, code: 205}} (main.402b6bc6589639f1.js, line 102482)

[Log] {payload: {message: “Oops! Something went wrong. Please close all browsers and rejoin the meeting.”, type: “sharing”, code: 301}} (main.402b6bc6589639f1.js, line 102482)

Web Video SDK version
2.1.0 (but was also happening on the previous version)

Video SDK Code Snippets

const shareScreenHandler = async (payload: {
  state: 'Active' | 'Inactive';
  userId: number;
}) => {
  if (!screenShareViewCanvasContainerRef.current) return;

  if (payload.state === 'Active') {
    try {
      setIsScreenShareLoading(true);
      setIsViewingScreenShare(true);

      await stream.startShareView(
        screenShareViewCanvasContainerRef.current,
        payload.userId
      );

      setIsScreenShareLoading(false);
    } catch (error) {
      setIsViewingScreenShare(false);
      setIsScreenShareLoading(false);

      showToast({
        variant: 'error',
        messageBody: 'Cannot view share screen.',
      });

      console.log(error);
    }
  } else if (payload.state === 'Inactive') {
    try {
      await stream.stopShareView();

      setIsViewingScreenShare(false);
    } catch (error) {
      console.log(error);
    }
  }
};

const activeMediaFailedHandler = (payload: any) => {
  console.log({ payload });
};

zoomClient.on('active-media-failed', activeMediaFailedHandler);
zoomClient.on('active-share-change', shareScreenHandler);

To Reproduce
Steps to reproduce the behavior:

  1. Open Safari & Chrome
  2. Share & stop sharing from Safari continuously for about 1 min (this is the only way i was able to reproduce it, although some of our users have been able to reproduce this issue from the second or third try)

Device:

  • Device: Macbook Pro
  • OS: macOS 15.1
  • Browser: Safari
  • Browser Version: 18.1

Hey @liviu

Thanks for your feedback.

We are aware of this issue and are continuously working on improvements.

Could you share some problematic session IDs with us? It would greatly help us efficiently pinpoint the issue.

Thanks
Vic

Hey @vic.yang

Some session IDs with this issue: oRFz5lAeQhe3WGtXetJqwg==, Z0w5ZQfYSNWmJQ2Lw1CUwg==, G2cBt/TaSLCot6AWxKeqwQ==

In the meantime, have you found any workaround for this?

Hi @liviu,

Has upgrading to the latest version of the Video SDK solved this issue for you?

Hi @rehema.zoom,

Upgrading to version 2.1.5 hasn’t solved the issue. If anything, I get the “You’re running low on memory” and "Something went wrong " errors even quicker.

Hey @liviu

Thanks for sharing the issue with us.

Could you help enable the WebRTC mode of the Video SDK and try again?

Use version 2.1.0 or 2.1.5, and set the video_webrtc_mode field to 1 in the JWT. WebRTC mode consumes less CPU and memory, providing better performance.

Thanks
Vic

Hello @vic.yang !

Setting the video_webrtc_mode field to 1 in the JWT didn’t help. Additionally, I managed to replicate this issue on Firefox as well.

Another way to reproduce the screen sharing bug, apart from the initial provided steps, is to let the screen sharing on (from Safari/Firefox) for about 15 minutes. On Safari it will automatically refresh the page because of the lack of memory. On Firefox you need to stop and start the share and it will fail.

Hey @liviu

Sorry to bother you again.

Could you share the session ID where you encountered this issue while using version 2.1.5 for further investigation?

Thanks
Vic

Hi @vic.yang

Session on Safari: LDw0JQ8kSIWlnpqCTYiPWA== (crashed after ~5 mins)
Session on Firefox: hPnAJvYxThyZwam8rfvLDA==

Hey @vic.yang !

Just keeping this topic alive. Any progress on this?

Hey @liviu

Thanks for tracking this issue.

We have released Video SDK Web 2.1.10, which includes memory usage improvements. Could you upgrade to this version and try again?

If you encounter any issues, please reach out to us.

Thanks
Vic

Hey @vic.yang !

Sorry for the late reply, No, it isn’t fixed with the latest version. Still happening on Video SDK Web 2.1.10 with WebRTC audio and video enabled

Hi,

Jumping in here, as well. There are 2 issues that we can see:

  1. To begin with, the app uses a lot more RAM than I’d anticipate or consider normal. It usually functions in a 2GB memory envelope in Safari when using sharescreen.
  2. The memory usage is kept in check by very frequent garbage collections

Sometimes, something, like a long running method, determines the GC to be delayed, and then the memory usage escapes this envelope and that’s when Safari sometimes decides it’s had enough and crashes/refreshes the page without any user intervention.

I have screenshots, but this gives me an error if I want to upload them or include links in my posts.. :face_with_raised_eyebrow:
Just put an h in front of these:
ttps://ibb.co/svThRmqj
ttps://ibb.co/nMpX3Zf5

Other times, but that’s harder to reproduce, it outright looks like a memory leak:
ttps://ibb.co/6cCrCc7j

Hi @sorin.upgrade, I just wanted to let you know we’re still looking into this. Thanks for your patience!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.