Comments (7)
因为网络原因signal断了SDK会尝试重连,不需要刷新页面。
收到 disconnect code 10004 (重连超时)之后可以重新走 joinRoomWithToken
参考文档:
https://doc.qnsdk.com/rtn/web/docs/api_track_mode_session#22_6
from qnrtc-web.
那如果连接断开前我监听了各种事件,在sdk重连过程中,其他用户发布流取消发布流的这些事件,会不会在重连成功后监听到呢?同理,在重连超时后再次joinRoomWithToken又会如何呢?
from qnrtc-web.
sdk重连后房间的变化重连成功后能监听到。
disconnect触发之后(包括重连超时)会释放房间的所有信息,之后再 joinRoom 和上一次 joinRoom 没啥联系
from qnrtc-web.
简单来说,websocket 断开有 2 种状态:
- 断开后 SDK 会自动尝试重连,此时处于重连状态,可以通过 room-state-change 这个事件感知
- 之后如果 SDK 重连失败(超时或者其他原因),会抛出 disconnect ,此时房间已经处于不可恢复的断开状态了,SDK 会清空释放整个房间(但是你的事件监听不会被释放)
所以如果你在超时后再次重新 joinRoom 是没有问题的,事实上 Demo 也是这么做的
from qnrtc-web.
简单来说,websocket 断开有 2 种状态:
- 断开后 SDK 会自动尝试重连,此时处于重连状态,可以通过 room-state-change 这个事件感知
- 之后如果 SDK 重连失败(超时或者其他原因),会抛出 disconnect ,此时房间已经处于不可恢复的断开状态了,SDK 会清空释放整个房间(但是你的事件监听不会被释放)
所以如果你在超时后再次重新 joinRoom 是没有问题的,事实上 Demo 也是这么做的
第二种情况,监听事件一直不会被释放吗?还是监听到disconnect事件后执行完回调函数后再释放监听事件?
from qnrtc-web.
房间对象的监听事件除非用户手动调用 off/removeAllListeners 之类的方法释放,否则 SDK 是不会释放的。
from qnrtc-web.
okk, 谢谢两位大佬。
from qnrtc-web.
Related Issues (20)
- 切换摄像头 HOT 1
- 停止共享 HOT 1
- 是否支持ie 浏览器 HOT 1
- Uncaught (in promise) TypeError: r.webkitGetUserMedia is not a function HOT 1
- 小程序集成七牛云实时音视频的问题 HOT 1
- Error: piliRTC: unexpected error no signaling model, please run joinRoomWithToken first HOT 1
- 实现快速开始demo,远端无法看到本地的画面 HOT 1
- web 只采集音频,小程序方接收不到声音
- track模式web客户端互相推音频流,收不到声音
- TrackModeSession.handlePlayerOut 报错。
- session.addMergeStreamTracks
- ffmpeg 循环推流本地rtmp正常,推流七牛rtmp服务失败
- pc网页接口sdk的Stream模式,语音回音超级大 HOT 1
- Firefox参加会议失败,Chrome成功
- 移动端unified-plan报错
- UC浏览器手机版本 20201214,RTCPeerConnection类不存在,导致加入房间卡住 HOT 1
- npm start报错 HOT 3
- 屏幕共享 HOT 1
- webSDK 2.4.1 track.getStats()方法手动调用返回空数组
- 支持移动端展示
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from qnrtc-web.