FoveatedStreamingSession
A session that manages a foveated streaming connection to a local or remote streaming endpoint.
Declaration
@MainActor final class FoveatedStreamingSessionMentioned in
Overview
Use FoveatedStreamingSession to establish and manage streaming connections from Apple Vision Pro to local or remote endpoints. The session handles connection life cycle, monitors streaming status, and provides access to bidirectional message channels for custom data exchange.
You create a FoveatedStreamingSession object directly, typically on app initialization. After creating your session object, use it to initialize the ImmersiveSpace that displays the streamed content. To begin streaming spatial content, call the connect(endpoint:) function. The connection will fail if your app doesn’t have the com.apple.developer.foveated-streaming-session entitlement.
The following example shows how to connect to a stream and present its content in an immersive space:
struct FoveatedStreamingApp: App {
let session = FoveatedStreamingSession()
var body: some Scene {
WindowGroup {
Button("Connect") {
Task {
try await session.connect(endpoint: .systemDiscovered)
}
}
}
ImmersiveSpace(foveatedStreaming: session)
}
}Topics
Classes
Structures
FoveatedStreamingSession.DisconnectReasonFoveatedStreamingSession.EndpointFoveatedStreamingSession.ImmersivePresentationBehaviors