0

Cannot able to Subscribe to live streaming video?

Hi all,
I am a newbie to this red5. I have tried to subscribe to the live streaming which is broadcasted from Android and iOS apps and I have used the following code to subscribe to the video but nothing is happening.

 

<body class="bluo-body">
<divid="video-container">
<videoid="red5pro-subscriber"height="240"width="360"autoplay></video>
</div>

<app-root></app-root>
</body>
 
<!-- Red5 Pro SDK -->
<script src="./assets/js/red5pro/red5pro-sdk.min.js"></script>
 
 
<script>
// Create a new instance of the WebRTC subcriber.
var subscriber = newred5prosdk.RTCSubscriber();

// Create a view instance based on video element id.
var viewer = newred5prosdk.PlaybackView('red5pro-subscriber');
// Attach the subscriber to the view.
viewer.attachSubscriber(subscriber);

// Using Chrome/Google TURN/STUN servers.
var iceServers = [{
urls:'stun:stun2.l.google.com:19302'
}];
 
// Initialize
subscriber.init({
protocol:'ws',
host:'', ---> I gave my host name
port:5080,
app:'live',
streamName:'3516',
iceServers:iceServers,
subscriptionId:'subscriber-' + Math.floor(Math.random() * 0x10000).toString(16),
rtcpMuxPolicy:'negotiate'
})
.then(function() {
// Invoke the playback action
returnsubscriber.play();
})
.catch(function(error) {
// A fault occurred while trying to initialize and subscribe to the stream.
console.error(error);
});
</script>
 
Can anyone please guide me in this?
Thanks in advance.

0 comments

Please sign in to leave a comment.