<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: -",
    "macOS: 12.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 8.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFoundation",
  "identifier" : "/documentation/AVFoundation/AVAsset/loadChapterMetadataGroups(withTitleLocale:containingItemsWithCommonKeys:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "s:So7AVAssetC12AVFoundationE25loadChapterMetadataGroups15withTitleLocale29containingItemsWithCommonKeysSaySo07AVTimedE5GroupCG10Foundation0I0V_SaySo13AVMetadataKeyaGtYaKF"
  },
  "title" : "loadChapterMetadataGroups(withTitleLocale:containingItemsWithCommonKeys:)"
}
-->

# loadChapterMetadataGroups(withTitleLocale:containingItemsWithCommonKeys:)

Loads chapter metadata that contains the specified title locale and common keys.

```
func loadChapterMetadataGroups(withTitleLocale locale: Locale, containingItemsWithCommonKeys commonKeys: [AVMetadataKey] = []) async throws -> [AVTimedMetadataGroup]
```

## Parameters

`locale`

The locale of the chapter metadata to load.

`commonKeys`

An array of common [`AVMetadataKey`](/documentation/AVFoundation/AVMetadataKey) values to include in the returned array. The framework currently only supports the [`commonKeyArtwork`](/documentation/AVFoundation/AVMetadataKey/commonKeyArtwork) key.

## Return Value

An array of chapter metadata items for a locale.

## Discussion

This method returns an array of [`AVTimedMetadataGroup`](/documentation/AVFoundation/AVTimedMetadataGroup) objects asynchronously. Each object in the array contains an [`AVMetadataItem`](/documentation/AVFoundation/AVMetadataItem) that represents the chapter’s title, and the metadata group’s [`timeRange`](/documentation/AVFoundation/AVTimedMetadataGroup/timeRange) value equals the time range of the chapter title item.

The metadata group contains all chapter metadata, including items with the common key [`commonKeyArtwork`](/documentation/AVFoundation/AVMetadataKey/commonKeyArtwork), if such items are present. The system adds an [`AVMetadataItem`](/documentation/AVFoundation/AVMetadataItem) with the specified common key to an existing [`AVTimedMetadataGroup`](/documentation/AVFoundation/AVTimedMetadataGroup) object if the time range (timestamp and duration) of the metadata item and the metadata group overlap. The locales of such items don’t need to match the locale of the chapter titles.

You can use the [`metadataItems(from:filteredAndSortedAccordingToPreferredLanguages:)`](/documentation/AVFoundation/AVMetadataItem/metadataItems(from:filteredAndSortedAccordingToPreferredLanguages:)) method to further filter the metadata items in each group. You can also filter the returned items based on locale using the [`metadataItems(from:with:)`](/documentation/AVFoundation/AVMetadataItem/metadataItems(from:with:)) method.

---

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)