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

2026 Photos & Camera

WWDC26 · 18 min · Photos & Camera

Support the Center Stage front camera in your iOS app

Supercharge your iOS camera app with Center Stage using AVCapture APIs with the front camera on iPhone 17, iPhone 17 Pro and iPhone Air. Explore how APIs enable zoom and rotate options, for more flexible ways to frame selfies and videos and to automatically get everyone in a group shot. Integrate Center Stage for video calls to automatically adjust the framing, so you’re front and center for virtual meetings and FaceTime calls. And learn how to stabilize your video for real-time video conferencing.

Watch at developer.apple.com ↗

Transcript all transcripts

Chapters

  • 0:00 — Introduction
  • 1:07 — Center Stage front camera
  • 2:09 — Center Stage for photos
  • 3:09 — Capture session setup
  • 3:56 — Dynamic aspect ratio
  • 6:47 — Smart framing monitor
  • 9:24 — Sensor orientation compensation
  • 11:53 — Center Stage for video recordings
  • 13:16 — Center Stage for video calls

Code shown on screen · 3 snippets

Support dynamic aspect ratio swift · at 5:29 ↗
// Select the Center Stage front camera

import AVFoundation

let deviceDiscoverySession = AVCaptureDevice.DiscoverySession(deviceTypes: [.builtInUltraWideCamera], mediaType: .video, position: .front)

guard let camera = deviceDiscoverySession.devices.first else {
    print("Failed to find the capture device")
    return
}

// Find a format that supports the 4x3 aspect ratio

for format in camera.formats {
    if format.supportedDynamicAspectRatios.contains(.ratio4x3) {
        try! camera.lockForConfiguration()
        camera.activeFormat = format
        camera.unlockForConfiguration()
        break
    }
}

// Set dynamic aspect ratio

try! camera.lockForConfiguration()

let timestamp = try! await camera.setDynamicAspectRatio(.ratio4x3)
print("Applied dynamic aspect ratio at timestamp: \(timestamp)")

camera.unlockForConfiguration()
Support smart framing monitor swift · at 7:39 ↗
// Find a format that supports smart framing

import AVFoundation

for format in camera.formats {
    if format.isSmartFramingSupported {
        try! camera.lockForConfiguration()
        camera.activeFormat = format
        camera.unlockForConfiguration()
        break
    }
}

// Configure the smart framing monitor

let monitor = camera.smartFramingMonitor!

try! camera.lockForConfiguration()
monitor.enabledFramings = monitor.supportedFramings
camera.unlockForConfiguration()

// Monitor framing recommendations

observation = monitor.observe(\.recommendedFraming, options: [.new,]) { monitor, change in
    if let framing = monitor.recommendedFraming {

        Task {
            try! camera.lockForConfiguration()
            try! await camera.setDynamicAspectRatio(framing.aspectRatio)
            camera.videoZoomFactor = CGFloat(framing.zoomFactor)
            camera.unlockForConfiguration()
        }

    }
}

// Start the smart framing monitor

try! monitor.startMonitoring()

// Stop the smart framing monitor

observation?.invalidate()
observation = nil

monitor.stopMonitoring()
Support Center Stage for video calls swift · at 14:44 ↗
// Find a format that supports Center Stage

import AVFoundation

for format in camera.formats {
    if format.isCenterStageSupported {
        try! camera.lockForConfiguration()
        camera.activeFormat = format
        camera.unlockForConfiguration()
        break
    }
}

// Turn on Center Stage

AVCaptureDevice.centerStageControlMode = .cooperative
AVCaptureDevice.isCenterStageEnabled = true

Resources