Guide/example on custom web page for webRTC source/publish_index.html, publisher.js #4983
Replies: 4 comments 4 replies
-
digging into source of [publish_index.html](internal/servers/webrtc |
Beta Was this translation helpful? Give feedback.
-
I've dug into this a bit more and I'm seeing that encryption is fundamental to the WebRTC specification so I assume that is now going on between MTX server and my web browser client. I have also now tried setting the webrtcAdditionalHosts field to raspberrypi, raspberrypi.local and don't think this has any affect. What is odd to me is all I'm trying to do is to iframe a working webRTC stream so that I can customize the HTML view by adding a few control buttons (record on/off path request to mtx API) and stream on/off. I've done this with HLS but the lag/latency is too much. So, encrypting something that is already available within my LAN so that I can iframe it/brand it seems illogical. Am I missing something? |
Beta Was this translation helpful? Give feedback.
-
@aler9 - should I open an issue? I've tried to follow this thread which has both guides around using publish_index.html (I get 'can't access webcam or mics, make sure webrtc encryption enabled) nor the whep reader approach (endpoint not there). I'm just trying to add a simple record on/off button to an iframe on my local lan so odd that I'd have to install certificates and not sure how to do that without a domain. Is there a basic example of how to serve my own webpage? i'm using fastapi/uvicorn to serve but can't seem to find the combination to serve my working webrtc stream. |
Beta Was this translation helpful? Give feedback.
-
I got a basic working example going using iframes. I was stuck on encryption. To fix, I installed mkcert and setup a local certificate authority . Once I enabled encryption on the webrtc stream and setup paths to the certs, stream started flowing. Not sure what happens when I try to read it into OBX or other more particular consumer downstream given that I'm in a local LAN situation and don't have a FQDN in this situation. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Question
Is there a guide on how to get the custom host pages for a webRTC source working?
I'm trying to host my own customized framing of a mediamtx webRTC source using iframes or video controls. I'm doing so on the same host (raspberrypi) but my webserver is port 8080. I've got a successful webRTC stream at http://raspberrypi:8889/cam/. I'm hosting mediamtx guide files as indicated here including publish_index.htm and publisher.js.
Am not sure how to pass the correct information to the script for the MediaMTXWebRTCReader to know the source. on the iframe window, I see a message, "can't access microphones and webcams. Make sure webRTC encryption is enabled." I was hoping to do this without encryption so it appears the reader defaults to an expectation of encryption.
any code examples or guides would be appreciated.
I also noted the mediamtx.yml setting:
webrtcAdditionalHosts: []
I haven't tried adding my IP or LAN to this.
Beta Was this translation helpful? Give feedback.
All reactions