View in English

  • Apple Developer
    • Get Started

    Explore Get Started

    • Overview
    • Learn
    • Apple Developer Program

    Stay Updated

    • Latest News
    • Hello Developer
    • Platforms

    Explore Platforms

    • Apple Platforms
    • iOS
    • iPadOS
    • macOS
    • tvOS
    • visionOS
    • watchOS
    • App Store

    Featured

    • Design
    • Distribution
    • Games
    • Accessories
    • Web
    • Home
    • CarPlay
    • Technologies

    Explore Technologies

    • Overview
    • Xcode
    • Swift
    • SwiftUI

    Featured

    • Accessibility
    • App Intents
    • Apple Intelligence
    • Games
    • Machine Learning & AI
    • Security
    • Xcode Cloud
    • Community

    Explore Community

    • Overview
    • Meet with Apple events
    • Community-driven events
    • Developer Forums
    • Open Source

    Featured

    • WWDC
    • Swift Student Challenge
    • Developer Stories
    • App Store Awards
    • Apple Design Awards
    • Apple Developer Centers
    • Documentation

    Explore Documentation

    • Documentation Library
    • Technology Overviews
    • Sample Code
    • Human Interface Guidelines
    • Videos

    Release Notes

    • Featured Updates
    • iOS
    • iPadOS
    • macOS
    • watchOS
    • visionOS
    • tvOS
    • Xcode
    • Downloads

    Explore Downloads

    • All Downloads
    • Operating Systems
    • Applications
    • Design Resources

    Featured

    • Xcode
    • TestFlight
    • Fonts
    • SF Symbols
    • Icon Composer
    • Support

    Explore Support

    • Overview
    • Help Guides
    • Developer Forums
    • Feedback Assistant
    • Contact Us

    Featured

    • Account Help
    • App Review Guidelines
    • App Store Connect Help
    • Upcoming Requirements
    • Agreements and Guidelines
    • System Status
  • Quick Links

    • Events
    • News
    • Forums
    • Sample Code
    • Videos
 

Vidéos

Ouvrir le menu Fermer le menu
  • Collections
  • Toutes les vidéos
  • À propos

