Table of Contents

Class VTTCue

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll

The VTTCue interface of the WebVTT API represents a cue that can be added to the text track associated with a particular video (or other media).

[Value("VTTCue")]
public class VTTCue : TextTrackCue
Inheritance
VTTCue
Inherited Members

Remarks

A cue defines the text to display in a particular timeslice of a video or audio track, along with display properties such as its size, alignment, and position.

See also on MDN

Constructors

VTTCue()

public VTTCue()

VTTCue(Number, double, string)

The VTTCue() constructor creates and returns a new
VTTCue object.

public VTTCue(Number startTime, double endTime, string text)

Parameters

startTime Number
endTime double
text string

Remarks

Properties

Align

The align property of the VTTCue interface represents the alignment of all of the lines of text in the text box.

[Value("align")]
public AlignSetting Align { get; set; }

Property Value

AlignSetting

A string containing one of the following values:

Remarks

Line

The line property of the VTTCue interface represents the cue line of this WebVTT cue.

[Value("line")]
public Union234 Line { get; set; }

Property Value

Union234

A number, or "auto" representing the cue line of this WebVTT cue.

Remarks

LineAlign

The lineAlign property of the VTTCue interface represents the alignment of this VTT cue.

[Value("lineAlign")]
public LineAlignSetting LineAlign { get; set; }

Property Value

LineAlignSetting

A string containing one of the following values:

Remarks

Position

The position property of the VTTCue interface represents the indentation of the cue within the line.

[Value("position")]
public Union234 Position { get; set; }

Property Value

Union234

A number, or "auto" representing the indentation of the cue within the line.

Remarks

PositionAlign

The positionAlign property of the VTTCue interface is used to determine what Position is anchored to.

[Value("positionAlign")]
public PositionAlignSetting PositionAlign { get; set; }

Property Value

PositionAlignSetting

A string containing one of the following values:

Remarks

Region

The region property of the VTTCue interface returns and sets the VTTRegion that this cue belongs to.

[Value("region")]
public VTTRegion? Region { get; set; }

Property Value

VTTRegion

A VTTRegion object.

Remarks

Size

The size property of the VTTCue interface represents the size of the cue as a percentage of the video size.

[Value("size")]
public Number Size { get; set; }

Property Value

Number

A number representing the size of the cue as a percentage of the video size.

Remarks

SnapToLines

The snapToLines property of the VTTCue interface is a {{jsxref("Boolean")}} indicating if the Line property is an integer number of lines, or a percentage of the video size.

[Value("snapToLines")]
public bool SnapToLines { get; set; }

Property Value

bool

A Boolean.

Remarks

Text

The text property of the VTTCue interface represents the text contents of the cue.

[Value("text")]
public string Text { get; set; }

Property Value

string

A string containing the raw text of the cue.

Remarks

Vertical

The vertical property of the VTTCue interface is a string representing the cue's writing direction.

[Value("vertical")]
public DirectionSetting Vertical { get; set; }

Property Value

DirectionSetting

A string containing one of the following values:

Remarks

Methods

GetCueAsHTML()

The getCueAsHTML() method of the VTTCue interface returns a DocumentFragment containing the cue content.

[Value("getCueAsHTML")]
public DocumentFragment GetCueAsHTML()

Returns

DocumentFragment

A DocumentFragment.

Remarks