Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

screen share permission call twice. #25

Closed
theMasix opened this issue Sep 5, 2020 · 4 comments
Closed

screen share permission call twice. #25

theMasix opened this issue Sep 5, 2020 · 4 comments

Comments

@theMasix
Copy link

theMasix commented Sep 5, 2020

Hello. I wanna use the screen capture alongside audio. So it's my code:

<ReactMediaRecorder
                screen
                render={({
                  status, startRecording, stopRecording, mediaBlobUrl,
                }) => ((
                  <div>
                    <p>{status}</p>
                    <button type="button" onClick={startRecording}>Start Recording</button>
                    <button type="button" onClick={stopRecording}>Stop Recording</button>
                    <video src={mediaBlobUrl} controls autoPlay loop />
                  </div>
                ))}
 />

but the screen share permission call twice. one after render and one after calling the startRecording.
It is a BUG i think...

@DeltaCircuit
Copy link
Owner

The getDisplayMedia() behaves a bit differently than getUserMedia(). The granted permission won't persist. You can read more here about it (from MDN) here, under the Usage Notes. So, each time you want to record the screen, the browser will explicitly ask for the permission.

@DeltaCircuit
Copy link
Owner

On a second read, you mentioned it was asking for permissions on 'render'. On my end, it didn't ask. (I used the same example you provided).

@theMasix
Copy link
Author

theMasix commented Sep 8, 2020

It was an URGENT situation so I rewrote the whole package on my own. I think I should capture my screen to show you how it behaves. As i said, the screen capture permission calls twice and It's a bug.
I will send the video for you.
for now, my chrome version is: 85.0.4183.83

@DeltaCircuit
Copy link
Owner

This should be fixed in #57 . New version 1.5.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants