How can I use AVExperienceController to transition a video in expanded mode?

Generated on 5/2/2025

1 search

To transition a video to expanded mode using the AVExperienceController, you can follow the approach outlined in the session "Explore multiview video playback in visionOS" from WWDC 2024. Here's a summary of the process:

  1. Define Allowed Experiences: Each AVExperienceController can specify its own set of allowed experiences, such as embedded or expanded. To transition a video to expanded mode, ensure that expanded is included in the set of allowed experiences.

  2. Transition to Expanded Mode: When you want to transition a video to expanded mode, you can use the AVExperienceController to switch the current experience. This involves setting the experience controller to the expanded experience.

  3. Use Delegate for Transitions: Implement a delegate to handle transition events. The delegate can react to changes in the experience, such as when a video transitions to expanded mode. This allows your app to update its state or UI accordingly.

For more detailed information, you can refer to the session Explore multiview video playback in visionOS (04:59) where the design of a multiview experience is discussed, which includes transitioning between different video playback modes.