joinMeeting method
Future<MeetHourMeetingResponse>
joinMeeting(
- MeetHourMeetingOptions options, {
- MeetHourMeetingListener? listener,
override
Joins a meeting based on the MeetHourMeetingOptions passed in. A MeetHourMeetingListener can be attached to this meeting that will automatically be removed when the meeting has ended
Implementation
@override
Future<MeetHourMeetingResponse> joinMeeting(
MeetHourMeetingOptions options, {
MeetHourMeetingListener? listener,
}) async {
// Attach a listener if it exists. The key is based on the serverURL + room
if (listener != null) {
String serverURL = options.serverURL ?? "https://meethour.io";
String key;
if (serverURL.endsWith("/")) {
key = serverURL + options.room;
} else {
key = serverURL + "/" + options.room;
}
_perMeetingListeners.update(key, (oldListener) => listener,
ifAbsent: () => listener);
initialize();
}
Map<String, dynamic> _options = {
'room': options.room.trim(),
'serverURL': options.serverURL?.trim(),
'subject': options.subject,
'token': options.token,
'pcode': options.pcode,
'audioMuted': options.audioMuted,
'audioOnly': options.audioOnly,
'videoMuted': options.videoMuted,
'prejoinPageEnabled': options.prejoinPageEnabled,
'disableInviteFunctions': options.disableInviteFunctions,
'featureFlags': options.getFeatureFlags(),
'userDisplayName': options.userDisplayName,
'userEmail': options.userEmail,
'iosAppBarRGBAColor': options.iosAppBarRGBAColor,
};
return await _channel
.invokeMethod<String>('joinMeeting', _options)
.then((message) =>
MeetHourMeetingResponse(isSuccess: true, message: message))
.catchError(
(error) {
return MeetHourMeetingResponse(
isSuccess: true, message: error.toString(), error: error);
},
);
}