Plus de vidéos

  • À propos
  • Code
  • Explorez des environnements de site web immersifs dans visionOS

    Transportez les visiteurs de votre site web dans des environnements virtuels sur l'Apple Vision Pro grâce à la nouvelle API Immersive en JavaScript. Découvrez comment demander des transitions immersives à partir d'un élément de modèle intégré, créer des expériences immersives captivantes grâce à des fonctionnalités telles que l'ancrage vidéo, et optimiser les performances pour des expériences riches à l'échelle du monde réel, le tout avec seulement quelques lignes de code sur votre site.

    Chapitres

    • 0:00 - Introduction
    • 1:46 - Découvrez l’API immersive
    • 4:16 - Aperçu des environnements en ligne
    • 7:01 - Passez en mode immersif
    • 12:04 - Optimiser l’expérience
    • 17:17 - Commandes d’image
    • 18:09 - Étapes suivantes

    Ressources

    • Download - Immersive model add-on for Blender
    • WebKit.org - Theater Ticket Sales immersive website environment demo for Apple Vision Pro
    • WebKit.org - Escape Game immersive website demo for Apple Vision Pro
    • GitHub: Spatial Backdrop explainer
    • WebKit.org – Report issues to the WebKit open-source project
    • Submit feedback
      • Vidéo HD
      • Vidéo SD

    Vidéos connexes

    WWDC26

    • Concevez des environnements immersifs pour les apps visionOS et le Web spatial
    • Exploitez l’élément de modèle HTML
    • Nouveautés de WebKit pour Safari 27

    WWDC25

    • Nouveautés pour le web spatial
    • Optimisez vos environnements personnalisés pour visionOS
  • Rechercher dans cette vidéo…
    • 1:51 - Basic model element

      <model src="teapot.usdz">
      </model>
    • 2:06 - Model element with environment map

      <model src="teapot.usdz"
      	environmentmap="kitchen.hdr">
      </model>
    • 4:40 - Adding the environment model on the page for inline preview

      <div class="seat-preview">
      	<model id="theater"
      		   src="theater-model.usdz"
      		   environmentmap="theater-lighting.hdr">
      	</model>
      </div>
    • 5:14 - Reset the model entity transform

      const theater = document.getElementById("theater");
      
      async function updateModelTransform() {
      	// Make sure the model is loaded
      	await theater.ready;
      	// Create a transform matrix
      	const identity = new DOMMatrix();
      	// Apply the transform matrix to the model
      	theater.entityTransform = identity;
      }
      
      updateModelTransform();
    • 5:42 - Translate the model down

      const theater = document.getElementById("theater");
      
      async function updateModelTransform() {
      	// Make sure the model is loaded
      	await theater.ready;
      	// Create a transform matrix
      	const transform = new DOMMatrix();
      	// Translate model down, for eye level preview
      	transform.translateSelf(
      		0, 			// x
      		-1.0, 	// y
      		0 			// z
      	);
      	// Apply the transform matrix to the model
      	theater.entityTransform = transform;
      }
      
      updateModelTransform();
    • 6:40 - Build the seat transform

      function buildTransform(seat) {
      	const transform = new DOMMatrix();
      	const { x, y, z, ry } = seat;
      	// Rotate and translate the model to match 
        // the seat's origin and orientation
      	transform.rotateSelf(0, -ry, 0);
      	transform.translateSelf(-x, -y, -z);
      	// Translate the model down, for eye level preview
      	transform.translateSelf(0, -1.0, 0);
      	return transform;
      }
    • 7:16 - Detect feature availability

      if (document.immersiveEnabled) {
      	immersiveButton.hidden = false;
      }
    • 7:34 - Request the immersive transition on the model

      immersiveButton.addEventListener("click", async () => {
      	await model.requestImmersive();
      });
    • 8:24 - Build immersive transform

      function buildTransform(seat, immersive) {
      	const transform = new DOMMatrix();
      	// [...] Seat transform logic
      	if (immersive) {
      		// Rotate to the left
      		transform.rotateSelf(
      			0,		// x
      			45,		// y
      			0			// z
      		);
      	} else {
      		// [...] Eye level translation
      	}
      	return transform;
      }
    • 9:01 - Update the entity transform and the layout on immersive state updates

      theater.addEventListener("immersivechange", () => {
      	const isImmersive = !!document.immersiveElement;
      	const transform = buildTransform(isImmersive, currentSeat);
      	theater.entityTransform = transform;
        document.body.classList.toggle("immersive", isImmersive);
      });
    • 10:53 - Hide the inline preview

      <model id="escapeRoom"
      	   src="escape-room.usdz"
      	   environmentmap="room-lighting.hdr"
      	   style="display: none">
      </model>
    • 11:25 - Request an immersive transition on the escape room model

      const enterButton = document.getElementById("enterButton");
      const escapeRoom = document.getElementById("escapeRoom");
      
      enterButton.addEventListener("click", () => {
          await escapeRoom.requestImmersive();
      });
    • 11:52 - Handle the request result and show a loading animation

      enterButton.addEventListener("click", async () => {
      	showLoadingAnimation();            
      	try {
      		await escapeRoom.requestImmersive();
      	} catch (error) {
      		console.log(error);
      	} finally {
      		hideLoadingAnimation();
      	}
      });
    • 13:16 - Dock the video in the environment with the fullscreen API

      const trailerVideo = document.getElementById("trailerVideo");
      const demoButton = document.getElementById("demoButton");
      
      demoButton.addEventListener("click", async () => {
      	await trailerVideo.requestFullscreen();
      });
    • 14:01 - Play the model animation

      const trailerVideo = document.getElementById("trailerVideo");
      const escapeRoom = document.getElementById("escapeRoom");
      
      trailerVideo.addEventListener("ended", async () => {
      	await document.exitFullscreen();
      	escapeRoom.play();
      });
    • 16:38 - Compress your USDZ with usdcrush

      usdcrush model.usdz -o optimized.usdz

Developer Footer

  • Vidéos
  • WWDC26
  • Explorez des environnements de site web immersifs dans visionOS
  • Open Menu Close Menu
    • iOS
    • iPadOS
    • macOS
    • tvOS
    • visionOS
    • watchOS
    • App Store
    Open Menu Close Menu
    • Swift
    • SwiftUI
    • Swift Playground
    • TestFlight
    • Xcode
    • Xcode Cloud
    • Icon Composer
    • SF Symbols
    Open Menu Close Menu
    • Accessibility
    • Accessories
    • Apple Intelligence
    • Audio & Video
    • Augmented Reality
    • Business
    • Design
    • Distribution
    • Education
    • Games
    • Health & Fitness
    • In-App Purchase
    • Localization
    • Maps & Location
    • Machine Learning & AI
    • Security
    • Safari & Web
    Open Menu Close Menu
    • Documentation
    • Downloads
    • Sample Code
    • Videos
    Open Menu Close Menu
    • Help Guides & Articles
    • Contact Us
    • Forums
    • Feedback & Bug Reporting
    • System Status
    Open Menu Close Menu
    • Apple Developer
    • App Store Connect
    • Certificates, IDs, & Profiles
    • Feedback Assistant
    Open Menu Close Menu
    • 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 Bounty Program
    • Security Research Device Program
    Open Menu Close Menu
    • Meet with Apple
    • Apple Developer Centers
    • App Store Awards
    • Apple Design Awards
    • Apple Developer Academies
    • WWDC
    Read the latest news.
    Get the Apple Developer app.
    Copyright © 2026 Apple Inc. All rights reserved.
    Terms of Use Privacy Policy Agreements and Guidelines