VttCue Class
A WebVTT cue (https://w3c.github.io/webvtt/#the-vttcue-interface): the cue of a WebVTT file, or a cue created to be added to a text track with TextTrack.AddCue.
public sealed class VttCue : TextTrackCue- Inheritance
TextTrackCueVttCue
Constructors
| Name | Description |
|---|---|
| VttCue(double, double, string) | Creates a cue (https://w3c.github.io/webvtt/#dom-vttcue-vttcue). |
VttCue(double, double, string)
VttCue.csCreates a cue (https://w3c.github.io/webvtt/#dom-vttcue-vttcue).
Parameters
startTimedouble- The start time of the cue, in seconds.
endTimedouble- The end time of the cue, in seconds (positive infinity for an unbounded cue).
textstring- The cue text.
Exceptions
ArgumentExceptionendTimeis negative infinity or NaN.
See also
Properties
| Name | Description |
|---|---|
| Align | Gets or sets the alignment of the text of the cue (https://w3c.github.io/webvtt/#dom-vttcue-align). |
| Line | Gets or sets the line of the cue (https://w3c.github.io/webvtt/#dom-vttcue-line): a number, or auto. |
| LineAlign | Gets or sets the alignment of the line of the cue (https://w3c.github.io/webvtt/#dom-vttcue-linealign). |
| Position | Gets or sets the position of the cue (https://w3c.github.io/webvtt/#dom-vttcue-position): a percentage, or auto. |
| PositionAlign | Gets or sets the alignment of the position of the cue (https://w3c.github.io/webvtt/#dom-vttcue-positionalign). |
| Region | Gets or sets the region of the cue (https://w3c.github.io/webvtt/#dom-vttcue-region), or null. |
| Size | Gets or sets the size of the cue box, a percentage of the video (https://w3c.github.io/webvtt/#dom-vttcue-size). |
| SnapToLines | Gets or sets a value indicating whether the line of the cue is a number of lines, rather than a percentage of the dimensions of the video (https://w3c.github.io/webvtt/#dom-vttcue-snaptolines). |
| Text | Gets or sets the cue text, in raw unparsed form (https://w3c.github.io/webvtt/#dom-vttcue-text). |
| Vertical | Gets or sets the writing direction of the cue (https://w3c.github.io/webvtt/#dom-vttcue-vertical). |
Align
VttCue.csGets or sets the alignment of the text of the cue (https://w3c.github.io/webvtt/#dom-vttcue-align).
public AlignSetting Align { get; set; }Line
VttCue.csGets or sets the line of the cue (https://w3c.github.io/webvtt/#dom-vttcue-line): a number, or auto.
public LineAndPositionSetting Line { get; set; }LineAlign
VttCue.csGets or sets the alignment of the line of the cue (https://w3c.github.io/webvtt/#dom-vttcue-linealign).
public LineAlignSetting LineAlign { get; set; }Position
VttCue.csGets or sets the position of the cue (https://w3c.github.io/webvtt/#dom-vttcue-position): a percentage, or auto.
public LineAndPositionSetting Position { get; set; }Property value
Exceptions
DomException- An
IndexSizeErrorwhen the value is negative or greater than 100.
See also
PositionAlign
VttCue.csGets or sets the alignment of the position of the cue (https://w3c.github.io/webvtt/#dom-vttcue-positionalign).
public PositionAlignSetting PositionAlign { get; set; }Region
VttCue.csGets or sets the region of the cue (https://w3c.github.io/webvtt/#dom-vttcue-region), or null.
public VttRegion? Region { get; set; }Size
VttCue.csGets or sets the size of the cue box, a percentage of the video (https://w3c.github.io/webvtt/#dom-vttcue-size).
public double Size { get; set; }Property value
Exceptions
DomException- An
IndexSizeErrorwhen the value is negative or greater than 100.
See also
SnapToLines
VttCue.csGets or sets a value indicating whether the line of the cue is a number of lines, rather than a percentage of the dimensions of the video (https://w3c.github.io/webvtt/#dom-vttcue-snaptolines).
public bool SnapToLines { get; set; }Text
VttCue.csGets or sets the cue text, in raw unparsed form (https://w3c.github.io/webvtt/#dom-vttcue-text).
public string Text { get; set; }Vertical
VttCue.csGets or sets the writing direction of the cue (https://w3c.github.io/webvtt/#dom-vttcue-vertical).
public DirectionSetting Vertical { get; set; }Methods
| Name | Description |
|---|---|
| GetCueAsHtml() | Returns the cue text as a document fragment of HTML elements and other nodes (https://w3c.github.io/webvtt/#dom-vttcue-getcueashtml): the WebVTT cue text parsing rules, then the WebVTT cue text DOM construction rules. The nodes belong to the document of the current global object. |
| GetCueAsHtml(Document) | Returns the cue text as a document fragment of HTML elements and other nodes that belong to a document. |
GetCueAsHtml overloads
GetCueAsHtml()
VttCue.csReturns the cue text as a document fragment of HTML elements and other nodes (https://w3c.github.io/webvtt/#dom-vttcue-getcueashtml): the WebVTT cue text parsing rules, then the WebVTT cue text DOM construction rules. The nodes belong to the document of the current global object.
public DocumentFragment GetCueAsHtml()GetCueAsHtml(Document)
VttCue.csReturns the cue text as a document fragment of HTML elements and other nodes that belong to a document.
public DocumentFragment GetCueAsHtml(Document document)