Conversation
|
Found 2 unused localization strings in the codebase. Click to see detailsTo remove them, run the |
There was a problem hiding this comment.
Pull request overview
Adds two-way audio (“talkback”) support to the in-app WebRTC camera player by introducing a microphone toggle (when supported by the camera entity) and renegotiating the WebRTC session using camera/webrtc/re_offer.
Changes:
- Adds localized strings and SwiftGen accessors for talkback UI labels and microphone-permission messaging.
- Extends the WebRTC player/view model to detect talkback support, request microphone permission, and trigger WebRTC re-offer renegotiation.
- Updates
WebRTCClientto support an optional local microphone track and to preserve mute state when remote audio tracks change.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| Sources/Shared/Resources/Swiftgen/Strings.swift | Adds SwiftGen accessors for new talkback localization keys. |
| Sources/App/Resources/en.lproj/Localizable.strings | Adds English strings for talkback labels and microphone-denied messaging. |
| Sources/App/Cameras/CameraPlayer/WebRTC/WebRTCViewPlayerViewModel.swift | Implements talkback state, mic permission request, and re-offer signaling handling. |
| Sources/App/Cameras/CameraPlayer/WebRTC/WebRTCVideoPlayerView.swift | Adds mic toggle to the player toolbar (shown only when talkback is supported). |
| Sources/App/Cameras/CameraPlayer/WebRTC/WebRTCClient.swift | Adds optional microphone-track support and separates playback vs recording peer-connection factories. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4994 +/- ##
=======================================
Coverage ? 52.01%
=======================================
Files ? 299
Lines ? 19656
Branches ? 0
=======================================
Hits ? 10225
Misses ? 9431
Partials ? 0 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Flips on the talkback UI shipped hidden in the camera-player UI PR: - WebRTCClient: recording-capable audio factory + mic track, setMicrophoneEnabled, playAndRecord/videoChat audio session, and audio-session release on closeConnection. - ViewModel: detect TWO_WAY_AUDIO via supported_features (connection.caches.states), connect with/without talkback, request mic permission, real toggleTalkback, onClientReady. - ViewController: attach the video renderer once the client is created (async).
Reset the process-wide RTCAudioSessionConfiguration back to playback and deactivate the session on closeConnection, so a talkback session's playAndRecord/videoChat configuration no longer persists to later WebRTC playback sessions. Talkback-capable cameras re-arm it on connect.
Summary
Adds two-way audio to the in-app WebRTC camera player. A mic toggle appears in the player when the camera reports the
TWO_WAY_AUDIOfeature, enabling it adds a local microphone track and renegotiates the session viacamera/webrtc/re_offer.Depends on backend support from home-assistant/core#148282.
Screenshots
Link to pull request in Documentation repository
Documentation: home-assistant/companion.home-assistant#
Any other notes