CaptureController Class

The controller of a capture of a display surface (https://w3c.github.io/mediacapture-screen-share/#dom-capturecontroller), given to getDisplayMedia(): the application tells whether the captured surface gets the focus.

public sealed class CaptureController : EventTarget
Inheritance
EventTarget CaptureController

Constructors

NameDescription
CaptureController()Creates a controller.

CaptureController()

DisplayMedia.cs

Creates a controller.

public CaptureController()

Methods

NameDescription
SetFocusBehavior(CaptureStartFocusBehavior)Sets whether the captured surface gets the focus when the capture starts (https://w3c.github.io/mediacapture-screen-share/#dom-capturecontroller-setfocusbehavior). It can be called before the capture starts, or once right after it started (until the next task) when the surface is a window or a tab.

SetFocusBehavior(CaptureStartFocusBehavior)

DisplayMedia.cs

Sets whether the captured surface gets the focus when the capture starts (https://w3c.github.io/mediacapture-screen-share/#dom-capturecontroller-setfocusbehavior). It can be called before the capture starts, or once right after it started (until the next task) when the surface is a window or a tab.

public void SetFocusBehavior(CaptureStartFocusBehavior focusBehavior)

Parameters

focusBehavior CaptureStartFocusBehavior
The focus behavior.

Exceptions

DomException
An InvalidStateError: the capture failed or stopped, the surface is a monitor, or the decision was made.

See also