return connection error message, removed mediastream during publishing

This commit is contained in:
David Zhao
2021-08-05 23:20:20 -07:00
parent 101849d0bb
commit 908c830b86
6 changed files with 79 additions and 30 deletions
+6 -2
View File
@@ -64,14 +64,18 @@ class RTCEngine with SignalClientDelegate {
this.client.delegate = this;
}
Future<JoinResponse> join(String url, String token, JoinOptions? opts) {
Future<JoinResponse> join(String url, String token, JoinOptions? opts) async {
this.url = url;
this.token = token;
var completer = new Completer<JoinResponse>();
joinCompleter = completer;
client.join(url, token, opts);
try {
await client.join(url, token, opts);
} catch (e) {
return Future.error(e);
}
// if it's not complete after 5 seconds, fail
new Timer(connectionTimeout, () {