fcr-core
Version:
Core APIs for building online scenes
33 lines • 2.02 kB
JavaScript
import "core-js/modules/es.array.push.js";
import { FcrApplicationPlatform, getPlatform } from '../imports';
export const isTrueValue = value => {
return value === 'true' || !!value;
};
export const getCoreIpList = parameters => {
return parameters?.core?.coreIpList;
};
export const getEasemobChatIpList = parameters => {
return parameters?.core?.easemobChatIpList;
};
export const getEasemobRestIpList = parameters => {
return parameters?.core?.easemobRestIpList;
};
export const isEndpointRegionDisabled = parameters => {
return isTrueValue(parameters?.core?.disableEndpointRegion);
};
export const getRtcPresetParameters = () => {
let parameters = [];
if (getPlatform() == FcrApplicationPlatform.WINDOWS) {
parameters.push('{\"engine.video.hw_decoder_provider\":\"qsv\"}', '{\"rtc.video.default_hw_decoder_thres\":921600}');
}
if (getPlatform() == FcrApplicationPlatform.MACOS) {
parameters.push('{\"che.video.screenCaptureMode\":1}');
}
if (getPlatform() == FcrApplicationPlatform.WINDOWS || getPlatform() == FcrApplicationPlatform.MACOS) {
parameters.push('{\"che.video.videoCodecIndex\": 1}', '{\"rtc.video.new_complexity\": true}', '{\"rtc.video.default_complexity\": 1027}', '{\"rtc.video.enable_doc_screen_share_sr\":true}', '{\"rtc.video.enable_pvc\":false}', '{\"che.video.brightness_detection_enable\":false} ', '{\"che.audio.bitrate_level\":1}', '{\"rtc.video.downMaxRetryTimes\":5}', '{\"che.video.vqc_min_width\": 1280}', '{\"che.video.vqc_min_height\": 720}', '{\"che.video.lowest_dev_score_4_seg\":0}', '{\"che.video.lowest_dev_score_4_beauty\":0}', '{\"rtc.video.color_space_enable\":true}', '{\"rtc.video.videoFullrange\":1}', '{\"rtc.video.matrixCoefficients\":5}', '{\"che.video.screen_disable_frame_transparent_check\":true}', '{\"che.audio.reset_apm_capture_state_for_microphone_track\":false}');
}
if (getPlatform() == FcrApplicationPlatform.WEB_DESKTOP) {
parameters.push('{\"RESTRICTION_SET_PLAYBACK_DEVICE\":false}');
}
return parameters;
};