Contents

metadataCollector(_:didCollect:indexesOfNewGroups:indexesOfModifiedGroups:)

Tells the delegate the collected metadata group information has changed and needs to be updated.

Declaration

func metadataCollector(_ metadataCollector: AVPlayerItemMetadataCollector, didCollect metadataGroups: sending [AVDateRangeMetadataGroup], indexesOfNewGroups: IndexSet, indexesOfModifiedGroups: IndexSet)

Parameters

  • metadataCollector:

    The Avplayeritemmetadatacollector on which this delegate is set.

  • metadataGroups:

    The complete array of all metadata groups meeting the criteria of the output.

  • indexesOfNewGroups:

    The indexes of the metadataGroups added since the last delegate invocation of this method.

  • indexesOfModifiedGroups:

    The indexes of the metadataGroups modified since the last delegate invocation of this method.

Discussion

This method is called when additions or modifications are made to the array of collected metadata groups. The initial invocation will have indexesOfNewGroup referring to every index in metadataGroups. Subsequent invocations may not contain all previously collected metadata groups if they no longer refer to a region in the player item’s seekableTimeRanges.