setCaptions(styles)

Changes the appearance of captions without having to reload the player. All colors should be in hex value.

AttributeDescription
styles* objectAn object containing the desired caption styles and values (See example below)
ValueDescription
backgroundColor stringThe color of the text background

Default: #000000
backgroundOpacity numberAdjusts the transparency of the text background as a percentage

Default: 100
color stringText color

Default: #ffffff
edgeStyle stringSurrounds text with a particular style

Default: none

Possible Values:
Β Β Β β€’ none
Β Β Β β€’ depressed
Β Β Β β€’ dropshadow
Β Β Β β€’ raised
Β Β Β β€’ uniform
fontFamily stringThe style of text to use

Default: Arial, sans-serif
fontOpacity numberAdjusts the transparency of text as a percentage

Default: 100
fontSize numberThe size of text.

Note: Does not affect cases where native rendering occurs

Default: 20
windowColor stringSurrounds text box with chosen color from edge to edge of the video
windowOpacity numberSets the transparency of the window as a percentage

Example:

jwplayer().setCaptions({"color": "#ffffff", "backgroundColor": "#000000"});