View in English

  • Apple Developer
    • 今すぐ始める

    「今すぐ始める」を詳しく見る

    • 概要
    • 学ぶ
    • Apple Developer Program

    最新情報

    • 最新ニュース
    • Hello Developer
    • プラットフォーム

    プラットフォームを詳しく見る

    • Appleプラットフォーム
    • iOS
    • iPadOS
    • macOS
    • tvOS
    • visionOS
    • watchOS
    • App Store

    特集

    • デザイン
    • 配信
    • ゲーム
    • アクセサリ
    • Web
    • Home
    • CarPlay
    • テクノロジー

    テクノロジーを詳しく見る

    • 概要
    • Xcode
    • Swift
    • SwiftUI

    特集

    • アクセシビリティ
    • AIと機械学習
    • App Intent
    • Apple Intelligence
    • ゲーム
    • セキュリティ
    • Xcode Cloud
    • コミュニティ

    コミュニティを詳しく見る

    • 概要
    • 「Appleに相談」イベント
    • コミュニティイベント
    • デベロッパフォーラム
    • オープンソース

    特集

    • WWDC
    • Swift Student Challenge
    • デベロッパストーリー
    • App Store Awards
    • Apple Design Awards
    • Apple Developer Center
    • ドキュメント

    ドキュメントを詳しく見る

    • ドキュメントライブラリ
    • テクノロジー概要
    • サンプルコード
    • ヒューマンインターフェイスガイドライン
    • ビデオ

    リリースノート

    • 注目のアップデート
    • iOS
    • iPadOS
    • macOS
    • watchOS
    • visionOS
    • tvOS
    • Xcode
    • ダウンロード

    ダウンロードを詳しく見る

    • すべてのダウンロード
    • オペレーティングシステム
    • アプリ
    • デザインリソース

    特集

    • Xcode
    • TestFlight
    • フォント
    • SF Symbols
    • Icon Composer
    • サポート

    サポートを詳しく見る

    • 概要
    • ヘルプガイド
    • デベロッパフォーラム
    • フィードバックアシスタント
    • お問い合わせ

    特集

    • アカウントヘルプ
    • App Reviewガイドライン
    • App Store Connectヘルプ
    • 近日導入予定の要件
    • 契約およびガイドライン
    • システムステータス
  • クイックリンク

    • イベント
    • ニュース
    • Forum
    • サンプルコード
    • ビデオ
 

ビデオ

メニューを開く メニューを閉じる
  • コレクション
  • すべてのビデオ
  • 利用方法

