Cannot share screen using `window` or `screen` option. Throw error “INVALID_OPERATION” : reason: “user deny screen share”

Description
On certain Mac and Windows devices, screen sharing via the “Window” or “Screen” options does not work, while the “Tab” option functions correctly.

This is my session ID: SbeefzxiSnC/EZ/tTJegkA==

I would appreciate any help.

Browser Console Error

type:“INVALID_OPERATION” : reason: “user deny screen share”

Which Web Video SDK version?
2.1.0

Video SDK Code Snippets

      if (state.mediaStream.isStartShareScreenWithVideoElement()) {
        const videoElement = document.getElementById('zoom_share_screen_video');
        await state.mediaStream.startShareScreen(videoElement, {
          displaySurface: sourceId === undefined || sourceId === null ? 'window' : sourceId,
          hideShareAudioOption: true
        });
      } else {
        const canvasElement = document.getElementById('zoom_share_screen_canvas');
        await state.mediaStream.startShareScreen(canvasElement, {
          displaySurface: sourceId === undefined || sourceId === null ? 'window' : sourceId,
          hideShareAudioOption: true
        });
      }

Screenshots

Device (please complete the following information):

  • Browser: Edge/Chrome
  • OS: Mac/Win
  • Browser Version: 129, 134

This problem usually appears when the CPU of the machine increases.

Hey @lmtruong1512

Thanks for your feedback.

We are working on the root cause of the issue and will keep you updated.

Thanks
Vic

Hi @lmtruong1512

SbeefzxiSnC/EZ/tTJegkA==

Regarding the ‘user deny screen share’ error, based on our analysis of the session log, we suspect it might be due to the browser not being granted permission under System Settings → Privacy & Security → Screen & System Audio Recording. This could result in the ability to share only a screen tab but not a window or monitor.

Could you help confirm if this is the cause?

As for the error mentioned in the screenshot, it does not affect the screen sharing functionality.

Thanks
Vic

Hi @vic.yang,

Thank you for the information.

Regarding the ‘user deny screen share’ error, we have already verified that the necessary permissions are enabled under System Settings → Privacy & Security → Screen & System Audio Recording. Therefore, this may not be the cause of the issue.

As for the error shown in the screenshot, this was captured by my customer after they were unable to share their screen. If this error is unrelated to the screen-sharing function, could you clarify which functions it might be related to?

Thank you very much!

Hi @lmtruong1512

Thanks for sharing the feedback with us.

We attempted to reproduce a similar issue locally. We were able to share a Chrome tab, but could not share a window or application due to system permissions not being granted, resulting in the same behavior.

Could you please help by testing with the WebRTC official demo to see if sharing works properly?

As for the error shown in the screenshot, it is related to video. It might be due to failing to allocate more memory, which could cause the issue with the video freeze.

Thanks
Vic

Hi @vic.yang,

Regarding the ‘user deny screen share’ error, this issue only occurs when CPU and memory usage are too high. Since it happens rarely, we haven’t been able to consistently reproduce it for testing with the WebRTC official demo. If we encounter it again, we will try it. Could this be related to this issue, where high CPU and memory usage cause startShareScreen to take too long, triggering other events in between and resulting in the error—not directly caused by a user gesture?

Additionally, we are also facing a video freeze issue reported by our customer, but we don’t have a session ID for it. Here’s a related case: Canvas video occasionally freezes. Is there any solution or upgrade available to address this problem?

Thanks!

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