---
title: J1プロサッカーチームFC町田ゼルビアのImmersive動画を撮影しSwiftでViewerを実装し体験会実施した
tags:  #visionos #swift  
author: [satoshi0212](https://www.docswell.com/user/satoshi0212)
site: [Docswell](https://www.docswell.com/)
thumbnail: https://bcdn.docswell.com/page/YE6QZQ29EV.jpg?width=480
description: try! Swift Tokyo 2025
published: April 13, 25
canonical: https://www.docswell.com/s/satoshi0212/K9VDPJ-2025-04-13-114049
---
# Page. 1

![Page Image](https://bcdn.docswell.com/page/YE6QZQ29EV.jpg)

try! Swift Tokyo 2025
Filming FC Machida Zelvia&#039;s Immersive
Video and Implementing a Viewer in
Swift for a viewing event
Satoshi Hattori
@shmdevelop


# Page. 2

![Page Image](https://bcdn.docswell.com/page/GE5RWR2DJ4.jpg)

Satoshi Hattori
Cyber AI Productions
visionOS Expert at Cyber Agent
Host of &quot;visionOS Engineer Meetup Tokyo&quot;
GitHub: satoshi
2
1
2
0
X: @shmdevelop


# Page. 3

![Page Image](https://bcdn.docswell.com/page/972DQD1M7R.jpg)

visionOS 30 Days Challenge
visionOS2 30 Days Challenge


# Page. 4

![Page Image](https://bcdn.docswell.com/page/DJY2W2ZPJM.jpg)

In This Session


# Page. 5

![Page Image](https://bcdn.docswell.com/page/V7N8983ME8.jpg)

Immersive Video Shooting Work ow
Viewer Implementation
fl
ff
Demo Event: Key E orts and Outcomes


# Page. 6

![Page Image](https://bcdn.docswell.com/page/YJ9K2K9WJ3.jpg)

Prerequisites


# Page. 7

![Page Image](https://bcdn.docswell.com/page/GJ8R5R9R7D.jpg)

Prerequisites
What is Immersive Video?
About FC Machida Zelvia


# Page. 8

![Page Image](https://bcdn.docswell.com/page/LJLKYKW27R.jpg)

Prerequisites
Immersive Video


# Page. 9

![Page Image](https://bcdn.docswell.com/page/47M2N2997W.jpg)

Apple Immersive Video
K D video content featuring a
-degree
field of view and spatial audio, viewable on
Apple Vision Pro
0
8
1
https://www.apple.com/jp/apple-vision-pro/
3
8
Prerequisites


# Page. 10

![Page Image](https://bcdn.docswell.com/page/P7RMDMG9J9.jpg)



# Page. 11

![Page Image](https://bcdn.docswell.com/page/PJXV1VX3EX.jpg)

Have you experienced
Apple Immersive Video?
✋


# Page. 12

![Page Image](https://bcdn.docswell.com/page/3JKQ2QWNJD.jpg)

Prerequisites
「VIP」
S E : Feel the excitement of game day like
never before as broadcasting great Joe Buck
narrates an all-access Bronx experience - with
the personalities, players, and spine-tingling
moments that make the Yankees&#039; ballpark
legendary.
5
4
1
1
https://tv.apple.com/jp/episode/yankee-stadium/umc.cmc. awwgdeond reeitehveujxpu?l=en-US


# Page. 13

![Page Image](https://bcdn.docswell.com/page/LE3P4P1ZJ5.jpg)

Prerequisites
3
https://developer.apple.com/documentation/avfoundation/media_reading_and_writing/converting_side-by-side_ d_video_to_multiview_hevc_and_spatial_video


# Page. 14

![Page Image](https://bcdn.docswell.com/page/8EDLQLX4JG.jpg)

Prerequisites
3
https://developer.apple.com/documentation/avfoundation/media_reading_and_writing/converting_side-by-side_ d_video_to_multiview_hevc_and_spatial_video


# Page. 15

![Page Image](https://bcdn.docswell.com/page/V7P2L2PV78.jpg)

Prerequisites
3
https://developer.apple.com/documentation/avfoundation/converting-side-by-side- d-video-to-multiview-hevc-and-spatial-video


# Page. 16

![Page Image](https://bcdn.docswell.com/page/2JVDQD2RJQ.jpg)

Prerequisites
Specs
ISO Base Media File Format and Apple HEVC Stereo Video
Video Extended Usage box hierarchy
https://developer.apple.com/av-foundation/Stereo-Video-ISOBMFF-Extensions.pdf


# Page. 17

![Page Image](https://bcdn.docswell.com/page/5EGYWYR6EL.jpg)

Prerequisites
Apple Immersive Video


# Page. 18

![Page Image](https://bcdn.docswell.com/page/4JQM3MV27P.jpg)

Prerequisites
FC Machida Zelvia


# Page. 19

![Page Image](https://bcdn.docswell.com/page/K74V1VMPJ1.jpg)

FC Machida Zelvia is a professional football club based in Machida, Tokyo,
Japan, and is a member of the Japan Professional Football League.
The major shareholder is Cyber Agent.
FC町 ゼルビアは、
本の東京都町
市をホームタウンとして、
本プロ
サッカーリーグ（Jリーグ）に加盟するプロサッカークラブ。
日
田
日
田
主要株主 サイバーエージェント。


# Page. 20

![Page Image](https://bcdn.docswell.com/page/LJ13G38X7G.jpg)



# Page. 21

![Page Image](https://bcdn.docswell.com/page/GJWPKPZK72.jpg)



# Page. 22

![Page Image](https://bcdn.docswell.com/page/4EZKZK1NE3.jpg)



# Page. 23

![Page Image](https://bcdn.docswell.com/page/Y76QZQL97V.jpg)

Immersive Video Shooting Work ow
Viewer Implementation
fl
ff
Demo Event: Key E orts and Outcomes


# Page. 24

![Page Image](https://bcdn.docswell.com/page/G75RWR1DE4.jpg)

Immersive Video Shooting Work ow
Viewer Implementation
fl
ff
Demo Event: Key E orts and Outcomes


# Page. 25

![Page Image](https://bcdn.docswell.com/page/9J2DQD9MJR.jpg)

Shooting work ow
fl
Planning
Filming
Editing


# Page. 26

![Page Image](https://bcdn.docswell.com/page/DEY2W24PEM.jpg)

Shooting work ow
fl
Planning
Filming
Editing


# Page. 27

![Page Image](https://bcdn.docswell.com/page/VJN898YM78.jpg)

Immersive Video
×
Sports


# Page. 28

![Page Image](https://bcdn.docswell.com/page/YE9K2KPWE3.jpg)

fi
In 2024,
FC Machida Zelvia entered their rst
year in the J1 League.
We set out to create content that
allows supporters
to relive this historic moment.


# Page. 29

![Page Image](https://bcdn.docswell.com/page/GE8R5RDRJD.jpg)

ZELVISION XR
A project aimed at immersing supporters in the world of FC Machida Zelvia, delivering a new kind of sports
experience and demonstrating its value — utilizing the Immersive Video format.


# Page. 30

![Page Image](https://bcdn.docswell.com/page/LELKYKM2JR.jpg)



# Page. 31

![Page Image](https://bcdn.docswell.com/page/4JM2N2Y9JW.jpg)

Shooting work ow
fl
Planning
Filming
Editing


# Page. 32

![Page Image](https://bcdn.docswell.com/page/PJRMDM99E9.jpg)

Filming
Filming Permissions
Negotiations and coordination with the club
Compliance with J.League regulations
Wearing o cial bibs
Shoot
/
times
Sapporo match
/
Kyoto match
ffi
3
0
1
3
2
1
9
1
Farewell before the FC Tokyo match


# Page. 33

![Page Image](https://bcdn.docswell.com/page/PEXV1VQ37X.jpg)

Filming
Filming Permissions
Negotiations and coordination with the club
Compliance with J.League regulations
Wearing o cial bibs
Shoot
Mr. Hirose
ffi
3
0
1
3
2
1
9
1
Professional
Cameraman
/
times
Sapporo match
/
Kyoto match
Farewell before the FC Tokyo match


# Page. 34

![Page Image](https://bcdn.docswell.com/page/3EKQ2Q9NED.jpg)

5
8
2
2
5
Canon EOS R C
RF . mm F . L DUAL FISHEYE


# Page. 35

![Page Image](https://bcdn.docswell.com/page/L73P4PWZE5.jpg)

https://x.com/makoto_hirose/
2
1
7
9
7
6
3
5
6
0
7
3
9
6
4
2
6
8
1
status/


# Page. 36

![Page Image](https://bcdn.docswell.com/page/87DLQLK4EG.jpg)



# Page. 37

![Page Image](https://bcdn.docswell.com/page/VJP2L2KVJ8.jpg)

Filming
Camera:
Canon EOS R C + RF . mm F . L DUAL FISHEYE
Camera Settings:
K P(
x
pixels,
frames per second)
Continuously capturing images equivalent to
megapixels at
frames per second.
This generates considerable heat. The EOS R C features an internal fan and has never
stopped, even in the scorching heat.
Media:
RAW LT format stored on CFExpress Type B memory cards.
With RAW LT, TB stores approximately
minutes of footage.
Simultaneous recording of proxy videos (
x
pixels) on SD cards.
Proxy Videos:
These are lightweight and perfect for review and rough editing. They are equivalent to
the JPEG files in the RAW+JPEG photo shooting format.
0
0
2
2
8
3
0
6
4
0
8
0
5
1
3
8
5
4
0
2
2
5
0
1
8
2
0
6
2
5
0
2
3
4
5
1
2
9
1
8
0
6
8
Storage:
A large amount of high-speed SSDs. In the past six months, TB x and TB x were
purchased. In-house environment: Gb Ethernet, QNAP NAS with approximately
TB
of storage.


# Page. 38

![Page Image](https://bcdn.docswell.com/page/2EVDQDVREQ.jpg)

Filming
Camera:
Canon EOS R C + RF . mm F . L DUAL FISHEYE
Camera Settings:
K P(
x
pixels,
frames per second)
Continuously capturing images equivalent to
megapixels at
frames per second.
This generates considerable heat. The EOS R C features an internal fan and has never
stopped, even in the scorching heat.
Media:
RAW LT format stored on CFExpress Type B memory cards.
With RAW LT, TB stores approximately
minutes of footage.
Simultaneous recording of proxy videos (
x
pixels) on SD cards.
Proxy Videos:
These are lightweight and perfect for review and rough editing. They are equivalent to
the JPEG files in the RAW+JPEG photo shooting format.
0
0
2
2
8
3
0
6
4
0
8
0
5
1
3
8
5
4
0
2
2
5
0
1
8
2
0
6
2
5
0
2
3
4
5
1
2
9
1
8
0
6
8
Storage:
A large amount of high-speed SSDs. In the past six months, TB x and TB x were
purchased. In-house environment: Gb Ethernet, QNAP NAS with approximately
TB
of storage.


# Page. 39

![Page Image](https://bcdn.docswell.com/page/57GYWYL67L.jpg)

Filming
Video Recording Settings:
Canon Log , Cinema Gamut
Essential for P RAW Shooting:
USB-PD mobile battery
Base ISO Considerations:
Daytime: Base ISO
Nighttime: Base ISO
Recommended Aperture:
F-stop: F .
0
0
2
0
3
0
8
0
0
1
0
1
6
0
3
6
6
5
1
Shutter Speed:
Shutter: / , /


# Page. 40

![Page Image](https://bcdn.docswell.com/page/4EQM3MY2JP.jpg)

Shooting work ow
fl
Planning
Filming
Editing


# Page. 41

![Page Image](https://bcdn.docswell.com/page/KJ4V1VWPE1.jpg)

Editing
②
①
Blackmagic DaVinci Resolve
Apply HDR color grading, sharpening, and noise reduction.
Export in ProRes HQ.
EOS VR Utility
Convert RAW to VR
projection
and export in Apple ProRes
HQ.
③
2
2
4
0
8
1
Adobe Premiere Pro
Edit with lightweight proxy videos.
Export edit information as XML.
Spatial Metadata GUI
Convert to MV-HEVC with Meatadata.


# Page. 42

![Page Image](https://bcdn.docswell.com/page/LE13G3YXJG.jpg)

Filming &amp; Editing: See also
4
8
https://www.youtube.com/watch?v=nOB u iSbms


# Page. 43

![Page Image](https://bcdn.docswell.com/page/GEWPKPGKJ2.jpg)

Shooting work ow
fl
Planning
Filming
Editing


# Page. 44

![Page Image](https://bcdn.docswell.com/page/47ZKZKLN73.jpg)

Shooting work ow
Planning
fl
Filming
Editing


# Page. 45

![Page Image](https://bcdn.docswell.com/page/YJ6QZQW9JV.jpg)

Shooting work ow
Planning
fl
Filming
Editing
App
Development
Event


# Page. 46

![Page Image](https://bcdn.docswell.com/page/GJ5RWRMD74.jpg)

Immersive Video Shooting Work ow
Viewer Implementation
fl
ff
Demo Event: Key E orts and Outcomes


# Page. 47

![Page Image](https://bcdn.docswell.com/page/LE3P4P9QJ5.jpg)

Immersive Video Shooting Work ow
Viewer Implementation
fl
ff
Demo Event: Key E orts and Outcomes


# Page. 48

![Page Image](https://bcdn.docswell.com/page/8EDLQLGWJG.jpg)

Why we need custom viewer?


# Page. 49

![Page Image](https://bcdn.docswell.com/page/V7P2L23X78.jpg)

fi
For delivering a smooth experience tailored to
rst-time users within a limited timeframe.


# Page. 50

![Page Image](https://bcdn.docswell.com/page/2JVDQD43JQ.jpg)

Viewer Implementation
Core features:


# Page. 51

![Page Image](https://bcdn.docswell.com/page/5EGYWY1YEL.jpg)

Viewer Implementation
Core features:
Retrieve video information
Creating a hemispherical mesh for projection
Player


# Page. 52

![Page Image](https://bcdn.docswell.com/page/4JQM3MD67P.jpg)

Viewer Implementation
Retrieve video information


# Page. 53

![Page Image](https://bcdn.docswell.com/page/K74V1VZMJ1.jpg)

static func getVideoInfo(asset: AVAsset) async -&gt; VideoInfo? {
let videoInfo = VideoInfo()
guard let videoTrack = try? await asset.loadTracks(withMediaType: .video).first else {
print(&quot;No video track found&quot;)
return nil
}
guard
let (naturalSize, formatDescriptions, mediaCharacteristics) =
try? await videoTrack.load(.naturalSize, .formatDescriptions, .mediaCharacteristics),
let formatDescription = formatDescriptions.first
else {
print(&quot;Failed to load video properties&quot;)
return nil
}
videoInfo.size = naturalSize
videoInfo.isSpatial = mediaCharacteristics.contains(.containsStereoMultiviewVideo)
let projection = VideoTools.getProjection(formatDescription: formatDescription)
videoInfo.projectionType = projection.projectionType
videoInfo.horizontalFieldOfView = projection.horizontalFieldOfView
return videoInfo
}


# Page. 54

![Page Image](https://bcdn.docswell.com/page/LJ13G3RY7G.jpg)

static func getVideoInfo(asset: AVAsset) async -&gt; VideoInfo? {
let videoInfo = VideoInfo()
guard let videoTrack = try? await asset.loadTracks(withMediaType: .video).first else {
print(&quot;No video track found&quot;)
return nil
}
guard
let (naturalSize, formatDescriptions, mediaCharacteristics) =
try? await videoTrack.load(.naturalSize, .formatDescriptions, .mediaCharacteristics),
let formatDescription = formatDescriptions.first
else {
print(&quot;Failed to load video properties&quot;)
return nil
}
videoInfo.size = naturalSize
videoInfo.isSpatial = mediaCharacteristics.contains(.containsStereoMultiviewVideo)
let projection = VideoTools.getProjection(formatDescription: formatDescription)
videoInfo.projectionType = projection.projectionType
videoInfo.horizontalFieldOfView = projection.horizontalFieldOfView
return videoInfo
}


# Page. 55

![Page Image](https://bcdn.docswell.com/page/GJWPKP1172.jpg)

static func getVideoInfo(asset: AVAsset) async -&gt; VideoInfo? {
let videoInfo = VideoInfo()
guard let videoTrack = try? await asset.loadTracks(withMediaType: .video).first else {
print(&quot;No video track found&quot;)
return nil
}
guard
let (naturalSize, formatDescriptions, mediaCharacteristics) =
try? await videoTrack.load(.naturalSize, .formatDescriptions, .mediaCharacteristics),
let formatDescription = formatDescriptions.first
else {
print(&quot;Failed to load video properties&quot;)
return nil
}
videoInfo.size = naturalSize
videoInfo.isSpatial = mediaCharacteristics.contains(.containsStereoMultiviewVideo)
let projection = VideoTools.getProjection(formatDescription: formatDescription)
videoInfo.projectionType = projection.projectionType
videoInfo.horizontalFieldOfView = projection.horizontalFieldOfView
return videoInfo
}


# Page. 56

![Page Image](https://bcdn.docswell.com/page/4EZKZKPXE3.jpg)

static func getVideoInfo(asset: AVAsset) async -&gt; VideoInfo? {
let videoInfo = VideoInfo()
guard let videoTrack = try? await asset.loadTracks(withMediaType: .video).first else {
print(&quot;No video track found&quot;)
return nil
}
guard
let (naturalSize, formatDescriptions, mediaCharacteristics) =
try? await videoTrack.load(.naturalSize, .formatDescriptions, .mediaCharacteristics),
let formatDescription = formatDescriptions.first
else {
print(&quot;Failed to load video properties&quot;)
return nil
}
videoInfo.size = naturalSize
videoInfo.isSpatial = mediaCharacteristics.contains(.containsStereoMultiviewVideo)
let projection = VideoTools.getProjection(formatDescription: formatDescription)
videoInfo.projectionType = projection.projectionType
videoInfo.horizontalFieldOfView = projection.horizontalFieldOfView
return videoInfo
}


# Page. 57

![Page Image](https://bcdn.docswell.com/page/Y76QZQMP7V.jpg)

static func getProjection(formatDescription: CMFormatDescription) -&gt; (
projectionType: CMProjectionType?,
horizontalFieldOfView: Float?) {
var projectionType: CMProjectionType?
var horizontalFieldOfView: Float?
if let extensions = CMFormatDescriptionGetExtensions(formatDescription) as Dictionary? {
if let projectionKind = extensions[&quot;ProjectionKind&quot; as CFString] as? String {
projectionType = CMProjectionType(fromString: projectionKind) ?? .rectangular
}
if let horizontalFieldOfViewValue =
extensions[kCMFormatDescriptionExtension_HorizontalFieldOfView] as? UInt32 {
horizontalFieldOfView = Float(horizontalFieldOfViewValue) / 1000.0
}
}
return (projectionType, horizontalFieldOfView)
}


# Page. 58

![Page Image](https://bcdn.docswell.com/page/G75RWRZPE4.jpg)

static func getProjection(formatDescription: CMFormatDescription) -&gt; (
projectionType: CMProjectionType?,
horizontalFieldOfView: Float?) {
var projectionType: CMProjectionType?
var horizontalFieldOfView: Float?
if let extensions = CMFormatDescriptionGetExtensions(formatDescription) as Dictionary? {
if let projectionKind = extensions[&quot;ProjectionKind&quot; as CFString] as? String {
projectionType = CMProjectionType(fromString: projectionKind) ?? .rectangular
}
if let horizontalFieldOfViewValue =
extensions[kCMFormatDescriptionExtension_HorizontalFieldOfView]
UInt32
{
ProjectionKind shouldas?be
HalfEquirectangular
horizontalFieldOfView = Float(horizontalFieldOfViewValue) / 1000.0
}
}
return (projectionType, horizontalFieldOfView)
}


# Page. 59

![Page Image](https://bcdn.docswell.com/page/9J2DQDRZJR.jpg)

static func getProjection(formatDescription: CMFormatDescription) -&gt; (
projectionType: CMProjectionType?,
horizontalFieldOfView: Float?) {
var projectionType: CMProjectionType?
var horizontalFieldOfView: Float?
if let extensions = CMFormatDescriptionGetExtensions(formatDescription) as Dictionary? {
if let projectionKind = extensions[&quot;ProjectionKind&quot; as CFString] as? String {
projectionType = CMProjectionType(fromString: projectionKind) ?? .rectangular
}
HorizontalFieldOfView should be 180,000
if let horizontalFieldOfViewValue =
extensions[kCMFormatDescriptionExtension_HorizontalFieldOfView] as? UInt32 {
horizontalFieldOfView = Float(horizontalFieldOfViewValue) / 1000.0
}
}
return (projectionType, horizontalFieldOfView)
}


# Page. 60

![Page Image](https://bcdn.docswell.com/page/DEY2W2DNEM.jpg)

Viewer Implementation
Creating a hemispherical mesh for projection


# Page. 61

![Page Image](https://bcdn.docswell.com/page/VJN8986V78.jpg)

Build compelling spatial photo and video experiences
6
6
1
0
1
4
2
0
2
https://developer.apple.com/videos/play/wwdc
/


# Page. 62

![Page Image](https://bcdn.docswell.com/page/YE9K2KLVE3.jpg)

Thanks to Mike Swanson
https://github.com/mikeswanson/SpatialPlayer


# Page. 63

![Page Image](https://bcdn.docswell.com/page/GE8R5RX4JD.jpg)

public static func generateVideoSphere(
radius: Float,
sourceHorizontalFov: Float,
sourceVerticalFov: Float,
clipHorizontalFov: Float,
clipVerticalFov: Float,
verticalSlices: Int,
horizontalSlices: Int
) -&gt; MeshResource? {
...
let mesh = try? MeshResource.generate(from: [meshDescriptor])
return mesh
}


# Page. 64

![Page Image](https://bcdn.docswell.com/page/LELKYK8VJR.jpg)

public static func generateVideoSphere(
radius: Float,
// 10,000
sourceHorizontalFov: Float, // 180
sourceVerticalFov: Float,
// 180
clipHorizontalFov: Float,
// 180
clipVerticalFov: Float,
// 180
verticalSlices: Int,
// 60
horizontalSlices: Int
// 60
) -&gt; MeshResource? {
...
let mesh = try? MeshResource.generate(from: [meshDescriptor])
return mesh
}


# Page. 65

![Page Image](https://bcdn.docswell.com/page/4JM2N26NJW.jpg)

public static func generateVideoSphere(
radius: Float,
sourceHorizontalFov: Float,
sourceVerticalFov: Float,
clipHorizontalFov: Float,
clipVerticalFov: Float,
verticalSlices: Int,
horizontalSlices: Int
) -&gt; MeshResource? {
// Vertices
var vertices: [simd_float3] = Array(
repeating: simd_float3(), count: (verticalSlices + 1) * (horizontalSlices + 1))
let verticalScale: Float = clipVerticalFov / 180.0
let verticalOffset: Float = (1.0 - verticalScale) / 2.0
let horizontalScale: Float = clipHorizontalFov / 360.0
let horizontalOffset: Float = (1.0 - horizontalScale) / 2.0
for y: Int in 0...horizontalSlices {
let angle1 = ((Float.pi * (Float(y) / Float(horizontalSlices))) * verticalScale) + (verticalOffset * Float.pi)
let sin1 = sin(angle1)
let cos1 = cos(angle1)
for x: Int in 0...verticalSlices {
let angle2 =
((Float.pi * 2 * (Float(x) / Float(verticalSlices))) * horizontalScale)
+ (horizontalOffset * Float.pi * 2)
let sin2 = sin(angle2)
let cos2 = cos(angle2)
}
}
vertices[x + (y * (verticalSlices + 1))] = SIMD3&lt;Float&gt;(
sin1 * cos2 * radius, cos1 * radius, sin1 * sin2 * radius)
// Normals
var normals: [SIMD3&lt;Float&gt;] = []
for vertex in vertices {
normals.append(-normalize(vertex))
}
// Invert to show on inside of sphere
// UVs
var uvCoordinates: [simd_float2] = Array(repeating: simd_float2(), count: vertices.count)
let uvHorizontalScale = clipHorizontalFov / sourceHorizontalFov
let uvHorizontalOffset = (1.0 - uvHorizontalScale) / 2.0
let uvVerticalScale = clipVerticalFov / sourceVerticalFov
let uvVerticalOffset = (1.0 - uvVerticalScale) / 2.0
for y in 0...horizontalSlices {
for x in 0...verticalSlices {
var uv: simd_float2 = [
(Float(x) / Float(verticalSlices)), 1.0 - (Float(y) / Float(horizontalSlices)),
]
uv.x = (uv.x * uvHorizontalScale) + uvHorizontalOffset
uv.y = (uv.y * uvVerticalScale) + uvVerticalOffset
uvCoordinates[x + (y * (verticalSlices + 1))] = uv
}
}
// Indices / triangles
var indices: [UInt32] = []
for y in 0..&lt;horizontalSlices {
for x in 0..&lt;verticalSlices {
let current: UInt32 = UInt32(x) + (UInt32(y) * UInt32(verticalSlices + 1))
let next: UInt32 = current + UInt32(verticalSlices + 1)
indices.append(current + 1)
indices.append(current)
indices.append(next + 1)
}
}
indices.append(next + 1)
indices.append(current)
indices.append(next)
var meshDescriptor = MeshDescriptor(name: &quot;proceduralMesh&quot;)
meshDescriptor.positions = MeshBuffer(vertices)
meshDescriptor.normals = MeshBuffer(normals)
meshDescriptor.primitives = .triangles(indices)
meshDescriptor.textureCoordinates = MeshBuffer(uvCoordinates)
let mesh = try? MeshResource.generate(from: [meshDescriptor])
}
return mesh


# Page. 66

![Page Image](https://bcdn.docswell.com/page/PJRMDMP4E9.jpg)

// Vertices
var vertices: [simd_float3] = Array(
repeating: simd_float3(), count: (verticalSlices + 1) * (horizontalSlices + 1))
let verticalScale: Float = clipVerticalFov / 180.0
let verticalOffset: Float = (1.0 - verticalScale) / 2.0
let horizontalScale: Float = clipHorizontalFov / 360.0
let horizontalOffset: Float = (1.0 - horizontalScale) / 2.0
for y: Int in 0...horizontalSlices {
let angle1 = ((Float.pi * (Float(y) / Float(horizontalSlices))) * verticalScale) + (verticalOffset * Float.pi)
let sin1 = sin(angle1)
let cos1 = cos(angle1)
for x: Int in 0...verticalSlices {
let angle2 =
((Float.pi * 2 * (Float(x) / Float(verticalSlices))) * horizontalScale)
+ (horizontalOffset * Float.pi * 2)
let sin2 = sin(angle2)
let cos2 = cos(angle2)
vertices[x + (y * (verticalSlices + 1))] = SIMD3&lt;Float&gt;(
sin1 * cos2 * radius, cos1 * radius, sin1 * sin2 * radius)
}
}


# Page. 67

![Page Image](https://bcdn.docswell.com/page/PEXV1V3Z7X.jpg)

public static func generateVideoSphere(
radius: Float,
sourceHorizontalFov: Float,
sourceVerticalFov: Float,
clipHorizontalFov: Float,
clipVerticalFov: Float,
verticalSlices: Int,
horizontalSlices: Int
) -&gt; MeshResource? {
// Vertices
var vertices: [simd_float3] = Array(
repeating: simd_float3(), count: (verticalSlices + 1) * (horizontalSlices + 1))
let verticalScale: Float = clipVerticalFov / 180.0
let verticalOffset: Float = (1.0 - verticalScale) / 2.0
let horizontalScale: Float = clipHorizontalFov / 360.0
let horizontalOffset: Float = (1.0 - horizontalScale) / 2.0
for y: Int in 0...horizontalSlices {
let angle1 = ((Float.pi * (Float(y) / Float(horizontalSlices))) * verticalScale) + (verticalOffset * Float.pi)
let sin1 = sin(angle1)
let cos1 = cos(angle1)
for x: Int in 0...verticalSlices {
let angle2 =
((Float.pi * 2 * (Float(x) / Float(verticalSlices))) * horizontalScale)
+ (horizontalOffset * Float.pi * 2)
let sin2 = sin(angle2)
let cos2 = cos(angle2)
}
}
vertices[x + (y * (verticalSlices + 1))] = SIMD3&lt;Float&gt;(
sin1 * cos2 * radius, cos1 * radius, sin1 * sin2 * radius)
// Normals
var normals: [SIMD3&lt;Float&gt;] = []
for vertex in vertices {
normals.append(-normalize(vertex))
}
// Invert to show on inside of sphere
// UVs
var uvCoordinates: [simd_float2] = Array(repeating: simd_float2(), count: vertices.count)
let uvHorizontalScale = clipHorizontalFov / sourceHorizontalFov
let uvHorizontalOffset = (1.0 - uvHorizontalScale) / 2.0
let uvVerticalScale = clipVerticalFov / sourceVerticalFov
let uvVerticalOffset = (1.0 - uvVerticalScale) / 2.0
for y in 0...horizontalSlices {
for x in 0...verticalSlices {
var uv: simd_float2 = [
(Float(x) / Float(verticalSlices)), 1.0 - (Float(y) / Float(horizontalSlices)),
]
uv.x = (uv.x * uvHorizontalScale) + uvHorizontalOffset
uv.y = (uv.y * uvVerticalScale) + uvVerticalOffset
uvCoordinates[x + (y * (verticalSlices + 1))] = uv
}
}
// Indices / triangles
var indices: [UInt32] = []
for y in 0..&lt;horizontalSlices {
for x in 0..&lt;verticalSlices {
let current: UInt32 = UInt32(x) + (UInt32(y) * UInt32(verticalSlices + 1))
let next: UInt32 = current + UInt32(verticalSlices + 1)
indices.append(current + 1)
indices.append(current)
indices.append(next + 1)
}
}
indices.append(next + 1)
indices.append(current)
indices.append(next)
var meshDescriptor = MeshDescriptor(name: &quot;proceduralMesh&quot;)
meshDescriptor.positions = MeshBuffer(vertices)
meshDescriptor.normals = MeshBuffer(normals)
meshDescriptor.primitives = .triangles(indices)
meshDescriptor.textureCoordinates = MeshBuffer(uvCoordinates)
let mesh = try? MeshResource.generate(from: [meshDescriptor])
}
return mesh


# Page. 68

![Page Image](https://bcdn.docswell.com/page/3EKQ2QYVED.jpg)

// Normals
var normals: [SIMD3&lt;Float&gt;] = []
for vertex in vertices {
normals.append(-normalize(vertex))
}
// Invert to show on inside of sphere


# Page. 69

![Page Image](https://bcdn.docswell.com/page/L73P4PVQE5.jpg)

// Normals
var normals: [SIMD3&lt;Float&gt;] = []
for vertex in vertices {
normals.append(-normalize(vertex))
}
// Invert to show on inside of sphere


# Page. 70

![Page Image](https://bcdn.docswell.com/page/87DLQL8WEG.jpg)

public static func generateVideoSphere(
radius: Float,
sourceHorizontalFov: Float,
sourceVerticalFov: Float,
clipHorizontalFov: Float,
clipVerticalFov: Float,
verticalSlices: Int,
horizontalSlices: Int
) -&gt; MeshResource? {
// Vertices
var vertices: [simd_float3] = Array(
repeating: simd_float3(), count: (verticalSlices + 1) * (horizontalSlices + 1))
let verticalScale: Float = clipVerticalFov / 180.0
let verticalOffset: Float = (1.0 - verticalScale) / 2.0
let horizontalScale: Float = clipHorizontalFov / 360.0
let horizontalOffset: Float = (1.0 - horizontalScale) / 2.0
for y: Int in 0...horizontalSlices {
let angle1 = ((Float.pi * (Float(y) / Float(horizontalSlices))) * verticalScale) + (verticalOffset * Float.pi)
let sin1 = sin(angle1)
let cos1 = cos(angle1)
for x: Int in 0...verticalSlices {
let angle2 =
((Float.pi * 2 * (Float(x) / Float(verticalSlices))) * horizontalScale)
+ (horizontalOffset * Float.pi * 2)
let sin2 = sin(angle2)
let cos2 = cos(angle2)
}
}
vertices[x + (y * (verticalSlices + 1))] = SIMD3&lt;Float&gt;(
sin1 * cos2 * radius, cos1 * radius, sin1 * sin2 * radius)
// Normals
var normals: [SIMD3&lt;Float&gt;] = []
for vertex in vertices {
normals.append(-normalize(vertex))
}
// Invert to show on inside of sphere
// UVs
var uvCoordinates: [simd_float2] = Array(repeating: simd_float2(), count: vertices.count)
let uvHorizontalScale = clipHorizontalFov / sourceHorizontalFov
let uvHorizontalOffset = (1.0 - uvHorizontalScale) / 2.0
let uvVerticalScale = clipVerticalFov / sourceVerticalFov
let uvVerticalOffset = (1.0 - uvVerticalScale) / 2.0
for y in 0...horizontalSlices {
for x in 0...verticalSlices {
var uv: simd_float2 = [
(Float(x) / Float(verticalSlices)), 1.0 - (Float(y) / Float(horizontalSlices)),
]
uv.x = (uv.x * uvHorizontalScale) + uvHorizontalOffset
uv.y = (uv.y * uvVerticalScale) + uvVerticalOffset
uvCoordinates[x + (y * (verticalSlices + 1))] = uv
}
}
// Indices / triangles
var indices: [UInt32] = []
for y in 0..&lt;horizontalSlices {
for x in 0..&lt;verticalSlices {
let current: UInt32 = UInt32(x) + (UInt32(y) * UInt32(verticalSlices + 1))
let next: UInt32 = current + UInt32(verticalSlices + 1)
indices.append(current + 1)
indices.append(current)
indices.append(next + 1)
}
}
indices.append(next + 1)
indices.append(current)
indices.append(next)
var meshDescriptor = MeshDescriptor(name: &quot;proceduralMesh&quot;)
meshDescriptor.positions = MeshBuffer(vertices)
meshDescriptor.normals = MeshBuffer(normals)
meshDescriptor.primitives = .triangles(indices)
meshDescriptor.textureCoordinates = MeshBuffer(uvCoordinates)
let mesh = try? MeshResource.generate(from: [meshDescriptor])
}
return mesh


# Page. 71

![Page Image](https://bcdn.docswell.com/page/VJP2L28XJ8.jpg)

// UVs
var uvCoordinates: [simd_float2] = Array(repeating: simd_float2(), count: vertices.count)
let uvHorizontalScale = clipHorizontalFov / sourceHorizontalFov
let uvHorizontalOffset = (1.0 - uvHorizontalScale) / 2.0
let uvVerticalScale = clipVerticalFov / sourceVerticalFov
let uvVerticalOffset = (1.0 - uvVerticalScale) / 2.0
for y in 0...horizontalSlices {
for x in 0...verticalSlices {
var uv: simd_float2 = [
(Float(x) / Float(verticalSlices)), 1.0 - (Float(y) / Float(horizontalSlices)),
]
uv.x = (uv.x * uvHorizontalScale) + uvHorizontalOffset
uv.y = (uv.y * uvVerticalScale) + uvVerticalOffset
uvCoordinates[x + (y * (verticalSlices + 1))] = uv
}
}


# Page. 72

![Page Image](https://bcdn.docswell.com/page/2EVDQDN3EQ.jpg)

public static func generateVideoSphere(
radius: Float,
sourceHorizontalFov: Float,
sourceVerticalFov: Float,
clipHorizontalFov: Float,
clipVerticalFov: Float,
verticalSlices: Int,
horizontalSlices: Int
) -&gt; MeshResource? {
// Vertices
var vertices: [simd_float3] = Array(
repeating: simd_float3(), count: (verticalSlices + 1) * (horizontalSlices + 1))
let verticalScale: Float = clipVerticalFov / 180.0
let verticalOffset: Float = (1.0 - verticalScale) / 2.0
let horizontalScale: Float = clipHorizontalFov / 360.0
let horizontalOffset: Float = (1.0 - horizontalScale) / 2.0
for y: Int in 0...horizontalSlices {
let angle1 = ((Float.pi * (Float(y) / Float(horizontalSlices))) * verticalScale) + (verticalOffset * Float.pi)
let sin1 = sin(angle1)
let cos1 = cos(angle1)
for x: Int in 0...verticalSlices {
let angle2 =
((Float.pi * 2 * (Float(x) / Float(verticalSlices))) * horizontalScale)
+ (horizontalOffset * Float.pi * 2)
let sin2 = sin(angle2)
let cos2 = cos(angle2)
}
}
vertices[x + (y * (verticalSlices + 1))] = SIMD3&lt;Float&gt;(
sin1 * cos2 * radius, cos1 * radius, sin1 * sin2 * radius)
// Normals
var normals: [SIMD3&lt;Float&gt;] = []
for vertex in vertices {
normals.append(-normalize(vertex))
}
// Invert to show on inside of sphere
// UVs
var uvCoordinates: [simd_float2] = Array(repeating: simd_float2(), count: vertices.count)
let uvHorizontalScale = clipHorizontalFov / sourceHorizontalFov
let uvHorizontalOffset = (1.0 - uvHorizontalScale) / 2.0
let uvVerticalScale = clipVerticalFov / sourceVerticalFov
let uvVerticalOffset = (1.0 - uvVerticalScale) / 2.0
for y in 0...horizontalSlices {
for x in 0...verticalSlices {
var uv: simd_float2 = [
(Float(x) / Float(verticalSlices)), 1.0 - (Float(y) / Float(horizontalSlices)),
]
uv.x = (uv.x * uvHorizontalScale) + uvHorizontalOffset
uv.y = (uv.y * uvVerticalScale) + uvVerticalOffset
uvCoordinates[x + (y * (verticalSlices + 1))] = uv
}
}
// Indices / triangles
var indices: [UInt32] = []
for y in 0..&lt;horizontalSlices {
for x in 0..&lt;verticalSlices {
let current: UInt32 = UInt32(x) + (UInt32(y) * UInt32(verticalSlices + 1))
let next: UInt32 = current + UInt32(verticalSlices + 1)
indices.append(current + 1)
indices.append(current)
indices.append(next + 1)
}
}
indices.append(next + 1)
indices.append(current)
indices.append(next)
var meshDescriptor = MeshDescriptor(name: &quot;proceduralMesh&quot;)
meshDescriptor.positions = MeshBuffer(vertices)
meshDescriptor.normals = MeshBuffer(normals)
meshDescriptor.primitives = .triangles(indices)
meshDescriptor.textureCoordinates = MeshBuffer(uvCoordinates)
let mesh = try? MeshResource.generate(from: [meshDescriptor])
}
return mesh


# Page. 73

![Page Image](https://bcdn.docswell.com/page/57GYWYKY7L.jpg)

// Indices / triangles
var indices: [UInt32] = []
for y in 0..&lt;horizontalSlices {
for x in 0..&lt;verticalSlices {
let current: UInt32 = UInt32(x) + (UInt32(y) * UInt32(verticalSlices + 1))
let next: UInt32 = current + UInt32(verticalSlices + 1)
indices.append(current + 1)
indices.append(current)
indices.append(next + 1)
indices.append(next + 1)
indices.append(current)
indices.append(next)
}
}


# Page. 74

![Page Image](https://bcdn.docswell.com/page/4EQM3MN6JP.jpg)

public static func generateVideoSphere(
radius: Float,
sourceHorizontalFov: Float,
sourceVerticalFov: Float,
clipHorizontalFov: Float,
clipVerticalFov: Float,
verticalSlices: Int,
horizontalSlices: Int
) -&gt; MeshResource? {
// Vertices
var vertices: [simd_float3] = Array(
repeating: simd_float3(), count: (verticalSlices + 1) * (horizontalSlices + 1))
let verticalScale: Float = clipVerticalFov / 180.0
let verticalOffset: Float = (1.0 - verticalScale) / 2.0
let horizontalScale: Float = clipHorizontalFov / 360.0
let horizontalOffset: Float = (1.0 - horizontalScale) / 2.0
for y: Int in 0...horizontalSlices {
let angle1 = ((Float.pi * (Float(y) / Float(horizontalSlices))) * verticalScale) + (verticalOffset * Float.pi)
let sin1 = sin(angle1)
let cos1 = cos(angle1)
for x: Int in 0...verticalSlices {
let angle2 =
((Float.pi * 2 * (Float(x) / Float(verticalSlices))) * horizontalScale)
+ (horizontalOffset * Float.pi * 2)
let sin2 = sin(angle2)
let cos2 = cos(angle2)
}
}
vertices[x + (y * (verticalSlices + 1))] = SIMD3&lt;Float&gt;(
sin1 * cos2 * radius, cos1 * radius, sin1 * sin2 * radius)
// Normals
var normals: [SIMD3&lt;Float&gt;] = []
for vertex in vertices {
normals.append(-normalize(vertex))
}
// Invert to show on inside of sphere
// UVs
var uvCoordinates: [simd_float2] = Array(repeating: simd_float2(), count: vertices.count)
let uvHorizontalScale = clipHorizontalFov / sourceHorizontalFov
let uvHorizontalOffset = (1.0 - uvHorizontalScale) / 2.0
let uvVerticalScale = clipVerticalFov / sourceVerticalFov
let uvVerticalOffset = (1.0 - uvVerticalScale) / 2.0
for y in 0...horizontalSlices {
for x in 0...verticalSlices {
var uv: simd_float2 = [
(Float(x) / Float(verticalSlices)), 1.0 - (Float(y) / Float(horizontalSlices)),
]
uv.x = (uv.x * uvHorizontalScale) + uvHorizontalOffset
uv.y = (uv.y * uvVerticalScale) + uvVerticalOffset
uvCoordinates[x + (y * (verticalSlices + 1))] = uv
}
}
// Indices / triangles
var indices: [UInt32] = []
for y in 0..&lt;horizontalSlices {
for x in 0..&lt;verticalSlices {
let current: UInt32 = UInt32(x) + (UInt32(y) * UInt32(verticalSlices + 1))
let next: UInt32 = current + UInt32(verticalSlices + 1)
indices.append(current + 1)
indices.append(current)
indices.append(next + 1)
}
}
indices.append(next + 1)
indices.append(current)
indices.append(next)
var meshDescriptor = MeshDescriptor(name: &quot;proceduralMesh&quot;)
meshDescriptor.positions = MeshBuffer(vertices)
meshDescriptor.normals = MeshBuffer(normals)
meshDescriptor.primitives = .triangles(indices)
meshDescriptor.textureCoordinates = MeshBuffer(uvCoordinates)
let mesh = try? MeshResource.generate(from: [meshDescriptor])
}
return mesh


# Page. 75

![Page Image](https://bcdn.docswell.com/page/KJ4V1VGME1.jpg)

var meshDescriptor = MeshDescriptor(name: &quot;proceduralMesh&quot;)
meshDescriptor.positions = MeshBuffer(vertices)
meshDescriptor.normals = MeshBuffer(normals)
meshDescriptor.primitives = .triangles(indices)
meshDescriptor.textureCoordinates = MeshBuffer(uvCoordinates)
let mesh = try? MeshResource.generate(from: [meshDescriptor])
return mesh
}


# Page. 76

![Page Image](https://bcdn.docswell.com/page/LE13G3DYJG.jpg)

Viewer Implementation
Player


# Page. 77

![Page Image](https://bcdn.docswell.com/page/GEWPKPY1J2.jpg)

@State private var player: AVPlayer = AVPlayer()
@State private var videoMaterial: VideoMaterial?
RealityView { content in
guard let url = viewModel.videoURL else { return }
let asset = AVURLAsset(url: url)
let playerItem = AVPlayerItem(asset: asset)
guard let videoInfo = await VideoTools.getVideoInfo(asset: asset) else { return }
viewModel.videoInfo = videoInfo
viewModel.isSpatialVideoAvailable = videoInfo.isSpatial
guard let (mesh, transform) = await VideoTools.makeVideoMesh(videoInfo: videoInfo) else { return }
videoMaterial = VideoMaterial(avPlayer: player)
guard let videoMaterial else { return }
let videoEntity = Entity()
videoEntity.components.set(ModelComponent(mesh: mesh, materials: [videoMaterial]))
videoEntity.transform = transform
content.add(videoEntity)
player.replaceCurrentItem(with: playerItem)
player.play()
}


# Page. 78

![Page Image](https://bcdn.docswell.com/page/47ZKZKXX73.jpg)

@State private var player: AVPlayer = AVPlayer()
@State private var videoMaterial: VideoMaterial?
RealityView { content in
guard let url = viewModel.videoURL else { return }
let asset = AVURLAsset(url: url)
let playerItem = AVPlayerItem(asset: asset)
guard let videoInfo = await VideoTools.getVideoInfo(asset: asset) else { return }
viewModel.videoInfo = videoInfo
viewModel.isSpatialVideoAvailable = videoInfo.isSpatial
guard let (mesh, transform) = await VideoTools.makeVideoMesh(videoInfo: videoInfo) else { return }
videoMaterial = VideoMaterial(avPlayer: player)
guard let videoMaterial else { return }
let videoEntity = Entity()
videoEntity.components.set(ModelComponent(mesh: mesh, materials: [videoMaterial]))
videoEntity.transform = transform
content.add(videoEntity)
player.replaceCurrentItem(with: playerItem)
player.play()
}


# Page. 79

![Page Image](https://bcdn.docswell.com/page/YJ6QZQ4PJV.jpg)

@State private var player: AVPlayer = AVPlayer()
@State private var videoMaterial: VideoMaterial?
RealityView { content in
guard let url = viewModel.videoURL else { return }
let asset = AVURLAsset(url: url)
let playerItem = AVPlayerItem(asset: asset)
guard let videoInfo = await VideoTools.getVideoInfo(asset: asset) else { return }
viewModel.videoInfo = videoInfo
viewModel.isSpatialVideoAvailable = videoInfo.isSpatial
guard let (mesh, transform) = await VideoTools.makeVideoMesh(videoInfo: videoInfo) else { return }
videoMaterial = VideoMaterial(avPlayer: player)
guard let videoMaterial else { return }
let videoEntity = Entity()
videoEntity.components.set(ModelComponent(mesh: mesh, materials: [videoMaterial]))
videoEntity.transform = transform
content.add(videoEntity)
player.replaceCurrentItem(with: playerItem)
player.play()
}


# Page. 80

![Page Image](https://bcdn.docswell.com/page/GJ5RWRQP74.jpg)

@State private var player: AVPlayer = AVPlayer()
@State private var videoMaterial: VideoMaterial?
RealityView { content in
guard let url = viewModel.videoURL else { return }
let asset = AVURLAsset(url: url)
let playerItem = AVPlayerItem(asset: asset)
guard let videoInfo = await VideoTools.getVideoInfo(asset: asset) else { return }
viewModel.videoInfo = videoInfo
viewModel.isSpatialVideoAvailable = videoInfo.isSpatial
guard let (mesh, transform) = await VideoTools.makeVideoMesh(videoInfo: videoInfo) else { return }
videoMaterial = VideoMaterial(avPlayer: player)
guard let videoMaterial else { return }
let videoEntity = Entity()
videoEntity.components.set(ModelComponent(mesh: mesh, materials: [videoMaterial]))
videoEntity.transform = transform
content.add(videoEntity)
player.replaceCurrentItem(with: playerItem)
player.play()
}


# Page. 81

![Page Image](https://bcdn.docswell.com/page/9E2DQDPZER.jpg)

@State private var player: AVPlayer = AVPlayer()
@State private var videoMaterial: VideoMaterial?
RealityView { content in
guard let url = viewModel.videoURL else { return }
let asset = AVURLAsset(url: url)
let playerItem = AVPlayerItem(asset: asset)
guard let videoInfo = await VideoTools.getVideoInfo(asset: asset) else { return }
viewModel.videoInfo = videoInfo
viewModel.isSpatialVideoAvailable = videoInfo.isSpatial
guard let (mesh, transform) = await VideoTools.makeVideoMesh(videoInfo: videoInfo) else { return }
videoMaterial = VideoMaterial(avPlayer: player)
guard let videoMaterial else { return }
let videoEntity = Entity()
videoEntity.components.set(ModelComponent(mesh: mesh, materials: [videoMaterial]))
videoEntity.transform = transform
content.add(videoEntity)
player.replaceCurrentItem(with: playerItem)
player.play()
}


# Page. 82

![Page Image](https://bcdn.docswell.com/page/D7Y2W25N7M.jpg)

Build compelling spatial photo and video experiences
6
6
1
0
1
4
2
0
2
https://developer.apple.com/videos/play/wwdc
/


# Page. 83

![Page Image](https://bcdn.docswell.com/page/VEN898NVJ8.jpg)

Immersive Video Shooting Work ow
Viewer Implementation
fl
ff
Demo Event: Key E orts and Outcomes


# Page. 84

![Page Image](https://bcdn.docswell.com/page/Y79K2KRV73.jpg)

Immersive Video Shooting Work ow
Viewer Implementation
fl
ff
Demo Event: Key E orts and Outcomes


# Page. 85

![Page Image](https://bcdn.docswell.com/page/G78R5RW4ED.jpg)

Demo Event: Key E orts and Outcomes
Key E orts
ff
ff
Outcomes


# Page. 86

![Page Image](https://bcdn.docswell.com/page/L7LKYKNVER.jpg)

Key E orts
Simple Experience Design
Prepared an instruction guide
No guest mode required
Glasses-friendly
One action to start the experience
ff
Removed unnecessary features


# Page. 87

![Page Image](https://bcdn.docswell.com/page/4EM2N2XNEW.jpg)

Key E orts
Simple Experience Design
Prepared an instruction guide
No guest mode required
Glasses-friendly
One action to start the experience
ff
Removed unnecessary features


# Page. 88

![Page Image](https://bcdn.docswell.com/page/PERMDMN479.jpg)

Development Menu / File loading feature
Playback thumbnail position tracking /
Playback button press detection / Seek bar for Ops
Immersive Space from startup / Pre-play music
Playback button animation / Back button behind the screen
End message / Pause and resume functionality
88


# Page. 89

![Page Image](https://bcdn.docswell.com/page/P7XV1VNZJX.jpg)

Development Menu / File loading feature
Playback thumbnail position tracking /
Playback button press detection / Seek bar for Ops
Immersive Space from startup / Pre-play music
Playback button animation / Back button behind the screen
End message / Pause and resume functionality
89


# Page. 90

![Page Image](https://bcdn.docswell.com/page/37KQ2QNV7D.jpg)



# Page. 91

![Page Image](https://bcdn.docswell.com/page/LJ3P4PZQ75.jpg)

Development Menu / File loading feature
Playback thumbnail position tracking /
Playback button press detection / Seek bar for Ops
Immersive Space from startup / Pre-play music
Playback button animation / Back button behind the screen
End message / Pause and resume functionality
91


# Page. 92

![Page Image](https://bcdn.docswell.com/page/8JDLQLRW7G.jpg)



# Page. 93

![Page Image](https://bcdn.docswell.com/page/VEP2L2WXE8.jpg)



# Page. 94

![Page Image](https://bcdn.docswell.com/page/27VDQD837Q.jpg)

Development Menu / File loading feature
Playback thumbnail position tracking /
Playback button press detection / Seek bar for Ops
Immersive Space from startup / Pre-play music
Playback button animation / Back button behind the screen
End message / Pause and resume functionality
94


# Page. 95

![Page Image](https://bcdn.docswell.com/page/5JGYWY5YJL.jpg)



# Page. 96

![Page Image](https://bcdn.docswell.com/page/47QM3MZ6EP.jpg)

VideoPlayer.swift
func openStream(_ stream: StreamModel) {
stop()
title = stream.title
details = stream.details
let documentsURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0]
let destinationURL = documentsURL.appendingPathComponent(stream.url.lastPathComponent)
do {
if FileManager.default.fileExists(atPath: destinationURL.path) {
copyAndRenameFileInDocuments(fileName: destinationURL.lastPathComponent)
} else {
defer { stream.url.stopAccessingSecurityScopedResource() }
_ = stream.url.startAccessingSecurityScopedResource()
try FileManager.default.copyItem(at: stream.url, to: destinationURL)
}
} catch {
print(error.localizedDescription)
return
}
let playerItem = AVPlayerItem(url: destinationURL)
playerItem.preferredPeakBitRate = 200_000_000 // 200 Mbps
player.replaceCurrentItem(with: playerItem)
scrubState = .notScrubbing
setupObservers()
}


# Page. 97

![Page Image](https://bcdn.docswell.com/page/KE4V1V3M71.jpg)

VideoPlayer.swift
func openStream(_ stream: StreamModel) {
stop()
title = stream.title
details = stream.details
let documentsURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0]
let destinationURL = documentsURL.appendingPathComponent(stream.url.lastPathComponent)
do {
if FileManager.default.fileExists(atPath: destinationURL.path) {
copyAndRenameFileInDocuments(fileName: destinationURL.lastPathComponent)
} else {
defer { stream.url.stopAccessingSecurityScopedResource() }
_ = stream.url.startAccessingSecurityScopedResource()
try FileManager.default.copyItem(at: stream.url, to: destinationURL)
}
} catch {
print(error.localizedDescription)
return
}
let playerItem = AVPlayerItem(url: destinationURL)
playerItem.preferredPeakBitRate = 200_000_000 // 200 Mbps
player.replaceCurrentItem(with: playerItem)
scrubState = .notScrubbing
setupObservers()
}


# Page. 98

![Page Image](https://bcdn.docswell.com/page/L713G31YEG.jpg)

VideoPlayer.swift
private func copyAndRenameFileInDocuments(fileName: String) {
let fileManager = FileManager.default
let documentsURL = fileManager.urls(for: .documentDirectory, in: .userDomainMask).first!
let originalFileURL = documentsURL.appendingPathComponent(fileName)
let copyFileURL = documentsURL.appendingPathComponent(&quot;\(fileName)_copy&quot;)
do {
guard fileManager.fileExists(atPath: originalFileURL.path) else { return }
if fileManager.fileExists(atPath: copyFileURL.path) {
try fileManager.removeItem(at: copyFileURL) // delete &quot;_copy&quot; file is exists
}
try fileManager.copyItem(at: originalFileURL, to: copyFileURL)
} catch { return }
do {
try fileManager.removeItem(at: originalFileURL)
} catch { return }
do {
try fileManager.moveItem(at: copyFileURL, to: originalFileURL)
} catch { // print error }
}
Warning: It&#039;s workaround


# Page. 99

![Page Image](https://bcdn.docswell.com/page/G7WPKP81E2.jpg)

VideoPlayer.swift
private func copyAndRenameFileInDocuments(fileName: String) {
let fileManager = FileManager.default
let documentsURL = fileManager.urls(for: .documentDirectory, in: .userDomainMask).first!
let originalFileURL = documentsURL.appendingPathComponent(fileName)
let copyFileURL = documentsURL.appendingPathComponent(&quot;\(fileName)_copy&quot;)
do {
guard fileManager.fileExists(atPath: originalFileURL.path) else { return }
if fileManager.fileExists(atPath: copyFileURL.path) {
try fileManager.removeItem(at: copyFileURL) // delete &quot;_copy&quot; file is exists
}
try fileManager.copyItem(at: originalFileURL, to: copyFileURL)
} catch { return }
do {
try fileManager.removeItem(at: originalFileURL)
} catch { return }
do {
try fileManager.moveItem(at: copyFileURL, to: originalFileURL)
} catch { // print error }
}
Warning: It&#039;s workaround


# Page. 100

![Page Image](https://bcdn.docswell.com/page/4JZKZK8XJ3.jpg)

Development Menu / File loading feature
Playback thumbnail position tracking /
Playback button press detection / Seek bar for Ops
Immersive Space from startup / Pre-play music
Playback button animation / Back button behind the screen
End message / Pause and resume functionality
100


# Page. 101

![Page Image](https://bcdn.docswell.com/page/YE6QZQPPEV.jpg)



# Page. 102

![Page Image](https://bcdn.docswell.com/page/GE5RWRKPJ4.jpg)

SelectionView.swift
DragGesture(minimumDistance: 0)
.targetedToAnyEntity()
.onChanged { value in
guard let entity = value.entity.children.first(where: { $0.name == &quot;PlayButton&quot; }) else { return }
guard !isPressed else { return }
if initialTransform == nil {
initialTransform = entity.transform
var pressedTransform = Transform()
pressedTransform.scale = initialTransform!.scale * 0.8
pressedTransform.translation.x += 0.01
entity.move(to: pressedTransform, relativeTo: entity.parent, duration: 0.2,
timingFunction: .easeInOut)
}
isPressed = true
}
.onEnded { value in
guard let entity = value.entity.children.first(where: { $0.name == &quot;PlayButton&quot; }) else { return }
guard isPressed else { return }
entity.move(to: initialTransform!, relativeTo: entity.parent, duration: 0.2, timingFunction: .easeInOut)
initialTransform = nil
isPressed = false
guard let str = UserDefaults.standard.string(forKey: AppModel.selectedFileURL),
let url = URL(string: str)
else { return }
let stream = StreamModel(title: url.lastPathComponent, details: &quot;&quot;, url: url)
}
appModel.selectedStream = stream
appModel.isSelectionMode = false


# Page. 103

![Page Image](https://bcdn.docswell.com/page/972DQDWZ7R.jpg)

SelectionView.swift
DragGesture(minimumDistance: 0)
.targetedToAnyEntity()
.onChanged { value in
guard let entity = value.entity.children.first(where: { $0.name == &quot;PlayButton&quot; }) else { return }
guard !isPressed else { return }
if initialTransform == nil {
initialTransform = entity.transform
var pressedTransform = Transform()
pressedTransform.scale = initialTransform!.scale * 0.8
pressedTransform.translation.x += 0.01
entity.move(to: pressedTransform, relativeTo: entity.parent, duration: 0.2,
timingFunction: .easeInOut)
}
isPressed = true
}
.onEnded { value in
guard let entity = value.entity.children.first(where: { $0.name == &quot;PlayButton&quot; }) else { return }
guard isPressed else { return }
entity.move(to: initialTransform!, relativeTo: entity.parent, duration: 0.2, timingFunction: .easeInOut)
initialTransform = nil
isPressed = false
guard let str = UserDefaults.standard.string(forKey: AppModel.selectedFileURL),
let url = URL(string: str)
else { return }
let stream = StreamModel(title: url.lastPathComponent, details: &quot;&quot;, url: url)
}
appModel.selectedStream = stream
appModel.isSelectionMode = false


# Page. 104

![Page Image](https://bcdn.docswell.com/page/DJY2W2LNJM.jpg)

Demo Event: Key E orts and Outcomes
Key E orts
ff
ff
Outcomes


# Page. 105

![Page Image](https://bcdn.docswell.com/page/V7N8984VE8.jpg)

Outcomes
[Platinum Members Only]
Pre-Season Immersive Experience
Tour Announcement
0
0
3
0
1
8
1
2
Out of
platinum members:
→
applied
→
participated in the experience


# Page. 106

![Page Image](https://bcdn.docswell.com/page/YJ9K2KQVJ3.jpg)

Survey Results
Evaluation of ZELVISION XR at the Demo Event
- Every respondent rated the experience as “satisfactory” or higher.
- Over half said it was “the most enjoyable” among all available content.
Expectations for Future Content
-
% of respondents said they “strongly want to watch the next one,”
8
8
showing high anticipation for future releases.


# Page. 107

![Page Image](https://bcdn.docswell.com/page/GJ8R5RG47D.jpg)

Participant Feedback
&quot;The intensity and presence during the match were on a whole di erent
level. Seeing the players send-o and the pitchside view—things you can&#039;t
normally experience—were truly unique to ZELVISION XR!&quot;
&quot;The pitchside footage was fantastic, and the stadium atmosphere came
through perfectly. I think it’s a great way to attract new fans to the stadium.&quot;
&quot;I felt incredibly close to the players—it was almost as if I could actually
ff
ff
fi
high- ve them.&quot;


# Page. 108

![Page Image](https://bcdn.docswell.com/page/LJLKYKGV7R.jpg)



# Page. 109

![Page Image](https://bcdn.docswell.com/page/47M2N2QN7W.jpg)

Wrap up
You can shoot and implement this.
The ecosystem will continue to grow.
Building it yourself deepens understanding
and opens up new possibilities.
X: @shmdevelop


# Page. 110

![Page Image](https://bcdn.docswell.com/page/P7RMDM84J9.jpg)

Latest Updates


# Page. 111

![Page Image](https://bcdn.docswell.com/page/PJXV1V8ZEX.jpg)

Latest Updates


# Page. 112

![Page Image](https://bcdn.docswell.com/page/3JKQ2QKVJD.jpg)

Latest Updates
Blackmagic URSA Cine Immersive から Vision Pro まで: DaVinci
Resolve を使
した完全なワークフロー | NAB
5
2
0
0
2
3
2
用
–
https://www.youtube.com/watch?v=RyDnqD aBoc
Blackmagic Design URSA Cine Immersiveカメラ、Apple Vision
Pro対応 インタビュー
https://www.youtube.com/watch?v=QrV haN HOc


