<img src="https://img.shields.io/badge/%20iOS-V3-yellow?logo=apple" style="float:left"/><br />

If you have captions or subtitles for your video content, you can use the following sections to add embedded or sidecar captions to your app.

Although there are differences between the intended purposes of captions and subtitles, you use the same processes to add or to customize either type of synchronized text to your app. For simplicity, both captions and subtitles are referred to as captions in our documentation.

<br /> <hr />

## Add captions to your app

### Embedded captions

  1. Copy the URL of your stream. **The stream must contain CEA-608, CEA-708, or in-manifest WebVTT captions**.

  2. Define the `file` property of the <a href="https://developer.jwplayer.com/sdk/ios/reference/Classes/JWConfig.html" target="_blank">JWConfig</a> object with the URL of your stream.

<br />

### Side Car Captions

  1. Create an array of <a href="https://developer.jwplayer.com/sdk/ios/reference/Classes/JWTrack.html" target="_blank">JWTrack</a> objects.

  2. Define the location of the subtitle file (`file`), language label (`label`), and the default subtitle file (`isDefault`).

If you define a single track, the `label` value is ignored and not shown.

<br /> <hr />

## Customize your captions

Using the <a href="https://developer.jwplayer.com/sdk/ios/reference/Classes/JWCaptionStyling.html" target="_blank">JWCaptionStyling</a> class, you can customize the font, font color, window color, background color, and edge style of the captions in your app. If you do not define any styling, your captions are styled based upon the **Settings > Accessibility > Subtitles & Captioning** settings on the viewer's device.

Any caption styling that you define applies only to in-manifest WebVTT (embedded) captions and sidecar captions. These captions inherit your styling only when a viewer enables **Video Override** in his or her device's **Settings > Accessibility > Subtitles & Captioning** settings.

CEA-608 and CEA-708 captions do not inherit caption styling defined by `JWCaptionStyling`.

  1. Create a `JWCaptionStyling` object.

  2. Use the following example and table to define the properties of your `JWCaptionStyling object`. In the example below, we call this `captionConfig`.

<br /> <hr />

## iOS settings mapping

The following tables map the specific iOS **Settings > Accessibility > Subtitles & Captioning** settings to the iOS SDK property. Remember that viewers must enable **Video Override** in each of these areas for your customizations to render when they use your app.

### Text

iOS settingJWCaptionStyling property
Font<a href="https://developer.jwplayer.com/sdk/ios/reference/Classes/JWCaptionStyling.html#//api/name/font" target="_blank">font</a> (`UIColor`)
Size<a href="https://developer.jwplayer.com/sdk/ios/reference/Classes/JWCaptionStyling.html#//api/name/font" target="_blank">font</a> (`UIColor`)
Color<a href="https://developer.jwplayer.com/sdk/ios/reference/Classes/JWCaptionStyling.html#//api/name/color" target="_blank">color</a> (`UIColor`)

### Background

iOS settingJWCaptionStyling property
Color<a href="https://developer.jwplayer.com/sdk/ios/reference/Classes/JWCaptionStyling.html#//api/name/backgroundColor" target="_blank">backgroundColor</a> (`UIColor`)
Opacity<a href="https://developer.jwplayer.com/sdk/ios/reference/Classes/JWCaptionStyling.html#//api/name/backgroundColor" target="_blank">backgroundColor</a> (`UIColor:alpha`) <br /> <a href="https://developer.jwplayer.com/sdk/ios/reference/Classes/JWCaptionStyling.html#//api/name/windowColor" target="_blank">windowColor</a> (`UIColor:alpha`)

### Advanced

iOS settingJWCaptionStyling property
Text Opacity<a href="https://developer.jwplayer.com/sdk/ios/reference/Classes/JWCaptionStyling.html#//api/name/color" target="_blank">color</a> (`UIColor:alpha`)
Text Edge Style<a href="https://developer.jwplayer.com/sdk/ios/reference/Classes/JWCaptionStyling.html#//api/name/edgeStyle" target="_blank">edgeStyle</a>
Text HighlightN/A

<br />