setCaptions(styles)

Changes the appearance of captions without having to reload the player

📘

All colors should be in hex value.

jwplayer().setCaptions({
    "backgroundColor": "#000000",
    "backgroundOpacity": 100,
    "color": "#ffffff",
    "edgeColor": "ffff00",
    "edgeStyle": "none",
    "fontFamily": "Arial, sans-serif",
    "fontOpacity": 100,
    "fontSize": 20,
    "windowColor": "000000",
    "windowOpacity": 20
});









ItemDescription
backgroundColor stringColor of the text background
backgroundOpacity numberAdjusts the transparency of the text background as a percentage
color stringText color
edgeColor8.36.2+ stringColor of the outline around the letters in captions to enhance readability

Default: #000000
edgeStyle string

Surrounds text with a particular style



Possible Values:
  • none (default)
  • depressed
  • dropshadow
  • raised
  • uniform
fontFamily stringStyle of text to use
fontOpacity numberAdjusts the transparency of text as a percentage
fontSize number

Size of text



NOTE: This does not affect cases where native rendering occurs.

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

© 2007- Longtail Ad Solutions, Inc.