Back to Mediamtx

Web browsers

docs/3-publish/16-web-browsers.md

1.19.01.3 KB
Original Source

Web browsers

Web browsers can publish a stream to the server by acting as a Media-over-QUIC client or a WebRTC client.

Media-over-QUIC

Start the server and open the web page:

https://localhost:8892/mystream/publish

The resulting stream will be available on path /mystream.

This web page can be embedded into another web page by using an iframe:

html
<iframe src="https://mediamtx-ip:8892/mystream/publish" scrolling="no"></iframe>

WebRTC

Start the server and open the web page:

http://localhost:8889/mystream/publish

The resulting stream will be available on path /mystream.

This web page can be embedded into another web page by using an iframe:

html
<iframe src="http://mediamtx-ip:8889/mystream/publish" scrolling="no"></iframe>

For more advanced setups, you can create and serve a custom web page by starting from the source code of the WebRTC publish page. In particular, there's a ready-to-use, standalone JavaScript class for publishing streams with WebRTC, available in publisher.js.