Don't add audio track is webrtc player is muted

pull/25767/head
Paul Bottein 2025-06-12 14:58:06 +02:00
parent 01d2ef13c6
commit 1228f17ffb
No known key found for this signature in database
2 changed files with 7 additions and 2 deletions

View File

@ -220,9 +220,10 @@ export class HaCameraStream extends LitElement {
if (
hlsStreams.hasVideo &&
hlsStreams.hasAudio &&
!webRtcStreams.hasAudio
!webRtcStreams.hasAudio &&
!this.muted
) {
// webRTC stream is missing audio, use HLS
// webRTC stream is missing audio and video is not muted, use HLS
return [{ type: STREAM_TYPE_HLS, visible: true }];
}
if (webRtcStreams.hasVideo) {

View File

@ -308,6 +308,10 @@ class HaWebRtcPlayer extends LitElement {
if (!this._remoteStream) {
return;
}
// If the track is audio and the player is muted, we do not add it to the stream.
if (event.track.kind === "audio" && this.muted) {
return;
}
this._remoteStream.addTrack(event.track);
if (!this.hasUpdated) {
await this.updateComplete;