Getting "INVALID_OPERATION": reason: "user deny screen share" on starting screenshare on Firefox

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

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

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.

Which Web Video SDK version?
v1.1.7

Device:

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

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

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

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?

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.

Hey @shoaib

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

Thanks
Vic

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

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

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

Hey @shoaib

Any other contexts in your code? Does the sample app work in your firefox?

Thanks
Vic

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.

Hey @vic.yang ,
I think it maybe something related to this issue, As, In our case startShareScreen API is getting called by an another method and not by a user gesture directly.

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.

Hey @shoaib

Thanks for your feedback. I really appreciate your message.

We will improve our document.

Thanks
Vic

1 Like

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