Table of Contents

Class RestrictionTarget

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll
NOTE
Experimental
The RestrictionTarget interface of the {{domxref("Screen Capture API", "Screen Capture API", "", "nocode")}} provides a static method, FromElement(Element), which returns a RestrictionTarget instance that can be used to restrict a captured video track to a specified DOM element.
[Value("RestrictionTarget")]
public class RestrictionTarget
Inheritance
RestrictionTarget
Inherited Members

Remarks

Constructors

RestrictionTarget()

public RestrictionTarget()

Methods

FromElement(Element)

NOTE
Experimental
The fromElement() static method of the RestrictionTarget interface returns a RestrictionTarget instance that can be used to restrict a captured video track to a specified DOM element (plus its descendants).
[Value("fromElement")]
public static Task<RestrictionTarget> FromElement(Element element)

Parameters

element Element

Returns

Task<RestrictionTarget>

A {{jsxref("Promise")}} that resolves to a RestrictionTarget object instance, which can then be passed to RestrictTo(RestrictionTarget?) to restrict the video captured in the track to just the particular DOM element the RestrictionTarget was created with.RestrictionTarget objects are serializable. They can be passed to another document using mechanisms such as PostMessage(dynamic, string, List<Object>).The promise will reject if the restriction target element is not eligible for restriction.

Remarks