<!--
{
  "availability" : [
    "iOS: 26.4.0 -",
    "iPadOS: 26.4.0 -",
    "macCatalyst: 26.4.0 -",
    "macOS: 26.4.0 -",
    "tvOS: 26.4.0 -",
    "visionOS: 26.4.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFoundation",
  "identifier" : "/documentation/AVFoundation/AVPlayerLayer/setCaptionPreviewProfileID(_:position:text:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:objc(cs)AVPlayerLayer(im)setCaptionPreviewProfileID:position:text:"
  },
  "title" : "setCaptionPreviewProfileID(_:position:text:)"
}
-->

# setCaptionPreviewProfileID(_:position:text:)

Starts displaying a caption preview with the specified accessibility profile.

```
func setCaptionPreviewProfileID(_ profileID: String, position: CGPoint, text: String?)
```

## Parameters

`profileID`

The identifier of the accessibility profile to use for caption appearance.
Profile IDs can be obtained from `MACaptionAppearanceCopyProfileIDs()`.
This determines font, color, background, and other visual characteristics.

`position`

A CGPoint that defines the position (in points) of the caption preview relative to the default positioning of content captions (centered near the bottom of the video). Position values can be negative. (0, 0) represents the default positioning.

`text`

Optional custom text to display in the preview. If `nil`, a standard localized preview message will be shown.

## Discussion

This method enables a preview mode that displays sample caption text using the visual appearance settings from the specified accessibility profile. The preview replaces any currently active subtitles and/or closed captions while active. The sample caption text position can be specified to avoid UI controls.

> Note: You must call ``doc://com.apple.avfoundation/documentation/AVFoundation/AVPlayerLayer/stopShowingCaptionPreview()`` to exit the preview.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)