From f1c919b429a3e0802eff6c812e76f1822b2264d2 Mon Sep 17 00:00:00 2001 From: Alessandro Ros Date: Fri, 24 Apr 2026 17:37:20 +0200 Subject: [PATCH] docs: merge 'embed streams' and 'web browsers' pages (#5684) --- docs/1-kickoff/1-introduction.md | 8 +- docs/2-features/05-configuration.md | 2 +- docs/2-features/06-authentication.md | 4 +- .../17-embed-streams-in-a-website.md | 178 ----------------- ...8-start-on-boot.md => 17-start-on-boot.md} | 0 .../{19-logging.md => 18-logging.md} | 2 +- docs/2-features/{20-hooks.md => 19-hooks.md} | 0 .../{21-control-api.md => 20-control-api.md} | 0 .../{22-metrics.md => 21-metrics.md} | 0 .../{23-performance.md => 22-performance.md} | 0 ...eatures.md => 23-srt-specific-features.md} | 0 ...ures.md => 24-webrtc-specific-features.md} | 0 ...atures.md => 25-rtsp-specific-features.md} | 0 ...atures.md => 26-rtmp-specific-features.md} | 0 ...ket-loss.md => 27-decrease-packet-loss.md} | 0 docs/3-publish/01-srt-clients.md | 2 +- docs/3-publish/03-webrtc-clients.md | 4 +- docs/3-publish/05-rtsp-clients.md | 2 +- docs/3-publish/06-rtsp-cameras-and-servers.md | 2 +- docs/3-publish/07-rtmp-clients.md | 2 +- docs/3-publish/15-gstreamer.md | 4 +- docs/4-read/01-srt.md | 2 +- docs/4-read/02-webrtc.md | 4 +- docs/4-read/03-rtsp.md | 2 +- docs/4-read/04-rtmp.md | 2 +- docs/4-read/07-gstreamer.md | 2 +- docs/4-read/13-web-browsers.md | 185 +++++++++++++++++- docs/5-references/2-control-api.md | 2 +- docs/redirects.yaml | 2 + internal/core/core.go | 2 +- internal/core/path.go | 2 +- internal/core/path_manager.go | 4 +- internal/servers/hls/server.go | 4 +- internal/servers/rtmp/server.go | 6 +- internal/servers/rtsp/server.go | 10 +- internal/servers/srt/server.go | 6 +- internal/servers/webrtc/server.go | 6 +- 37 files changed, 225 insertions(+), 226 deletions(-) delete mode 100644 docs/2-features/17-embed-streams-in-a-website.md rename docs/2-features/{18-start-on-boot.md => 17-start-on-boot.md} (100%) rename docs/2-features/{19-logging.md => 18-logging.md} (97%) rename docs/2-features/{20-hooks.md => 19-hooks.md} (100%) rename docs/2-features/{21-control-api.md => 20-control-api.md} (100%) rename docs/2-features/{22-metrics.md => 21-metrics.md} (100%) rename docs/2-features/{23-performance.md => 22-performance.md} (100%) rename docs/2-features/{24-srt-specific-features.md => 23-srt-specific-features.md} (100%) rename docs/2-features/{25-webrtc-specific-features.md => 24-webrtc-specific-features.md} (100%) rename docs/2-features/{26-rtsp-specific-features.md => 25-rtsp-specific-features.md} (100%) rename docs/2-features/{27-rtmp-specific-features.md => 26-rtmp-specific-features.md} (100%) rename docs/2-features/{28-decrease-packet-loss.md => 27-decrease-packet-loss.md} (100%) diff --git a/docs/1-kickoff/1-introduction.md b/docs/1-kickoff/1-introduction.md index 9ff78fb7..a1b5975b 100644 --- a/docs/1-kickoff/1-introduction.md +++ b/docs/1-kickoff/1-introduction.md @@ -17,10 +17,10 @@ Main features: - [Authenticate](../2-features/06-authentication.md) users with internal, HTTP or JWT authentication - [Forward](../2-features/11-forward.md) streams to other servers - [Proxy](../2-features/12-proxy.md) requests to other servers -- [Control](../2-features/21-control-api.md) the server through the Control API -- [Extract metrics](../2-features/22-metrics.md) from the server in a Prometheus-compatible format -- [Monitor performance](../2-features/23-performance.md) to investigate CPU and RAM consumption -- [Run hooks](../2-features/20-hooks.md) (external commands) when clients connect, disconnect, read or publish streams +- [Control](../2-features/20-control-api.md) the server through the Control API +- [Extract metrics](../2-features/21-metrics.md) from the server in a Prometheus-compatible format +- [Monitor performance](../2-features/22-performance.md) to investigate CPU and RAM consumption +- [Run hooks](../2-features/19-hooks.md) (external commands) when clients connect, disconnect, read or publish streams - Compatible with Linux, Windows and macOS, does not require any dependency or interpreter, it's a single executable Use the menu to navigate through the documentation. diff --git a/docs/2-features/05-configuration.md b/docs/2-features/05-configuration.md index aa84ef19..7a1d22b6 100644 --- a/docs/2-features/05-configuration.md +++ b/docs/2-features/05-configuration.md @@ -47,7 +47,7 @@ There are several ways to change configuration parameters: docker run --rm -it --network=host -e MTX_PATHS_TEST_SOURCE=rtsp://myurl bluenviron/mediamtx:1 ``` -3. Use the [Control API](21-control-api.md). +3. Use the [Control API](20-control-api.md). ## Encrypt the configuration diff --git a/docs/2-features/06-authentication.md b/docs/2-features/06-authentication.md index b4baf721..59a7c057 100644 --- a/docs/2-features/06-authentication.md +++ b/docs/2-features/06-authentication.md @@ -298,7 +298,7 @@ Username and password can be passed through the `Authorization: Basic` HTTP head Authorization: Basic base64(myuser:mypass) ``` -When using a web browser, a dialog is first shown to users, asking for credentials, and then the header is automatically inserted into every request. If you need to automatically fill credentials from a parent web page, read [Embed streams in a website](17-embed-streams-in-a-website.md). +When using a web browser, a dialog is first shown to users, asking for credentials, and then the header is automatically inserted into every request. If you need to automatically fill credentials from a parent web page, read [Embed streams in a website](../4-read/13-web-browsers.md#embed-streams-in-a-website). If the `Authorization: Basic` header cannot be used (for instance, in software like OBS Studio, which only allows to provide a "Bearer Token"), credentials can be passed through the `Authorization: Bearer` header (i.e. the "Bearer Token" in OBS), where the value is the concatenation of username and password, separated by a colon: @@ -350,4 +350,4 @@ In OBS Studio, this is the "Bearer Token" field. If the `Authorization: Bearer` token cannot be directly provided (for instance, with web browsers that directly access _MediaMTX_ and show a credential dialog), you can pass the token as password, using an arbitrary user. -In web browsers, if you need to automatically fill credentials from a parent web page, read [Embed streams in a website](17-embed-streams-in-a-website.md). +In web browsers, if you need to automatically fill credentials from a parent web page, read [Embed streams in a website](../4-read/13-web-browsers.md#embed-streams-in-a-website). diff --git a/docs/2-features/17-embed-streams-in-a-website.md b/docs/2-features/17-embed-streams-in-a-website.md deleted file mode 100644 index 88b18b83..00000000 --- a/docs/2-features/17-embed-streams-in-a-website.md +++ /dev/null @@ -1,178 +0,0 @@ -# Embed streams 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 using URLs mentioned in [Read a stream](../2-features/04-read.md). - -## WebRTC in iframe - -The simplest way to embed a live stream in a web page, using the WebRTC protocol, consists in adding an ` -``` - -The iframe can be controlled by adding query parameters to the URL (example: `http://mediamtx-ip:8889/mystream?muted=false`). The following parameters are available: - -- `controls` (boolean): whether to show controls. Default is true. -- `muted` (boolean): whether to start the stream muted. Default is true. -- `autoplay` (boolean): whether to autoplay the stream. Default is true. -- `playsInline` (boolean): whether to play the stream without using the entire window of mobile devices. Default is true. -- `disablepictureinpicture` (boolean): whether to disable the ability to open the stream in a dedicated window. Default is false. - -The iframe method is fit for most use cases, but it has some limitations: - -- it doesn't allow to pass credentials (username, password or token) from the website to _MediaMTX_; credentials are asked directly to users. -- it doesn't allow to directly access the video tag, to extract data from it, or to perform dynamic actions. - -## WebRTC with JavaScript - -In order to overcome the limitations of the iframe-based method, it is possible to load the stream directly inside a `