Код: Выделить всё
class JitsiSdk {
static DateTime? _startDate;
static void hangUp() async {
JitsiMeet().hangUp();
}
static Future join(String callId,
{Function(String? str)? onParticipantLeft,
Function(int duration)? onClosed,
bool? isBackground = false,
bool showInviteButton = false}) async {
if (isBackground == true) {
await EncryptedSharedPreferences.initialize(Env.prefKey);
}
final displayName = "Test";
final avatarId = "avatar";
JitsiMeet().join(
JitsiMeetConferenceOptions(
token: SharedPreferences.getInstance().getString(Keys.token),
featureFlags: {
"invite.enabled": showInviteButton,
"add-people.enabled": showInviteButton,
"security-options.enabled": false,
"prejoinpage.enabled": true,
"calendar.enabled": false,
'prejoinpage.hideDisplayName': true,
"toolbox.enabled": true,
"settings.enabled": false,
"speakerstats.enabled": false,
"lobby-mode.enabled": false,
"server-url-change.enabled": false,
"sourceNameSignaling": true,
"notifications.enabled": false,
"sendMultipleVideoStreams": true,
"receiveMultipleVideoStreams": true,
"pip.enabled": false,
"help.enabled": false,
"recording.enabled": false,
},
configOverrides: {
// "startWithAudioMuted": false,
"help.enabled": false,
// "startWithVideoMuted": false,
"settings.enabled": false,
"pip.enabled": false,
"subject": Strings.call,
// "notifications.enabled": false,
"sendMultipleVideoStreams": true,
"receiveMultipleVideoStreams": true,
},
room: callId,
serverURL: networkRelease.replaceAll(":9001", ":8443"),
userInfo: JitsiMeetUserInfo(
email: "", displayName: displayName, avatar: NetworkUtils.fileUrl(avatarId)),
),
JitsiMeetEventListener(
conferenceTerminated: (str, obj) {
final duration = DateTime.now().difference(_startDate!);
onClosed?.call(duration.inSeconds);
},
conferenceJoined: (str) {
_startDate = DateTime.now();
},
participantLeft: (str) {
onParticipantLeft?.call(str);
},
readyToClose: () {
if (_startDate != null) {
final duration = DateTime.now().difference(_startDate!);
onClosed?.call(duration.inSeconds);
} else {
onClosed?.call(0);
}
},
),
);
}
}
Манифест:
Код: Выделить всё
Подробнее здесь: https://stackoverflow.com/questions/787 ... roid-10-11