class StreamSession: Sendable
errorPublisher
: any Announcer<StreamSessionError>
[Get] |
Publisher for errors that occur during the streaming session.
|
photoDataPublisher
: any Announcer<PhotoData>
[Get] |
Publisher for photo data captured during the streaming session.
|
state
: StreamSessionState
[Get] |
The current state of the streaming session.
|
statePublisher
: any Announcer<StreamSessionState>
[Get] |
Publisher for streaming session state changes.
|
streamSessionConfig
: StreamSessionConfig |
The configuration used for this streaming session.
|
videoFramePublisher
: any Announcer<VideoFrame>
[Get] |
Publisher for video frames received from the streaming session.
|
capturePhoto
(
format
)
|
Captures a still photo during streaming.
Triggers a photo capture while video streaming is active. The captured photo is delivered through photoDataPublisher. Video streaming is temporarily paused during capture and automatically resumes after photo delivery.
Signature
public func capturePhoto( format: PhotoCaptureFormat) -> Bool Parameters Returns Bool true if the capture request was accepted, false if no device session is active, a capture is already in progress, or the underlying capture request fails.
|
start
()
|
Starts video streaming from the device.
Begins streaming video frames from the currently available device. If no device is currently available, the session enters .waitingForDevice state and automatically connects when a device becomes available. Video frames are delivered through videoFramePublisher.
State transitions: .stopped -> .waitingForDevice (no device) or .stopped -> .starting -> .streaming (with device).
The session monitors for device availability and automatically connects when a device becomes available and publishes errors if the device is invalid. The session automatically stops when an error occurs or when the device session ends externally (e.g., device powered off).
Signature
public func start() |
stop
()
|
Stops video streaming and releases all resources.
Shuts down the streaming pipeline and transitions to .stopped state.
State transitions: Any state -> .stopping -> .stopped
Signature
public func stop() |