Accepting getDisplayMedia(stream) dialog inside OpenVidu custom-layout recording?

Hi there, is there a way to accept a call to .getDisplayMedia(stream) inside an OpenVidu custom-layout recording?

As shown in the screenshot above, which is a screenshot of the custom-layout recording, I want to select the current tab, make sure the “Share audio” checkbox is selected, and then click the Share button so that I can the stream object with both the video/audio.

In Googling this, I came across the “auto-accept-this-tab-capture” flag as per this thread here: 1268342 - chromium - An open-source project to help move the web forward. - Monorail

Poking around some more, I then came across what I believe is the script that OpenVidu server runs when creating recordings: openvidu/composed.sh at master · OpenVidu/openvidu · GitHub

Essentially, is there a way to pass along the “auto-accept-this-tab-capture” flag to OpenVidu when recordings start?

I’m not 100% sure what I said makes sense, would work, or is accurate. I’m just trying to brainstorm ways of getting access to the stream object from .getDisplayMedia()

Thanks!

You are on the right path: that is the script that you’d need to modify to pass a new flag to the internal Chrome process in charge of displaying the recording layout. This is the exact line where the Chrome process is started: openvidu/composed.sh at 2595afd722e05ec4fe6389ca151fa31d09fe62c0 · OpenVidu/openvidu · GitHub

So, the solution is pretty simple: create your own recording Docker image based on the official image,
adding any parameter you want to that script. And you can then configure it in your OpenVidu deployment with this environment variable:

-DOPENVIDU_RECORDING_IMAGE=your_docker_image:your_docker_tag

You can take advantage of this simple script to build your custom image: openvidu/create_image.sh at master · OpenVidu/openvidu · GitHub
Just provide valid values for the expected input parameters and change the image name and tag to your custom one.

That being said, I have one question… I’m not able to imagine a single scenario where I would want the Chrome container of COMPOSED recording to call getDisplayMedia… In fact, the Chrome container should be a passive participant of the session, just acting as a Subscriber and displaying the session streams on its layout. Why do you want it to act as a Publisher?

1 Like

Essentially I wanted to do a custom recording on the user’s browser in certain situations but I opted to do this on the server side instead in the end. It just made it a much better user experience overall.

But thanks for your response anyways!