TextTrackStyle

@objc(THEOTextTrackStyle)
public protocol TextTrackStyle

The TextTrackStyle API can be used to change the style of the renderred TextTracks.

  • The background color for the text track.

    Declaration

    Swift

    var backgroundColor: [TextTrackStyleRuleColor]? { get set }
  • The font color for the text track.

    Declaration

    Swift

    var fontColor: [TextTrackStyleRuleColor]? { get set }
  • The font size for the text track. A non-negative number.

    Remark

    This is a number holding a percentage of the size of the calculated default font size. A value of 120 indicates 20% larger than the default font size. A value of 80 indicates 80% of the default font size. The default value of 100 indicates no size difference.

    Declaration

    Swift

    var fontSize: [TextTrackStyleRuleNumber]? { get set }
  • The font family for the text track.

    Declaration

    Swift

    var fontFamily: [TextTrackStyleRuleString]? { get set }
  • The edge style of the text, represented by a value from TextTrackStyleEdgeStyle

    Declaration

    Swift

    var edgeStyle: [TextTrackStyleRuleString]? { get set }
  • The top margin of the area where subtitles are being rendered. A non-negative number.

    Remark

    The line position is orthogonal (or perpendicular) to the writing direction This attribute expresses the line position as a percentage of the dimensions of the video frame in the relevant direction. For example, 0 percent is the top of the video frame and 100 percent is the bottom of the video frame for horizontal writing layout. If you use this attribute, apply it to the entire text, wthout any selector.

    Declaration

    Swift

    var marginTop: [TextTrackStyleRuleNumber]? { get set }
  • The left margin of the area where subtitles are being rendered. A non-negative number.

    Remark

    This attribute expresses the position of the center of the text in the writing direction as a percentage of the video dimensions in the writing direction. For example, 0 percent is the left of the video frame and 100 percent is the right of the video frame for horizontal writing layout. If you use this attribute, apply it to the entire text, wthout any selector.

    Declaration

    Swift

    var marginLeft: [TextTrackStyleRuleNumber]? { get set }