View Homekit Camera Live Stream

Hello,

My goal is to display the live video stream from a HomeKit camera in my Swift/SwiftUI iOS app.

Using HMHomeManager, I have retrieved the HMHome object and found the camera as an HMAccessory object. Within this, I have located the HMCameraProfile and, through it, the HMCameraStreamControl. So far, I believe I understand the object model.

However, I do not know how to display the stream.

I have come across the CameraView, but I am not sure how to access the required HMCameraSource for the CameraView from the aforementioned object model.

Is my current approach fundamentally incorrect?

I would appreciate it if you could explain the relationships involved and possibly point me to an example project.

Best regards, Matthias

View Homekit Camera Live Stream
 
 
Q