その他のビデオ

  • 概要
  • Summary
  • コード
  • Build a great camera experience for iPhone Duo

    Discover how to leverage the outer and inner cameras on iPhone Duo. Explore the Virtual Front Camera, and find out how to use the direction coordinator to switch between cameras and update your UI as people open and close iPhone Duo. Learn best practices for handling preview aspect ratios, positioning, and rotation to deliver a seamless capture experience.

    関連する章

    • 0:00 - Introduction
    • 0:31 - Meet the new front cameras
    • 0:58 - Discover the virtual front camera
    • 1:53 - Access each camera individually
    • 2:46 - Track camera direction
    • 4:03 - Create a direction coordinator
    • 4:50 - Use both displays at once
    • 5:38 - Work with device descriptors
    • 6:17 - Handle a direction change
    • 7:03 - Polish your camera preview
    • 8:03 - Handle rotation
    • 8:47 - Next steps

    リソース

      • HDビデオ
      • SDビデオ

    関連ビデオ

    WWDC26

    • iOSアプリでのセンターフレームフロントカメラのサポート

    Tech Talks

    • Leverage multiple displays and scenes on iPhone Duo
  • このビデオを検索
    • 3:00 - Understand AVCaptureDevicePosition

      enum AVCaptureDevicePosition: Int {
          case unspecified
          case back
          case front
      }
      
      extension AVCaptureDevice {
          // ...
          var position: AVCaptureDevicePosition { get }
      }
    • 4:06 - Initialize a direction coordinator

      directionCoordinator = AVCaptureDeviceDirectionCoordinator(
          view: view,
          deviceTypes: [
              .builtInOuterUltraWideCamera,
              .builtInInnerUltraWideCamera,
              .builtInDualWideCamera,
          ],
          changeHandler: { [weak self] map in
              self?.updateCameraSession(map)
          }
      )
    • 7:30 - Configure the video preview layer

      class AVCaptureVideoPreviewLayer {
          // ...
      
          var videoGravity: AVLayerVideoGravity { get set }
      }
    • 7:51 - Select a dynamic aspect ratio

      class AVCaptureDevice {
          // ...
      
          var dynamicAspectRatio: AVCaptureDevice.AspectRatio? { get }
      }
    • 8:34 - Disable sensor orientation compensation

      // Disable for improved performance
      class AVCapturePhotoOutput: AVCaptureOutput {
          // ...
      
          var isCameraSensorOrientationCompensationEnabled: Bool { get set }
      }
    • 0:00 - Introduction
    • Tarun from the camera software team introduces the new camera features on iPhone Duo: the new front cameras, handling camera direction changes when people open or close the device, and tips for polishing your app's camera preview.

    • 0:31 - Meet the new front cameras
    • iPhone Duo is the first iPhone with two front cameras, both square sensors with an ultrawide field of view. The outer ultrawide camera sits on the outside of the device, while opening it reveals the inner ultrawide camera — the first under-display camera on iPhone.

    • 0:58 - Discover the virtual front camera
    • Stream from the front cameras through AVFoundation, using AVCaptureDeviceDiscoverySession with position .front and the wide or ultrawide device type. On iPhone Duo this discovers the new virtual front camera, which automatically switches between the inner physical camera when open and the outer one when closed, always using the most relevant camera for your app.

    • 1:53 - Access each camera individually
    • Each front camera has its own AVCaptureDevice type — built-in outer ultrawide and built-in inner ultrawide — giving access to each camera's full capabilities. The inner camera supports 1080p up to 60fps, the outer up to 4K and 120fps. The virtual front camera exposes only features common to both, meaning 1080p and 60fps, and depth is supported only when accessing the individual cameras.

    • 2:46 - Track camera direction
    • When using individual cameras, your app is responsible for switching as people open or close the device — use the new AVCaptureDeviceDirectionCoordinator. AVCaptureDevice's position property has always been back or front, and both front cameras report front, but on iPhone Duo the displays can face opposite directions, so a front camera isn't always looking at you. The coordinator keeps your app up to date on where cameras are facing.

    • 4:03 - Create a direction coordinator
    • A direction coordinator needs three things: your app's UIView, the device types to monitor, and a change handler. When your view is on the outer display, outer front cameras report as forward-facing and rear cameras as backward-facing. Opening the device moves your view to the inner display and calls your change handler, which then reports the inner front camera as forward-facing.

    • 4:50 - Use both displays at once
    • A camera app can use both displays simultaneously — useful for a group video call, or for showing a child something fun while photographing them. With a separate UIView per display, create a separate direction coordinator for each, since each reports positions relative to its own view. Camera apps enable this with the SceneAccessories API, covered in "Leverage multiple displays and scenes on iPhone Duo".

    • 5:38 - Work with device descriptors
    • Because the direction coordinator is tied to a view, it's isolated to the main actor, so your change handler shouldn't use AVFoundation APIs directly. Instead of an AVCaptureDevice, the coordinator provides an AVCaptureDeviceDescriptor — a main-actor-safe, sendable representation containing everything needed to create an AVCaptureDevice, which you can safely pass to your camera actor.

    • 6:17 - Handle a direction change
    • When your change handler is called, reconfigure your AVCaptureSession to keep streaming from the forward-facing camera. Consider how the new direction affects mirroring — mirror the preview when the rear camera is forward-facing for a natural selfie experience — and perform any UI updates your app needs. The direction coordinator is found in AVKit.

    • 7:03 - Polish your camera preview
    • Streaming the rear camera's full field of view on the inner display leaves extra space around the preview: offset the preview to group controls in the remaining space, or let it fill the display. Use videoGravity on AVCaptureVideoPreviewLayer to control layout within the layer bounds. When streaming from the ultrawide front cameras, use dynamicAspectRatio on AVCaptureDevice to select a landscape aspect ratio and fill the display.

    • 8:03 - Handle rotation
    • Adopt AVCaptureDeviceRotationCoordinator to keep your camera preview and photos upright. On iPhone Duo it updates when your app moves between displays, so rotation is applied consistently. After adopting it, disable camera sensor orientation compensation — enabled on all iPhone Duo front cameras — to improve performance.

    • 8:47 - Next steps
    • Use the iOS 27.1 SDK to take full advantage of iPhone Duo, decide how your app will handle switching cameras when the device opens or closes, adopt a direction coordinator if you want to move beyond the virtual front camera, and test that your camera preview looks great.

デベロッパ向けフッタ

  • ビデオ
  • Tech Talks
  • Build a great camera experience for iPhone Duo
  • メニューを開く メニューを閉じる
    • iOS
    • iPadOS
    • macOS
    • tvOS
    • visionOS
    • watchOS
    • App Store
    メニューを開く メニューを閉じる
    • Swift
    • SwiftUI
    • Swift Playground
    • TestFlight
    • Xcode
    • Xcode Cloud
    • Icon Composer
    • SF Symbols
    メニューを開く メニューを閉じる
    • アクセシビリティ
    • アクセサリ
    • AIと機械学習
    • Apple Intelligence
    • オーディオとビデオ
    • 拡張現実
    • ビジネス
    • デザイン
    • 配信
    • 教育
    • ゲーム
    • ヘルスケアとフィットネス
    • アプリ内購入
    • ローカリゼーション
    • マップと位置情報
    • セキュリティ
    • Safari/Web
    メニューを開く メニューを閉じる
    • ドキュメント
    • ダウンロード
    • サンプルコード
    • ビデオ
    • ドキュメントのアーカイブ
    メニューを開く メニューを閉じる
    • ヘルプガイドと記事
    • お問い合わせ
    • フォーラム
    • フィードバックとバグの報告
    • システムステータス
    メニューを開く メニューを閉じる
    • Apple Developer
    • App Store Connect
    • Certificates, IDs, & Profiles(証明書、ID、プロファイル)
    • フィードバックアシスタント
    メニューを開く メニューを閉じる
    • Apple Developer Program
    • Apple Developer Enterprise Program
    • App Store Small Business Program
    • MFi Program
    • Mini Apps Partner Program
    • News Partner Program
    • Video Partner Program
    • セキュリティ報奨金プログラム
    • Security Research Device Program
    メニューを開く メニューを閉じる
    • Appleに相談
    • Apple Developer Center
    • App Store Awards
    • Apple Design Awards
    • Apple Developer Academy
    • WWDC
    最新ニュースを読む
    Apple Developerアプリを入手
    bilibili、LinkedIn、WeChat、YouTubeでフォロー
    Copyright © 2026 Apple Inc. All rights reserved.
    利用規約 プライバシーポリシー 契約とガイドライン