This example demonstrates playback of a stream with audio only.
Please refer to the Basic Subscriber Documentation to learn more about the basic setup.
The audio
element is used for the assignment of the media stream blob:
<audio id="red5pro-subscriber" controls autoplay class="red5pro-media"></audio>
Initialization and playback of a Red5 Pro stream in an audio
element is similar to one in a video
element:
var subscriber = new WHEPClient()
subscriber
.init(config)
.then(function () {
return subscriber.subscribe()
})
.then(function () {
console.log('Successfully started a subscription session!')
})
.catch(function (error) {
console.error('Could not start a subscription session: ' + error)
})