getEmbedSetting method
void
getEmbedSetting(
{ - required String embedUrl,
})
Implementation
void getEmbedSetting({required String embedUrl}) async {
Requests request = Requests(url: embedUrl + '/config/index.json');
await request.get().then((value) {
//print(value.body);
final parseJson = jsonDecode(value.body);
optionsData = parseJson['hosted_apps']['vc']['options'];
if (kDebugMode) {
print("visualBuilder$optionsData");
}
// final userdata = Map<String, dynamic>.from(parseJson['hosted_apps']['vc']['options']);
if (optionsData.isNotEmpty) {
isAudio = optionsData['audio_mute'];
if (isAudio) {
bottomList.add(BottomOption.audio);
}
isVideo = optionsData['video_mute'];
if (isVideo) {
bottomList.add(BottomOption.video);
}
if (isCameraSwitch) {
bottomList.add(BottomOption.cameraSwitch);
}
if (isAudioSwitch) {
bottomList.add(BottomOption.audioSwitch);
}
isChat = optionsData['group_chat'];
if (isChat) {
bottomList.add(BottomOption.groupChat);
}
if (isDisconnect) {
bottomList.add(BottomOption.disconnect);
}
if (optionsData['mute_all'] == true) {
menuList.add(MenuOption.muteRoom);
}
if (optionsData['recording'] == true) {
menuList.add(MenuOption.recording);
}
if (optionsData['grid_mode_switch'] == true) {
menuList.add(MenuOption.switchAT);
}
}
// onReceivedSetting(jsonDecode(value.body));
}).catchError((onError) {});
}