Agora Error : stream is closed and cannot be initialized

355 views Asked by At

We have inegrated Agora for video call in our platform , but some users are getting this error "stream is closed and cannot be initialized". Under what circumstances this error may come

1

There are 1 answers

0
Akshat Gupta On

I think you haven't added the stream properly and may also be trying to close it at the same time.

Check if you have added the stream-added callback after initialising the client and joining the channel.

// Connect New People
client.on('stream-added', function (evt) {
  var stream = evt.stream;
  client.subscribe(stream, function (err) {
  });
});

Also check the documentation to ensure all steps are followed for the video call.

If it still doesn't work, check out this file in my sample app implementing the same.