Help us improve
Share bugs, ideas, or general feedback.
How this skill is triggered — by the user, by Claude, or both
Slash command
/mwdat-ios:camera-streamingThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Guide for implementing camera streaming and photo capture with the DAT SDK.
Sets up camera streaming sessions on Android devices using Meta Wearables SDK. Provides frame reception, photo capture, and resolution/frame rate configuration.
Guides building an iOS DAT app with camera streaming and photo capture, covering project setup, SDK initialization, and ViewModel architecture.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Share bugs, ideas, or general feedback.
Guide for implementing camera streaming and photo capture with the DAT SDK.
.makeUIImage() to renderimport MWDATCamera
import MWDATCore
let wearables = Wearables.shared
let deviceSelector = AutoDeviceSelector(wearables: wearables)
// Or for a specific device: SpecificDeviceSelector(device: deviceId)
let deviceSession = try wearables.createSession(deviceSelector: deviceSelector)
try deviceSession.start()
// Wait for the device session to reach the started state
for await state in deviceSession.stateStream() {
if state == .started { break }
}
Once the DeviceSession is started, add a Stream capability:
let config = StreamConfiguration(
videoCodec: .raw,
resolution: .medium, // 504x896
frameRate: 24
)
guard let stream = try deviceSession.addStream(config: config) else {
// DeviceSession must be in the started state before adding a stream
return
}
| Resolution | Size |
|---|---|
.high | 720 x 1280 |
.medium | 504 x 896 |
.low | 360 x 640 |
Valid values: 2, 7, 15, 24, 30 FPS.
Lower resolution and frame rate yield higher visual quality due to less Bluetooth compression.
StreamState transitions: stopping → stopped → waitingForDevice → starting → streaming → paused
let stateToken = stream.statePublisher.listen { state in
Task { @MainActor in
switch state {
case .streaming:
// Stream is active, frames are flowing
case .waitingForDevice:
// Waiting for glasses to connect
case .stopped:
// Stream ended — release resources
case .paused:
// Temporarily suspended — keep connection, wait
default:
break
}
}
}
let frameToken = stream.videoFramePublisher.listen { frame in
guard let image = frame.makeUIImage() else { return }
Task { @MainActor in
self.previewImage = image
}
}
// Start the stream capability
Task { await stream.start() }
// Stop streaming
Task { await stream.stop() }
// Stop the parent device session when you're done with all capabilities
deviceSession.stop()
Capture a still photo while streaming:
// Listen for photo data
let photoToken = stream.photoDataPublisher.listen { photoData in
let imageData = photoData.data
// Convert to UIImage or save
}
// Trigger capture
stream.capturePhoto(format: .jpeg)
Resolution and frame rate are constrained by Bluetooth Classic bandwidth. The SDK automatically reduces quality when bandwidth is limited:
Request lower settings for higher visual quality per frame.