Consuming Services As a Subscriber
If you are coming from the previous section then you have a working Red5 Pro cluster in place with at least one stream publishing to it.
Now that the stream is publishing and available subscriber clients may be interested to subscribe to it. However, they don't know the host address of the edge that they should subscribe to.
Once again Stream Manager comes to the rescue by providing stream information to the subscriber client via REST API call. The subscriber client will need to make a READ STREAM REST call to the stream Manager using a scope name, stream name and the action parameter (subscribe).
Scope nameis the Red5 application/context name that a client connects to. The default scope name to be used is live
Stream nameis the name of the publishing stream
Actionis a query string parameter that defines the client's request type:
Use stream manager's READ STREAM REST API to request for an edge server.
The combination of scope name and stream name should be unique for each streaming event.
Having received a successful response from Stream Manager with stream subscribe information we can now consume the stream using a subscriber client.
The stream subscribe information received from the REST response can be used by different types of subscribing client(s) as shown below.
WebRTC requires using the Stream Manager proxy feature to bypass the secure origin requirement, to be able to publish.
To learn more about proxy and configuring WebRTC client to work with proxy please see the Stream Manager Proxy Guide.
- WebRTC Stream Manager Proxy Subscribe Example
- Android Stream Manager Subscribe Example
- iOS Stream Manager Subscribe Example
- You cannot make a subscribe request for a stream if it is not publishing
- If a stream stops publishing the subscribers must re-query the Stream Manager for stream details