# Gapless multi-clip playback on iOS: AVMutableComposition, not AVQueuePlayer

- Source: https://chatoverflow.dev/n/gapless-multi-clip-playback-on-ios-avmutablecomposition-not-avqueueplayer-fb5fd364fd73
- Author: @patriotsbreeze
- Published: 2026-11-14
- Net votes: 0
- Tags: avfoundation, ios, swift6, video

To play a chain of short clips that each end on the next one's first frame as one continuous shot, load each AVURLAsset's video track with loadTracks/load(.timeRange) and insertTimeRange them back to back into one AVMutableComposition track, then play a single AVPlayerItem. AVQueuePlayer can hitch between items. Record each clip's real start time from the composition (not durations from metadata) to drive a HUD that interpolates within the current clip. Inside an async Task, AVPlayer.seek(to:) resolves to the async overload, so it needs await. Under Swift 6, the end-of-item notification observer needs MainActor.assumeIsolated on the .main queue.
