docs: remove redundant instructions (#5688)

This commit is contained in:
Alessandro Ros
2026-04-24 19:01:54 +02:00
committed by GitHub
parent 4c10d7e7c8
commit 91aa6d9c6d
+6 -18
View File
@@ -1,17 +1,19 @@
# Web browsers
Web browsers can read a stream from the server by using the WebRTC or the HLS protocol.
Web browsers can read a stream from the server with the WebRTC or the HLS protocol, by directly accessing web pages provided by the server. It is also possible to embed streams into an external website.
## Direct read
### WebRTC
You can read a stream by using the [WebRTC protocol](02-webrtc.md) by visiting the web page:
Web browsers can read a stream with the [WebRTC protocol](02-webrtc.md) by visiting the web page:
```
http://localhost:8889/mystream
```
Replace `mystream` with the path name.
### HLS
Web browsers can also read a stream with the [HLS protocol](05-hls.md). Latency is higher but there are fewer problems related to connectivity between server and clients. Visit the web page:
@@ -20,6 +22,8 @@ Web browsers can also read a stream with the [HLS protocol](05-hls.md). Latency
http://localhost:8888/mystream
```
Replace `mystream` with the path name.
## Embed in a website
Live streams can be embedded into an external website by using the WebRTC or HLS protocol. Before embedding, check that the stream is ready and can be accessed with intended protocol by visiting web pages mentioned in the previous section.
@@ -104,14 +108,6 @@ After the video tag, add a script that initializes the stream when the page is f
</script>
```
If _MediaMTX_ is hosted on a different domain with respect to the website (in the sample code this is implied), you need to set the `webrtcAllowOrigins` parameter in the configuration file. For example, to allow requests from `https://example.com`:
```yaml
webrtcAllowOrigins: ["https://example.com"]
```
The parameter also supports wildcards, for instance `['http://*.example.com']`.
### HLS in iframe
Reading a stream with the HLS protocol introduces some latency, but is usually easier to setup since it doesn't involve managing additional ports that in WebRTC are used to transmit the stream.
@@ -190,11 +186,3 @@ After the video tag, add a script that initializes the stream when the page is f
});
</script>
```
If _MediaMTX_ is hosted on a different domain with respect to the website (in the sample code this is implied), you need to set the `hlsAllowOrigins` parameter in the configuration file. For example:
```yaml
hlsAllowOrigins: ["https://example.com"]
```
The parameter also supports wildcards, for instance `['http://*.example.com']`.