setDisplayMediaRequestHandler
fun setDisplayMediaRequestHandler( handler: (request: DisplayMediaRequestHandlerHandlerRequest, callback: (streams: Streams) -> Unit) -> Unit?, opts: DisplayMediaRequestHandlerOpts = definedExternally)(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.
useSystemPicker
allows an application to use the system picker instead of providing a specific video source from getSources
. This option is experimental, and currently available for MacOS 15+ only. If the system picker is available and useSystemPicker
is set to true
, the handler will not be invoked.
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.