Method SelectSource
- Namespace
- DotNetBrowser.Capture.Handlers
- Assembly
- DotNetBrowser.dll
SelectSource(Source, AudioMode)
Creates a StartSessionResponse that notifies the browser to use the given capture source.
public static StartSessionResponse SelectSource(Source source, AudioMode audioMode)
Parameters
source
SourceThe content source to use for the capture.
audioMode
AudioModeThe mode of capturing the audio from the browser.
Returns
- StartSessionResponse
The StartSessionResponse instance that can be used as a return value in StartSessionHandler implementation.
Remarks
The
source
must be present in the
Sources received from the Sources.
If the screen capture is forbidden by the system security permissions the request will be cancelled.This is usual for macOS where the screen or application window capture must be explicitly allowed in the System Preferences.
Exceptions
- ArgumentNullException
The
source
is null.
SelectSource(IBrowser, AudioMode)
Creates a StartSessionResponse that notifies the browser to use the given browser as the capture source.
public static StartSessionResponse SelectSource(IBrowser browser, AudioMode audioMode)
Parameters
browser
IBrowserThe browser which contents will be captured.
audioMode
AudioModeThe mode of capturing the audio from the browser.
Returns
- StartSessionResponse
The StartSessionResponse instance that can be used as a return value in StartSessionHandler implementation.
Remarks
The passed browser instance and the browser instance requesting the capture session must be created by the same IEngine instance. Otherwise, the content capture will be cancelled.
Exceptions
- ArgumentNullException
The
browser
is null.