The purpose of this flutter app is to open a stream between 2 users, I used ion-sfu as a server and flutter-ion:^0.5.4 in the front-end, when I run the Web it was working perfectly but when I update the flutter-ion from ^0.5.4 to ^1.0.0 it give me the Error below. PS: I needed to update flutter-ion to ^1.0.0 because my app didn't run correctly on windows desktop when I used flutter-ion:^0.5.4, Any help ?
void pubSub() async {
// setState(() {
// plist.clear();
// });
log("serverurl " + ServerURL);
//if (_client == null) {
// create new client
_client =
await ion.Client.create(sid: "test room", uid: _uuid, signal: _signal);
// peer ontrack
_client?.ontrack = (track, ion.RemoteStream remoteStream) async {
if (track.kind == 'video') {
print('ontrack: remote stream: ${remoteStream.stream}');
var renderer = RTCVideoRenderer();
await renderer.initialize();
renderer.srcObject = remoteStream.stream;
setState(() {
plist.add(Participant('RemoteStream', renderer, remoteStream.stream));
});
}
};
_localStream = await ion.LocalStream.getUserMedia(constraints: stts);
//_localStream2 = await ion.LocalStream.getUserMedia(constraints: stts);
// publish the stream
await _client?.publish(_localStream!);
var renderer = RTCVideoRenderer();
await renderer.initialize();
renderer.srcObject = _localStream?.stream;
setState(() {
qlist.add(Participant("LocalStream", renderer, _localStream?.stream));
});
}
Error: Expected a value of type 'SessionDescription', but got one of type 'IdentityMap<String, String?>'
at Object.throw_ [as throw] (http://localhost:54173/dart_sdk.js:5083:11)
at Object.castError (http://localhost:54173/dart_sdk.js:5042:15)
at Object.cast [as as] (http://localhost:54173/dart_sdk.js:5367:17)
at Function.as_C [as as] (http://localhost:54173/dart_sdk.js:4988:19)
at http://localhost:54173/packages/flutter_ion/src/signal/signal_grpc_impl.dart.lib.js:178:56
at http://localhost:54173/packages/flutter_ion/src/signal/signal_grpc_impl.dart.lib.js:182:11
at signal_grpc_impl.GRPCWebSignal.new.join (http://localhost:54173/packages/flutter_ion/src/signal/signal_grpc_impl.dart.lib.js:184:9)
at client$.Client.new.<anonymous> (http://localhost:54173/packages/flutter_ion/src/stream.dart.lib.js:1035:49)
at Generator.next (<anonymous>)
at http://localhost:54173/dart_sdk.js:40108:33
at _RootZone.runUnary (http://localhost:54173/dart_sdk.js:39979:59)
at _FutureListener.thenAwait.handleValue (http://localhost:54173/dart_sdk.js:34926:29)
at handleValueCallback (http://localhost:54173/dart_sdk.js:35493:49)
at Function._propagateToListeners (http://localhost:54173/dart_sdk.js:35531:17)
at _Future.new.[_completeWithValue] (http://localhost:54173/dart_sdk.js:35379:23)
at async._AsyncCallbackEntry.new.callback (http://localhost:54173/dart_sdk.js:35400:35)
at Object._microtaskLoop (http://localhost:54173/dart_sdk.js:40246:13)
at _startMicrotaskLoop (http://localhost:54173/dart_sdk.js:40252:13)
at http://localhost:54173/dart_sdk.js:35751:9