# Cannot share screen using \`window\` or \`screen\` option. Throw error “INVALID\_OPERATION” : reason: “user deny screen share”

**URL:** <https://devforum.zoom.us/t/cannot-share-screen-using-window-or-screen-option-throw-error-invalid-operation-reason-user-deny-screen-share/129685>\
**Category:** Web\
**Created:** [March 11, 2025, 8:21am UTC](https://devforum.zoom.us/t/cannot-share-screen-using-window-or-screen-option-throw-error-invalid-operation-reason-user-deny-screen-share/129685 "2025-03-11T08:21:49Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![lmtruong1512](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/lmtruong1512/32/59233_2.png) [@lmtruong1512](https://devforum.zoom.us/u/lmtruong1512)\
**Post date:** [March 11, 2025, 8:21am UTC](https://devforum.zoom.us/t/cannot-share-screen-using-window-or-screen-option-throw-error-invalid-operation-reason-user-deny-screen-share/129685/1 "2025-03-11T08:21:49Z")

</div>

**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**

```auto
      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**

 ![image (169)](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/9/d/9dfde253c9294ad885979f63b4e0b0fd5b6a12f0.png)

**Device (please complete the following information):**

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

---

<div class="post-metadata">

**Author:** ![lmtruong1512](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/lmtruong1512/32/59233_2.png) [@lmtruong1512](https://devforum.zoom.us/u/lmtruong1512)\
**Post date:** [March 12, 2025, 3:17am UTC](https://devforum.zoom.us/t/cannot-share-screen-using-window-or-screen-option-throw-error-invalid-operation-reason-user-deny-screen-share/129685/2 "2025-03-12T03:17:17Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![vic.yang](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/vic.yang/32/24656_2.png) [@vic.yang](https://devforum.zoom.us/u/vic.yang)\
**Post date:** [March 14, 2025, 7:23am UTC](https://devforum.zoom.us/t/cannot-share-screen-using-window-or-screen-option-throw-error-invalid-operation-reason-user-deny-screen-share/129685/3 "2025-03-14T07:23:30Z")

</div>

Hey @lmtruong1512

Thanks for your feedback.

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

Thanks  
Vic

---

<div class="post-metadata">

**Author:** ![vic.yang](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/vic.yang/32/24656_2.png) [@vic.yang](https://devforum.zoom.us/u/vic.yang)\
**Post date:** [March 17, 2025, 6:24am UTC](https://devforum.zoom.us/t/cannot-share-screen-using-window-or-screen-option-throw-error-invalid-operation-reason-user-deny-screen-share/129685/4 "2025-03-17T06:24:04Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![lmtruong1512](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/lmtruong1512/32/59233_2.png) [@lmtruong1512](https://devforum.zoom.us/u/lmtruong1512)\
**Post date:** [March 18, 2025, 2:23am UTC](https://devforum.zoom.us/t/cannot-share-screen-using-window-or-screen-option-throw-error-invalid-operation-reason-user-deny-screen-share/129685/5 "2025-03-18T02:23:59Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![vic.yang](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/vic.yang/32/24656_2.png) [@vic.yang](https://devforum.zoom.us/u/vic.yang)\
**Post date:** [March 18, 2025, 6:32am UTC](https://devforum.zoom.us/t/cannot-share-screen-using-window-or-screen-option-throw-error-invalid-operation-reason-user-deny-screen-share/129685/6 "2025-03-18T06:32:08Z")

</div>

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?

> **[getDisplayMedia](https://webrtc.github.io/samples/src/content/getusermedia/getdisplaymedia/)**
>
> WebRTC code samples

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

---

<div class="post-metadata">

**Author:** ![lmtruong1512](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/lmtruong1512/32/59233_2.png) [@lmtruong1512](https://devforum.zoom.us/u/lmtruong1512)\
**Post date:** [March 18, 2025, 7:46am UTC](https://devforum.zoom.us/t/cannot-share-screen-using-window-or-screen-option-throw-error-invalid-operation-reason-user-deny-screen-share/129685/7 "2025-03-18T07:46:57Z")

</div>

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](https://devforum.zoom.us/t/getting-invalid-operation-reason-user-deny-screen-share-on-starting-screenshare-on-firefox/63180/9), 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](https://devforum.zoom.us/t/the-canvas-video-occasionally-freezes/129584/2). Is there any solution or upgrade available to address this problem?

Thanks!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [April 17, 2025, 5:47pm UTC](https://devforum.zoom.us/t/cannot-share-screen-using-window-or-screen-option-throw-error-invalid-operation-reason-user-deny-screen-share/129685/8 "2025-04-17T17:47:14Z")

</div>

Closed on April 17, 2025, 5:47pm UTC

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