WebRTC icon indicating copy to clipboard operation
WebRTC copied to clipboard

Regression with autoplay & muting from e1214d3

Open jctrouble opened this issue 4 months ago • 8 comments

Best I can tell, e1214d3 and its new "eat all errors" behavior has caused a regression in the latest versions of the card (for a card with muted: false in its config)

I have a stream that initially loads as an MSE stream and then upgrades (nearly instantly) to an RTC stream. When that happens, I get the following in my web console:

video-rtc.js?v=1.9.9:171 AbortError: The play() request was interrupted by a new load request. https://goo.gl/LdLk22
overrideMethod @ hook.js:608
(anonymous) @ video-rtc.js?v=1.9.9:171

Promise.catch
(anonymous) @ video-rtc.js?v=1.9.9:170

Promise.catch
play @ video-rtc.js?v=1.9.9:167
onmse @ video-rtc.js?v=1.9.9:430
onopen @ video-rtc.js?v=1.9.9:355
onopen @ webrtc-camera.js?v=v3.6.1:184
(anonymous) @ video-rtc.js?v=1.9.9:304

I believe the const isAutoplayError = er.name === 'NotAllowedError'; logic that was removed in e1214d3 might have been load-bearing.

This is for a baby monitor, so at night it absolutely needs to be unmuted automatically (and as specified by muted: false in the card config). This worked swimmingly until I updated the card to the latest version.

jctrouble avatar Aug 21 '25 03:08 jctrouble

I also have the muted: false issue. Before v3.6.1 the streams were loaded nicely on the TV screen as baby monitor with sound. Now the muted: false config doesn't have any effect, both of my streams loaded muted (tested on PC, Android app, RaspberryPi). :(

magyarl89 avatar Aug 22 '25 21:08 magyarl89

But the new logic saved the most terrible browser in the world (Safari) from errors.

I think it's impossible to say that the code is working in all cases. It needs to write separate code for each browser. And there are dozens of them, including TV, noname Android tablets and etc.

AlexxIT avatar Aug 23 '25 08:08 AlexxIT

I'm seeing the same thing... muted: false is not doing anything in the config since updating.

Jack-D91 avatar Aug 28 '25 19:08 Jack-D91

If the video starts without sound when you want it with sound, this is a known behavior. This is the struggle of browsers with advertising on the Internet. There's nothing you can do about it. Each browser has its own logic, whether a video on a particular page can start with sound or not.

If the video starts with sound when you want it to start without sound, this is a bug. It needs to be fixed.

AlexxIT avatar Aug 29 '25 08:08 AlexxIT

Lol I liked it better with the bug. I went back to the old version so my baby monitor camera starts unmuted.

Jack-D91 avatar Aug 29 '25 14:08 Jack-D91

I hope there is a way to make this work for both Chrome and Safari.

Advanced Camera Card's auto-unmute feature works for me, including when casting to a TV, but I don't have Safari to test.

felipecrs avatar Aug 29 '25 15:08 felipecrs

@felipecrs do you have problems with mute in WebRTC Camera? You need to compare cards on equal terms on the same page. Opened in the same way.

Suppose the browser can consider the page to be trusted, and allow audio in the video.

Or the video card is opened by a user's click (for example, when switching to the next section of HA). This is also considered a conscious action, where there may be sound in the video.

But if you open YouTube for the first time in a browser on a mobile device, even it will be silent.

AlexxIT avatar Sep 02 '25 11:09 AlexxIT

In my case, muted: false works with mode: webrtc but does not work with mode: mse.

https://github.com/user-attachments/assets/5bb17fcd-10a0-43d3-bb8b-a9fd1c2de329

felipecrs avatar Sep 02 '25 11:09 felipecrs