AlexxIT / WebRTC

Home Assistant custom component for real-time viewing of almost any camera stream using WebRTC and other technologies.
https://github.com/AlexxIT/Blog
MIT License
1.44k stars 171 forks source link

Dashcast audio disabled #129

Closed jemershaw closed 1 year ago

jemershaw commented 3 years ago

Is it possible to stream with dashcast with audio enabled? It seems like whatever is streamed it is disabled. I tried adding muted: false when running dashcast but that didn't help.

Shermer321 commented 2 years ago

I have a dahua camera that is also always muted and the button is grayed out. Am I missing something?

AlexxIT commented 1 year ago

I don't think that's possible. Because: https://developer.chrome.com/blog/autoplay/

felipecrs commented 1 year ago

There should be a way around it... the go2rtc player comes unmuted by default. No?

felipecrs commented 1 year ago

Anyway, the best possible thing would be to stream directly to the cast receiver by using WebRTC.

All Google Cast devices are able to play WebRTC media, I just don't know how this could be implemented.

felipecrs commented 1 year ago

https://github.com/castjs/castjs

Maybe this could help.

AlexxIT commented 1 year ago

go2rtc will try to play with sound. But browser can block it. If user not interact with it earlier. And no one interact with Chromecast.

felipecrs commented 1 year ago

I see. That's very odd!

BTW I just had a crazy idea here. What if instead of relying on Chromecast's built-in browser, we could spin-up a browser in the server-side with Puppeteer, and use Chrome's APIs to cast a page (like the go2rtc web player). This is probably doable.

https://github.com/SamuelScheit/puppeteer-stream

The question is whether this is worth it or not, versus trying to make the stream happen directly in Chromecast without rendering it through a browser.