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

Current Chrome tab is not included in the list of tabs to screen record #137

Closed
R4DIC4L opened this issue May 20, 2024 · 6 comments · Fixed by #138
Closed

Current Chrome tab is not included in the list of tabs to screen record #137

R4DIC4L opened this issue May 20, 2024 · 6 comments · Fixed by #138

Comments

@R4DIC4L
Copy link
Contributor

R4DIC4L commented May 20, 2024

Hello! 👋

I found that the current implementation does not include the current tab in Chrome for the video screen recording.

It seems that, in order for this to work, the navigator.mediaDevices.getDisplayMedia needs to set the selfBrowserSurface to 'include' for the current tab. I had to patch the package using patch-package as below:
Before: window.navigator.mediaDevices.getDisplayMedia({ video: video || true, });
After: window.navigator.mediaDevices.getDisplayMedia({ video: video || true, selfBrowserSurface:'include' });

Is there any way that you can modify the ReactMediaRecorderHookProps to let the user define the value for selfBrowserSurface ( 'include'/ 'exclude'/undefined as described in MDN) and then use it when getting the media devices?

I can provide a PR request for the changes if you want.

R4DIC4L pushed a commit to R4DIC4L/react-media-recorder that referenced this issue May 23, 2024
Current Chrome tab is not included in the list of tabs to screen record DeltaCircuit#137
fix DeltaCircuit#137 by allowing the user to set getDisplayMedia selfbrowsersurface prop necessary in Chrome browser for the current tab to appear for selection in Tabs (default 'exclude' in Chrome)
@royalsanga24
Copy link

Hi,
Is this issue resolved? I am facing the same problem.

@R4DIC4L
Copy link
Contributor Author

R4DIC4L commented Jun 14, 2024

Hi, @royalsanga24,

I created a PR, but it is not merged, not sure who can do this (any maintainers here?).

We patched this issue in production for my fix with patch-package.

@royalsanga24
Copy link

Hi @R4DIC4L ,

I saw your commit and ran it locally, it worked for me. Thanks a TON.

Just wanted to know, are you aware on how is it possible capture/record the current tab audio as well? Not from the microphone but the tab audio?

Will help a lot.

@R4DIC4L
Copy link
Contributor Author

R4DIC4L commented Jun 15, 2024

@royalsanga24 did you try sending param audio: true or audio with constraints for the tracks to the use hook?

We don't use audio, but it seems there's a bug in Chrome related to this, as pointed out in this StackOverflow thread. Maybe you can check this Chromium implementation link related to the audio track issue.

@royalsanga24
Copy link

@R4DIC4L thanks for these links. Will definitely check them out. Cheers!

@DeltaCircuit
Copy link
Owner

Thanks @R4DIC4L for the contribution. Squashed your changes and pushed V1.7.0 to npm.

Apologize for the delay, I had left the React ecosystem 2-3 years back, and now I'm working full time on more of a Systems Engineering / Cloud Solutions apps.

I'm very much glad to see this tiny thing is still helping few people with their tasks, and I'll try to revive this as much as possible.

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

Successfully merging a pull request may close this issue.

3 participants