Skip to main content
Version: 12 Dec 2024

MLTTMLData

TTML data structure.

Public Methods

MLTTMLData Create

Create and return an initialized version of this struct.

public static MLTTMLData Create()

Returns: A new instance of this struct.


Public Attributes

Bitmap

The cue image if this is an image cue, an empty image otherwise.


public MLTTMLImage Bitmap;

TypeDescription
MLTTMLImageByte data for TTML image cues.

BitmapHeight

The cue bitmap height as a fraction of the viewport size or MLMediaTTML.MLTTMLDimen_Unset if the bitmap should be displayed at its natural height given the bitmap dimensions and the specified #size.


public float BitmapHeight;


EndTimeMs

Track cue end time in milliseconds.


public long EndTimeMs;


Line

The position of the #line_anchor of the cue box within the viewport in the direction orthogonal to the writing direction, or MLMediaTTML.MLTTMLDimen_Unset, LineType, MLTTMLLineType.Fraction . When set, the interpretation of the value depends on the value of #line_type. For horizontal text and equal to , this is the fractional vertical position relative to the top of the viewport.


public float Line;


LineAnchor

The cue box anchor in the direction of line.


public MLTTMLAnchorType LineAnchor;

TypeDescription
MLTTMLAnchorTypeThe cue box anchor in the direction of position.

LineType

The cue line type. MLTTMLLineType.Fraction, MLTTMLLineType.Number, LineAnchor, MLTTMLLineType.Number indicates that #line is a fractional position within the viewport. indicates that #line is a line number, where the size of each line is taken to be the size of the first line of the cue. When #line is greater than or equal to 0 lines count from the start of the viewport, with 0 indicating zero offset from the start edge. When #line is negative lines count from the end of the viewport, with -1 indicating zero offset from the end edge. For horizontal text the line spacing is the height of the first line of the cue, and the start and end of the viewport are the top and bottom respectively. Note that it's particularly important to consider the effect of when using .


public MLTTMLLineType LineType;

TypeDescription
MLTTMLLineTypeThe cue line type.

Position

The fractional position of the #position_anchor of the cue box within the viewport in the direction orthogonal to #line, or MLMediaTTML.MLTTMLDimen_Unset . For horizontal text, this is the horizontal position relative to the left of the viewport. Note that positioning is relative to the left of the viewport even in the case of right-to-left text.


public float Position;


PositionAnchor

The cue box anchor in the direction of position.


public MLTTMLAnchorType PositionAnchor;

TypeDescription
MLTTMLAnchorTypeThe cue box anchor in the direction of position.

Size

The cue box size in the writing direction, as a fraction of the viewport size or MLMediaTTML.MLTTMLDimen_Unset .


public float Size;


StartTimeMs

Track cue start time in milliseconds.


public long StartTimeMs;


Text

The cue text encoded as UTF-8. Or null if this is an image cue.


public string Text;


TextAlignment

The alignment of the cue text within the cue box.


public MLTTMLLayoutAlignment TextAlignment;

TypeDescription
MLTTMLLayoutAlignmentThe alignment of the cue text within the cue box.

TextSize

The cue default text size, or MLMediaTTML.MLTTMLDimen_Unset if this cue has no default.


public float TextSize;


TextSizeType

The cue default text size type, or or Unset if this cue has no default text size.


public MLTTMLTextSizeType TextSizeType;

TypeDescription
MLTTMLTextSizeTypeThe cue default text size type;

WindowColor

The cue window fill color in ARGB format.


public uint WindowColor;


WindowColorSet

Specifies whether or not the WindowColor property is set.


public bool WindowColorSet;