/

ABR Subscribing with HLS


For HLS adaptive bitrate subscribing, connect your subscriber to the m3u8 stream GUID. Within the m3u8 manifest, the variants are defined and the HLS playback element has the ability to switch between variants based on network conditions.

As with the WebRTC subscribers for ABR, you will first request an edge node endpoint from the Stream Manager using one of the variant stream names.

In the case where the response to the GET request at:

https://yourstreammanager.com/streammanager/api/4.0/event/live/mystream_2?action=subscribe

is the following:

{
  "serverAddress": "10.0.0.0",
  "scope": "live",
  "name": "mystream_2"
}

Your initialization configuration for an HLSSubscriber will look like the following:

import { HLSSubscriber } from 'red5pro-webrtc-sdk'

const subscriber = async () => {
  var subscriber = new HLSSubscriber()
  await subscriber.init({
    host: '10.0.0.0',
    app: 'live',
    streamName: 'mystream',
    protocol: 'html',
    port: 5080
  })
  await subscriber.subscribe()
}

Internally, the Red5 Pro SDK would then request to subscribe to the HLS stream at:

http://10.0.0.0:5080/live/mystream.m3u8