<!--
{
  "availability" : [
    "iOS: 4.1.0 -",
    "iPadOS: 4.1.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.7.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFoundation",
  "identifier" : "/documentation/AVFoundation/AVQueuePlayer/canInsert(_:after:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:objc(cs)AVQueuePlayer(im)canInsertItem:afterItem:"
  },
  "title" : "canInsert(_:after:)"
}
-->

# canInsert(_:after:)

Returns a Boolean value that indicates whether you can insert a player item into the player’s queue.

```
nonisolated func canInsert(_ item: AVPlayerItem, after afterItem: AVPlayerItem?) -> Bool
```

## Parameters

`item`

The player item to insert.

`afterItem`

The player item in the queue to follow. Pass `nil` to test if you can append the item to the queue.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if `item` can be appended to the queue, otherwise <doc://com.apple.documentation/documentation/Swift/false>.

## Discussion

Adding the same item to a player at more than one position in the queue isn’t supported.

---

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)