Constructor
new TextStyle()
Creates a TextStyle object.
Note that although this API is based on FCC guidelines, we cannot guarantee that your application is in compliance with this or any other guideline.
- Source:
Members
-
(static, non-null) EdgeStyles :Array.<!Array.<number>>
-
Defined in FCC 12-9, paragraph 111. The styles to achieve these effects are not specified anywhere. Each inner array represents a shadow, and is composed of RGB values for the shadow color, followed by pixel values for x-offset, y-offset, and blur.
Type:
- Array.<!Array.<number>>
Properties:
Name Type Description NONE
Array.<!Array.<number>> RAISED
Array.<!Array.<number>> DEPRESSED
Array.<!Array.<number>> UNIFORM
Array.<!Array.<number>> DROP
Array.<!Array.<number>> - Source:
-
(static, non-null) StandardColors :Array.<number>
-
Defined in FCC 12-9, paragraph 111, footnote 448. Each value is an array of the three RGB values for that color.
Type:
- Array.<number>
Properties:
Name Type Description WHITE
Array.<number> BLACK
Array.<number> RED
Array.<number> GREEN
Array.<number> BLUE
Array.<number> YELLOW
Array.<number> MAGENTA
Array.<number> CYAN
Array.<number> - Source:
-
(static) StandardOpacities :number
-
Defined in FCC 12-9, paragraph 111.
Type:
- number
Properties:
Name Type Description OPAQUE
number SEMI_HIGH
number SEMI_LOW
number TRANSPARENT
number - Source:
-
backgroundColor :shaka.player.TextStyle.StandardColors
-
Type:
- Source:
-
backgroundOpacity :shaka.player.TextStyle.StandardOpacities
-
Type:
- Source:
-
fontColor :shaka.player.TextStyle.StandardColors
-
Type:
- Source:
-
fontEdge :shaka.player.TextStyle.EdgeStyles
-
Type:
- Source:
-
fontOpacity :shaka.player.TextStyle.StandardOpacities
-
Type:
- Source:
-
fontSize :string
-
Font size, such as 50%, 75%, 100%, 200%, or 300%.
Type:
- string
- Source:
Methods
-
load()
-
Load TextStyle settings from localStorage. Does nothing if no TextStyle data has been stored.
- Source:
- See:
-
- {shaka.player.TextStyle.store}
-
(private) loadFrom_(objnon-null)
-
Parameters:
Name Type Description obj
Object - Source:
-
store()
-
Store this TextStyle's settings in localStorage. Overwrites any previously-stored settings.
- Source:
- See:
-
- {shaka.player.TextStyle.load}
-
toCSS() → {string}
-
Compute the CSS text necessary to represent this TextStyle. Output does not contain any selectors.
- Source:
Returns:
- Type
- string
-
(private) toRGBA_(color, opacity) → {string}
-
Parameters:
Name Type Description color
shaka.player.TextStyle.StandardColors opacity
shaka.player.TextStyle.StandardOpacities - Source:
Returns:
- Type
- string