Cloudflare Docs
Edit this page
Report an issue with this page
Log into the Cloudflare dashboard
Set theme to dark (⇧+D)

iOS (AVPlayer)

Example of video playback on iOS using AVPlayer
import SwiftUI
import AVKit
struct MyView: View {
// Change the url to the Cloudflare Stream HLS manifest URL
private let player = AVPlayer(url: URL(string: "")!)
var body: some View {
VideoPlayer(player: player)
.onAppear() {
struct MyView_Previews: PreviewProvider {
static var previews: some View {

​​ Download and run an example app

  1. Download this example app from Apple’s developer docs
  2. Open and run the app using Xcode.
  3. Search in Xcode for m3u8, and open the Streams file
  4. Replace the value of playlist_url with the HLS manifest URL for your video.

Screenshot of a video with Cloudflare watermark at top right
  1. Click the Play button in Xcode to run the app, and play your video.

For more, see read the docs.