Camera player UI improvements#5149
Conversation
|
Found 5 unused localization strings in the codebase. Click to see detailsTo remove them, run the |
There was a problem hiding this comment.
Pull request overview
This PR refactors the in-app WebRTC camera player UI by extracting player controls into a reusable SwiftUI view, moving the UIViewControllerRepresentable wrapper into its own file, and adjusting the camera player navigation/title layout to better fit the updated controls design (as groundwork for the stacked two-way-audio PR).
Changes:
- Extract WebRTC toolbar controls (mute + talkback UI) into
WebRTCVideoPlayerControlsView. - Add a standalone
WebRTCVideoPlayerViewControllerWrapperto hostWebRTCVideoPlayerViewControllerfrom SwiftUI. - Rework
WebRTCVideoPlayerViewandCameraPlayerViewlayout/toolbar placements and add SwiftUI previews.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| Sources/App/Cameras/CameraPlayer/WebRTC/WebRTCVideoPlayerViewControllerWrapper.swift | Introduces a standalone UIViewControllerRepresentable wrapper for the WebRTC player VC. |
| Sources/App/Cameras/CameraPlayer/WebRTC/WebRTCVideoPlayerView.swift | Uses the extracted controls view and removes the previously inlined wrapper; adds a #Preview. |
| Sources/App/Cameras/CameraPlayer/WebRTC/WebRTCVideoPlayerControlsView.swift | New extracted SwiftUI control surface (talkback + mute) used by the WebRTC player view. |
| Sources/App/Cameras/CameraPlayer/CameraPlayerView.swift | Adjusts toolbar placements and constrains the title/subtitle label width for the updated UI. |
Summary
Camera player UI improvements, independent of two-way audio:
WebRTCVideoPlayerControlsView.WebRTCVideoPlayerViewControllerWrapper(aUIViewControllerRepresentablethat drives the player view controller from SwiftUI via anisVideoPlayingbinding).WebRTCVideoPlayerViewandCameraPlayerViewlayout.The talkback control is present but stays hidden (gated on
isTalkbackSupported, which isfalseonmain), so this PR is purely UI and adds no two-way-audio behavior.Base for the stacked two-way-audio PR #4994.
Screenshots
Link to pull request in Documentation repository
Documentation: home-assistant/companion.home-assistant#
Any other notes