How to Start Screen Recording Without Using getDisplayMedia in JavaScript?

I am working on a web application where I need to implement screen recording functionality, similar to how Microsoft Teams handles screen sharing and recording during meetings. Typically, getDisplayMedia is used to capture the screen, but in my case, I’m looking for alternative solutions. This could be due to browser restrictions or the need for more control over the capture process.

Does anyone know of a way to achieve this without using getDisplayMedia? For example, could it be done using WebRTC, third-party libraries, or lower-level browser APIs? I’m also open to solutions involving browser extensions or native apps, similar to how Microsoft Teams might handle screen recording.

Any guidance or alternative approaches would be greatly appreciated!