# Getting "INVALID\_OPERATION": reason: "user deny screen share" on starting screenshare on Firefox

**URL:** <https://devforum.zoom.us/t/getting-invalid-operation-reason-user-deny-screen-share-on-starting-screenshare-on-firefox/63180>\
**Category:** Web\
**Created:** [January 25, 2022, 8:25pm UTC](https://devforum.zoom.us/t/getting-invalid-operation-reason-user-deny-screen-share-on-starting-screenshare-on-firefox/63180 "2022-01-25T20:25:38Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![shoaib](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/shoaib/32/28580_2.png) [@shoaib](https://devforum.zoom.us/u/shoaib)\
**Post date:** [January 25, 2022, 8:25pm UTC](https://devforum.zoom.us/t/getting-invalid-operation-reason-user-deny-screen-share-on-starting-screenshare-on-firefox/63180/1 "2022-01-25T20:25:38Z")

</div>

I’m getting “INVALID\_OPERATION”: reason: “user deny screen share” on starting screenshare on Firefox.  
Below line is throwing the error.

```auto
await mediaStream?.startShareScreen(this.selfShareRef.current);

```

 ![Screenshot 2022-01-26 at 1.43.40 AM](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/9/0/9098aaecad272a8c4198fd3c58260de9bbd68239.png)

I think this error usually comes when a user denies a screen share, but in this case I’m not even getting below shown screen share dialog.

 ![Screenshot 2022-01-26 at 1.40.50 AM](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/5/1/51df8aff433c9fd67cdb0355ec0af322c148e1f8.png)

**Which Web Video SDK version?**  
v1.1.7

**Device:**

- Device: Macbook Pro
- OS: macOS
- Browser: Firefox
- Browser Version: Firefox 96.0.2 (64-bit)

---

<div class="post-metadata">

**Author:** ![shoaib](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/shoaib/32/28580_2.png) [@shoaib](https://devforum.zoom.us/u/shoaib)\
**Post date:** [January 26, 2022, 7:31pm UTC](https://devforum.zoom.us/t/getting-invalid-operation-reason-user-deny-screen-share-on-starting-screenshare-on-firefox/63180/2 "2022-01-26T19:31:40Z")

</div>

@tommy @vic.yang Can someone please help regarding the issue, It was not there before.

---

<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:** [January 27, 2022, 7:30am UTC](https://devforum.zoom.us/t/getting-invalid-operation-reason-user-deny-screen-share-on-starting-screenshare-on-firefox/63180/3 "2022-01-27T07:30:26Z")

</div>

Hey @shoaib

Thanks for your feedback.

As you mentioned in the article, usually the error occurs when the user denies the screen share, have you ever blocked the screen share in firefox?

Thanks  
Vic

---

<div class="post-metadata">

**Author:** ![shoaib](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/shoaib/32/28580_2.png) [@shoaib](https://devforum.zoom.us/u/shoaib)\
**Post date:** [January 27, 2022, 9:44am UTC](https://devforum.zoom.us/t/getting-invalid-operation-reason-user-deny-screen-share-on-starting-screenshare-on-firefox/63180/4 "2022-01-27T09:44:03Z")

</div>

Thanks for replying @vic.yang , No I’ve not blocked screen share in firefox. As I said, It doesn’t even open screen share dialog using which we can allow or block screen share.

Do we need to wait before starting screen share after joining room, or something like that?

---

<div class="post-metadata">

**Author:** ![shoaib](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/shoaib/32/28580_2.png) [@shoaib](https://devforum.zoom.us/u/shoaib)\
**Post date:** [February 3, 2022, 5:52pm UTC](https://devforum.zoom.us/t/getting-invalid-operation-reason-user-deny-screen-share-on-starting-screenshare-on-firefox/63180/5 "2022-02-03T17:52:43Z")

</div>

Hey @vic.yang, any update on this as the issue is still there.  
When I’m already joined in a video call, then start screen sharing then its working fine.

---

<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:** [February 7, 2022, 1:31am UTC](https://devforum.zoom.us/t/getting-invalid-operation-reason-user-deny-screen-share-on-starting-screenshare-on-firefox/63180/6 "2022-02-07T01:31:19Z")

</div>

Hey @shoaib

Most of the Video SDK APIs can only be used after joined the session.

Thanks  
Vic

---

<div class="post-metadata">

**Author:** ![shoaib](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/shoaib/32/28580_2.png) [@shoaib](https://devforum.zoom.us/u/shoaib)\
**Post date:** [February 7, 2022, 6:06am UTC](https://devforum.zoom.us/t/getting-invalid-operation-reason-user-deny-screen-share-on-starting-screenshare-on-firefox/63180/7 "2022-02-07T06:06:11Z")

</div>

Hey @vic.yang ,  
Yes, I’ve joined session and also making sure that `share-decode` is true, then calling

```auto
await mediaStream?.startShareScreen(this.selfShareRef.current);

```

Are there any other things also that we need to check before calling `startShareScreen` API?

---

<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:** [February 8, 2022, 1:16am UTC](https://devforum.zoom.us/t/getting-invalid-operation-reason-user-deny-screen-share-on-starting-screenshare-on-firefox/63180/8 "2022-02-08T01:16:18Z")

</div>

Hey @shoaib

Any other contexts in your code? Does the [sample app](https://github.com/zoom/sample-app-videosdk/tree/master/react-demo) work in your firefox?

Thanks  
Vic

---

<div class="post-metadata">

**Author:** ![shoaib](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/shoaib/32/28580_2.png) [@shoaib](https://devforum.zoom.us/u/shoaib)\
**Post date:** [February 8, 2022, 11:29am UTC](https://devforum.zoom.us/t/getting-invalid-operation-reason-user-deny-screen-share-on-starting-screenshare-on-firefox/63180/9 "2022-02-08T11:29:20Z")

</div>

Hey @vic.yang ,  
Yes, the sample app is working in firefox.  
In sample app, session is joined as soon as you open homepage (`http://localhost:3000/`), then you have to start video call, then only you can start screen share.

but In our use case, Its possible for user to join screen share without joining in video call.

Our Screen share flow is following:  
**Click on screen share button → wait for `init()` → wait for `join()` to join session → wait for `share-decode` to be set `true` → call `startShareScreen`**

Can you please help resolve the issue? as everything else is ready and we are stuck because of this screen share issue.

---

<div class="post-metadata">

**Author:** ![shoaib](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/shoaib/32/28580_2.png) [@shoaib](https://devforum.zoom.us/u/shoaib)\
**Post date:** [February 9, 2022, 7:00am UTC](https://devforum.zoom.us/t/getting-invalid-operation-reason-user-deny-screen-share-on-starting-screenshare-on-firefox/63180/10 "2022-02-09T07:00:51Z")

</div>

Hey @vic.yang ,  
I think it maybe something related to [this](https://github.com/w3c/mediacapture-screen-share/issues/104) issue, As, In our case **`startShareScreen`** API is getting called by an another method and not by a user gesture directly.

---

<div class="post-metadata">

**Author:** ![shoaib](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/shoaib/32/28580_2.png) [@shoaib](https://devforum.zoom.us/u/shoaib)\
**Post date:** [February 9, 2022, 7:47am UTC](https://devforum.zoom.us/t/getting-invalid-operation-reason-user-deny-screen-share-on-starting-screenshare-on-firefox/63180/11 "2022-02-09T07:47:38Z")

</div>

Yes, seems like above mentioned issue was the root cause.  
Now, I’ve added a dialog which gets showed after joining a session, which when user clicks then only **`startShareScreen`** gets called, and using this flow screen share is working fine.

@vic.yang I think this should be mentioned somewhere in the docs as well.

---

<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:** [February 9, 2022, 7:58am UTC](https://devforum.zoom.us/t/getting-invalid-operation-reason-user-deny-screen-share-on-starting-screenshare-on-firefox/63180/12 "2022-02-09T07:58:52Z")

</div>

Hey @shoaib

Thanks for your feedback. I really appreciate your message.

We will improve our document.

Thanks  
Vic

---

<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:** [March 11, 2022, 5:59pm UTC](https://devforum.zoom.us/t/getting-invalid-operation-reason-user-deny-screen-share-on-starting-screenshare-on-firefox/63180/13 "2022-03-11T17:59:18Z")

</div>

Closed on March 11, 2022, 5:59pm UTC

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