setDisplayMediaRequestHandler

fun setDisplayMediaRequestHandler(handler: (request: DisplayMediaRequestHandlerHandlerRequest, callback: (streams: Streams) -> Unit) -> Unit?)(source)

This handler will be called when web content requests access to display media via the navigator.mediaDevices.getDisplayMedia API. Use the desktopCapturer API to choose which stream(s) to grant access to.

Passing a WebFrameMain object as a video or audio stream will capture the video or audio stream from that frame.

Passing null instead of a function resets the handler to its default state.