# How do I style subtitles on iOS AirPlay?

**URL:** <https://community.bitmovin.com/t/how-do-i-style-subtitles-on-ios-airplay/108>\
**Category:** Support\
**Tags:** bitmovin-player, ios, airplay, ui, subtitles\
**Created:** [January 6, 2022, 3:57am UTC](https://community.bitmovin.com/t/how-do-i-style-subtitles-on-ios-airplay/108 "2022-01-06T03:57:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon80868541](https://avatars.discourse-cdn.com/v4/letter/a/a587f6/32.png) [@anon80868541](https://community.bitmovin.com/u/anon80868541)\
**Post date:** [January 6, 2022, 3:57am UTC](https://community.bitmovin.com/t/how-do-i-style-subtitles-on-ios-airplay/108/1 "2022-01-06T03:57:22Z")

</div>

I’m playing a stream with subtitles on my iOS app using Bitmovin Player. When I cast the video to an Apple TV using AirPlay, I would like to apply different font size and color to the subtitles. How do I accomplish this?

---

<div class="post-metadata">

**Author:** ![matheus.cardoso](https://avatars.discourse-cdn.com/v4/letter/m/3bc359/32.png) [@matheus.cardoso](https://community.bitmovin.com/u/matheus.cardoso)\
**Post date:** [January 6, 2022, 5:30am UTC](https://community.bitmovin.com/t/how-do-i-style-subtitles-on-ios-airplay/108/2 "2022-01-06T05:30:12Z")

</div>

Since you’re using using the Bitmovin Player UI for local play, you have to set it via the API on the `BitmovinPlayerView` **after** a source was loaded (`onReady` on v3).

Sample code snippet here:

```auto
func onReady(_ event: ReadyEvent, player: Player) {
    playerView.setSubtitleStyles([
        AVTextStyleRule(textMarkupAttributes: [
             kCMTextMarkupAttribute_CharacterEdgeStyle as String: kCMTextMarkupCharacterEdgeStyle_DropShadow,
             kCMTextMarkupAttribute_BackgroundColorARGB as String: [1.0, 0.0, 0.0, 1.0],
             kCMTextMarkupAttribute_BaseFontSizePercentageRelativeToVideoHeight as String: 5.5,
        ])!
    ])
}

```

Additionally worth noting that SUBTITLES are styled correctly whilst CLOSED-CAPTIONS aren’t. According to the Apple Doc the styling property works only for SUBTITLES too.

```auto
This property has an effect only for tracks with media subtype kCMSubtitleFormatType_WebVTT.

```

[https://developer.apple.com/documentation/avfoundation/avplayeritem/1389681-textstylerules](https://developer.apple.com/documentation/avfoundation/avplayeritem/1389681-textstylerules)
