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 ↗Chapters
Code shown on screen · 3 snippets
Support dynamic aspect ratio
// 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
// 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
// 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
Related sessions
-
18 min -
33 min -
36 min