public static final class StartCaptureSessionCallback.Action extends AsyncCallbackAction<com.teamdev.jxbrowser.capture.internal.rpc.StartCaptureSession.Response>
StartCaptureSessionCallback
.Constructor and Description |
---|
Action(java.util.function.Consumer<com.teamdev.jxbrowser.capture.internal.rpc.StartCaptureSession.Response> consumer) |
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Tells the browser that the capture session request should be canceled.
|
void |
selectSource(Browser browser,
AudioCaptureMode audioCaptureMode)
Tells the browser to use the given browser as the capture source.
|
void |
selectSource(CaptureSource source,
AudioCaptureMode audioCaptureMode)
Tells the browser to use the given capture source.
|
void |
showSelectSourceDialog()
Tells the browser to display the default dialog for choosing the capture source.
|
isClosed
public Action(java.util.function.Consumer<com.teamdev.jxbrowser.capture.internal.rpc.StartCaptureSession.Response> consumer)
public void selectSource(CaptureSource source, AudioCaptureMode audioCaptureMode)
The source
must be present in the
capture sources received from the StartCaptureSessionCallback.Params.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.
source
- the content source to use for the captureaudioCaptureMode
- the audio capture mode for the capturepublic void selectSource(Browser browser, AudioCaptureMode audioCaptureMode)
The passed browser instance and the browser instance requesting the capture session
must be created by the same Engine
instance.
Otherwise, the content capture will be cancelled.
browser
- the browser which contents will be capturedaudioCaptureMode
- the mode of capturing the audio from the browserpublic void cancel()
public void showSelectSourceDialog()