how do I play video from my Vision Pro app in an environment?

Generated on 7/31/2024

1 search

To play video from your Vision Pro app in an environment, you can use the features provided by AVKit, specifically the AVPlayerViewController. Here are the steps to enhance the media viewing experience in a custom environment:

  1. Use AVPlayerViewController: This controller integrates with the system for enhanced video playback capabilities, supporting HLS streaming and providing a familiar playback experience similar to system apps like TV and Music. It also offers streamlined playback controls to keep the audience focused on the media.

  2. Full-Screen Playback: Showing AVPlayerViewController in full screen offers many great capabilities, including participating in the system docking behavior. Docking places the video screen into a fixed location, enhancing the full-screen experience in an immersive space.

  3. Custom Docking Region: You can customize the docking location by specifying a custom docking region. This can be done using Reality Composer Pro to add the video dock preset to your project and place your video into the ideal location of your custom environment.

  4. Immersive Environment Picker: To make your custom environment appear in the same list as the visionOS system environments, use the immersive environment picker. Declare your custom environment by describing it with metadata like a title and image, and use the immersive environment picker modifier on a view to add your immersive environments to video players inside that view.

  5. Progressive Immersion: The immersive space scene type allows the audience to set the desired amount of immersion by turning the digital crown on Apple Vision Pro from no immersion to fully immersive. This scene type also supports custom tint color and passthrough brightness adjustments.

For more detailed information, you can refer to the session Enhance the immersion of media viewing in custom environments starting at the "Immersive playback" chapter.

Relevant Sessions

  1. Enhance the immersion of media viewing in custom environments
  2. Build compelling spatial photo and video experiences
Introducing enterprise APIs for visionOS

Introducing enterprise APIs for visionOS

Find out how you can use new enterprise APIs for visionOS to create spatial experiences that enhance employee and customer productivity on Apple Vision Pro.

Enhance the immersion of media viewing in custom environments

Enhance the immersion of media viewing in custom environments

Extend your media viewing experience using Reality Composer Pro components like Docking Region, Reverb, and Virtual Environment Probe. Find out how to further enhance immersion using Reflections, Tint Surroundings Effect, SharePlay, and the Immersive Environment Picker.

Bring your iOS or iPadOS game to visionOS

Bring your iOS or iPadOS game to visionOS

Discover how to transform your iOS or iPadOS game into a uniquely visionOS experience. Increase the immersion (and fun factor!) with a 3D frame or an immersive background. And invite players further into your world by adding depth to the window with stereoscopy or head tracking.

Design great visionOS apps

Design great visionOS apps

Find out how to create compelling spatial computing apps by embracing immersion, designing for eyes and hands, and taking advantage of depth, scale, and space. We’ll share several examples of great visionOS apps and explore how their designers approached creating new experiences for the platform.

Build compelling spatial photo and video experiences

Build compelling spatial photo and video experiences

Learn how to adopt spatial photos and videos in your apps. Explore the different types of stereoscopic media and find out how to capture spatial videos in your iOS app on iPhone 15 Pro. Discover the various ways to detect and present spatial media, including the new QuickLook Preview Application API in visionOS. And take a deep dive into the metadata and stereo concepts that make a photo or video spatial.