首页 > 解决方案 > Agora 错误:流已关闭且无法初始化

问题描述

我们已经在我们的平台上集成了 Agora 进行视频通话,但是一些用户收到了这个错误“ stream is closed and cannot be initialized”。在什么情况下会出现这个错误

标签: agora.ioagora-web-sdk-ng

解决方案


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.


推荐阅读