webSDK里,rtc.client.leave函数里的rtc.localStream.stop();报错

rtc.client.leave(function () {
// Stop playing the local stream
rtc.localStream.stop(); <=======就是这句在js里报错,内容:Uncaught (in promise) TypeError: Cannot read property ‘stop’ of null
// Close the local stream
rtc.localStream.close();
// Stop playing the remote streams and remove the views
while (rtc.remoteStreams.length > 0) {
var stream = rtc.remoteStreams.shift();
var id = stream.getId();
stream.stop();
removeView(id);
}
console.log(“client leaves channel success”);
}, function (err) {
console.log(“channel leave failed”);
console.error(err);
})

这个是什么问题?

Hi,
你用的是什么版本的web sdk呢?尝试升级一下sdk试试

网上给你案例是3.0.0,我换成3.3.0还是报错,换成4.0.0后报错的就更多了,我又下载了官方的demo测试,同样的只能收到声音,看不到图像,我在想会不会是推流端没有推视频,直推了音频,有没有这种情况?但是我推流端也能预览到视频啊。

你跑的哪个demo呢,可以链接给我看下

https://blog.csdn.net/weixin_44763794/article/details/111269371

建议跑通官网的demo试下https://github.com/AgoraIO-Community/AgoraWebSDK-NG/tree/master/Demo