Dunfey · Hotel WWDC as data, est. 1983
Front desk everything
Years
Topics

2021 Audio & Video

WWDC21 · 11 min · Audio & Video

Transition media gaplessly with HLS

Discover how you can create streaming media content that seamlessly transitions between episodes, songs, scenes, and individual resources. With gapless HLS playback, you can stitch together multiple pieces of content on the fly to create customized workouts, design interactive content, tell compelling stories, and more. We’ll show you how you can provide faithful continuity for streaming music, event recordings, and pre-recorded video and provide a captivating viewing experience within your app.

Watch at developer.apple.com ↗

Transcript all transcripts

Code shown on screen · 1 snippet

create two items, enqueue in order and play gaplessly swift · at 6:12 ↗
// create two items, enqueue in order, 
// and play gaplessly

let item1 = AVPlayerItem(url: url1)
let item2 = AVPlayerItem(url: url2)

let player = AVQueuePlayer()
	
player.insert(item1, after: nil)
player.insert(item2, after: item1)

player.play()

Resources