Closed saibotma closed 3 months ago
This SDK is implemented with the entire activity. There is content in the view even when the conference hasn't been joined, for example when the pre-join screen is displayed.
Additionally, and barring bugs, readyToClose
means the acitvity will disappear and resources will be closed in the background.
Yeah, that exactly is my point. Sometimes the SDK is just used to launch a meeting and the launching code needs to know when the launch succeeded, failed and finished to give appropriate feedback to the user, regardless of whether a conference got joined or not.
The solution that comes close to what this issue is about is the following:
join() async {
isJitsiRunning = true;
try {
await JitsiMeet().join(
JitsiMeetConferenceOptions(),
JitsiMeetEventListener(
readyToClose: () {
isJitsiRunning = false;
},
),
);
} on Exception catch (e) {
isJitsiRunning = false;
}
}
However, it still has the following flaws:
I understand where you are coming from, but our API doesn't work that way.
First, let's get the readyToClose
issue away. I have fixed it in master and we'll make a new SDK release this week, so consider that solved.
Now, many things can happen in a meeting, including errors, but those are often recoverable. If connectivity fails we'll reconnect and there is nothing you need to do.
From user of the API prespective, launch will always succeed, because joining the meeting takes time. Once everything is said and done readyToClose
will be called and that's when the meeting is done for.
There are intermediate events, but they are not very useful in general, because you can see things like conference joined multiple times in case the user goes in and out of breakout rooms for example.
This SDK is designed to be high level, if you need lower level control of the meeting state you'll need to work on it yourself, that is not something we are currently planning to do.
Hope that helps!
It would be great to get notified about when the Jitsi view gets created and destroyed to be able to for example only activate a button, when there is no Jitsi view currently running.
This is required, because
conferenceJoined
is only called, when joining a conference andreadyToClose
is called before the view got completely destroyed (see https://github.com/jitsi/jitsi-meet-flutter-sdk/issues/77).jitsi_met_wrapper has this implemented. The implementation can be used as a blueprint.