JWCaptionStyleBuilder
@objcMembers
public class JWCaptionStyleBuilder : NSObject, JWBuilder
The builder for JWCaptionStyle.
-
Declaration
Swift
public typealias Output = JWCaptionStyle -
Builds a
JWCaptionStylestructure describing how captions should look if accessibility settings are not defined by the user.Throws
throws An error if the style is not setup properly.Declaration
Swift
public func build() throws -> JWCaptionStyle -
Sets the font color of the captions.
Declaration
Swift
@discardableResult public func fontColor(_ fontColor: UIColor) -> JWCaptionStyleBuilderParameters
fontColorThe color for the captions, including its opacity.
Return Value
The builder, so setters can be chained.
-
Sets the background color and the opacity of the overall window the captions reside in
Declaration
Swift
@discardableResult public func backgroundColor(_ backgroundColor: UIColor) -> JWCaptionStyleBuilderParameters
backgroundColorThe color to set on the background of the captions.
Return Value
The builder, so setters can be chained.
-
Sets the highlight color and highlight opacity of the text.
Declaration
Swift
@discardableResult public func highlightColor(_ highlightColor: UIColor) -> JWCaptionStyleBuilderParameters
highlightColorThe color to be set on the highlight of the text.
Return Value
The builder, so setters can be chained.
-
Sets the font style and font size.
Declaration
Swift
@discardableResult public func font(_ font: UIFont) -> JWCaptionStyleBuilderParameters
fontThe font to be set on captions.
Return Value
The builder, so setters can be chained.
-
Sets the edge style emphasis around text. The available options are: none, dropshadow, raised, depressed, and uniform.
Declaration
Swift
@discardableResult public func edgeStyle(_ edgeStyle: JWCaptionEdgeStyle) -> JWCaptionStyleBuilderParameters
edgeStyleThe style to apply to the captions.
Return Value
The builder, so setters can be chained.
-
Sets the default position of side-loaded captions displayed in the player.
This position is used if no position is specified by the caption itself, and this is only used with side-loaded captions. Because SRT captions contain no positional data, SRT captions will always be displayed using what is described by this property. For WebVTT captions, if no positional data is specified within the caption, the default position of the caption will be equal to what is described by this property.
Declaration
Swift
@discardableResult public func position(_ position: JWCaptionPosition) -> JWCaptionStyleBuilderParameters
positionThe desired default position of the rendered captions.
Return Value
The builder, so setters can be chained.
-
This property controls whether side-loaded captions will be enlarged for larger player sizes.
If
true, the side-loaded captions will be enlarged for large player sizes such as when the player is full screen. Iffalse, the captions will retain their default assigned size, whether that is from the defined style by the developer or from the user’s accessibility settings.Note
This only affects the rendering of side-loaded captions.Declaration
Swift
@discardableResult public func allowScaling(_ allowed: Bool) -> JWCaptionStyleBuilderParameters
allowedIf
true, the captions will scale. Iffalse, the captions will not scale. The default value istrue.Return Value
The builder, so setters can be chained.
JWCaptionStyleBuilder Class Reference