Table of Contents

Class CaptureController

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll
NOTE
Experimental
The CaptureController interface provides methods that can be used to further manipulate a captured display surface (captured via GetDisplayMedia(DisplayMediaStreamOptions))
[Value("CaptureController")]
public class CaptureController : EventTarget
Inheritance
CaptureController
Inherited Members

Remarks

A CaptureController object is associated with a captured display surface by passing it into a getDisplayMedia() call as the value of the options object's controller property.

-Screen Capture API
-GetDisplayMedia(DisplayMediaStreamOptions)
-Using the Element Capture and Region Capture APIs
-Using the Captured Surface Control API
-Better screen sharing with Conditional Focus

See also on MDN

Constructors

CaptureController()

public CaptureController()

Properties

Oncapturedmousechange

[Value("oncapturedmousechange")]
public EventHandlerNonNull Oncapturedmousechange { get; set; }

Property Value

EventHandlerNonNull

Oncapturedzoomlevelchange

[Value("oncapturedzoomlevelchange")]
public EventHandlerNonNull Oncapturedzoomlevelchange { get; set; }

Property Value

EventHandlerNonNull

Methods

ForwardWheel(HTMLElement?)

NOTE
Experimental
The CaptureController interface's forwardWheel() method starts forwarding Element.Wheel events fired on the referenced element to the viewport of an associated captured display surface.
[Value("forwardWheel")]
public Task<GlobalObject.Undefined> ForwardWheel(HTMLElement? element)

Parameters

element HTMLElement

Returns

Task<GlobalObject.Undefined>

A Promise that fulfills with GlobalObject.Undefined.

Remarks

The forwardWheel() method must be invoked via transient activation. Specifically, the only events that can successfully invoke it are click and input. In addition, the user is asked for permission to share tabs when screen capture is first attempted; if the user grants permission, this also includes permission to scroll captured tabs. If the relevant permission is already &quot;granted&quot;, transient activation is not needed.

-Screen Capture API
-GetDisplayMedia(DisplayMediaStreamOptions)
-Using the Captured Surface Control API

See also on MDN

GetSupportedZoomLevels()

NOTE
Experimental
The CaptureController interface's getSupportedZoomLevels() method returns the different zoom levels that the captured display surface supports.
[Value("getSupportedZoomLevels")]
public List<long> GetSupportedZoomLevels()

Returns

List<long>

An array of numbers representing the different zoom levels that the captured display surface supports.

Remarks

GetZoomLevel()

[Value("getZoomLevel")]
public long GetZoomLevel()

Returns

long

SetFocusBehavior(CaptureStartFocusBehavior)

NOTE
Experimental
The CaptureController interface's setFocusBehavior() method controls whether the captured tab or window will be focused when an associated GetDisplayMedia(DisplayMediaStreamOptions) {{jsxref("Promise")}} fulfills, or whether the focus will remain with the tab containing the capturing app.
[Value("setFocusBehavior")]
public GlobalObject.Undefined SetFocusBehavior(CaptureStartFocusBehavior focusBehavior)

Parameters

focusBehavior CaptureStartFocusBehavior

Returns

GlobalObject.Undefined

None (undefined).

Remarks

You can set this behavior multiple times before the GetDisplayMedia(DisplayMediaStreamOptions) call, or once immediately after its Promise resolves. After that, the focus behavior is said to be finalized, and can&apos;t be changed.

-Screen Capture API
-GetDisplayMedia(DisplayMediaStreamOptions)
-Better screen sharing with Conditional Focus

See also on MDN

SetZoomLevel(long)

[Value("setZoomLevel")]
public Task<GlobalObject.Undefined> SetZoomLevel(long zoomLevel)

Parameters

zoomLevel long

Returns

Task<GlobalObject.Undefined>