Reputation: 23
After joined channel, remote user may have connection issue. Which method can the local user detect the remote user has been disconnect and waiting for rejoin channel?
Upvotes: 1
Views: 1246
Reputation: 54427
If your question is about flutter client, from example of AgoraIO, you can do this in event handler. see code snippet and full code below
If I do not understand your question clear, please post your code.
full code https://github.com/AgoraIO-Community/Agora-Flutter-Quickstart/blob/master/lib/src/pages/call.dart
code snippet
/// Add agora event handlers
void _addAgoraEventHandlers() {
AgoraRtcEngine.onError = (int code) {
setState(() {
String info = 'onError: ' + code.toString();
_infoStrings.add(info);
});
};
AgoraRtcEngine.onJoinChannelSuccess =
(String channel, int uid, int elapsed) {
setState(() {
String info = 'onJoinChannel: ' + channel + ', uid: ' + uid.toString();
_infoStrings.add(info);
});
};
AgoraRtcEngine.onLeaveChannel = () {
setState(() {
_infoStrings.add('onLeaveChannel');
});
};
AgoraRtcEngine.onUserJoined = (int uid, int elapsed) {
setState(() {
String info = 'userJoined: ' + uid.toString();
_infoStrings.add(info);
_addRenderView(uid, (viewId) {
AgoraRtcEngine.setupRemoteVideo(viewId, VideoRenderMode.Hidden, uid);
});
});
};
AgoraRtcEngine.onUserOffline = (int uid, int reason) {
setState(() {
String info = 'userOffline: ' + uid.toString();
_infoStrings.add(info);
_removeRenderView(uid);
});
};
AgoraRtcEngine.onFirstRemoteVideoFrame =
(int uid, int width, int height, int elapsed) {
setState(() {
String info = 'firstRemoteVideo: ' +
uid.toString() +
' ' +
width.toString() +
'x' +
height.toString();
_infoStrings.add(info);
});
};
}
Upvotes: 0