Skip to content

Commit

Permalink
chore: optimize
Browse files Browse the repository at this point in the history
  • Loading branch information
guoxianzhe committed Jan 26, 2024
1 parent a4ab06e commit 0cb7a33
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions packages/rtc/src/impl/IAgoraRtcEngineImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -992,13 +992,20 @@ export class IRtcEngineImpl implements IRtcEngineExtensions {
setParameters_3a2037f(parameters: string): CallApiReturnType {
let fun = async () => {
try {
let json = JSON.parse(parameters);
let keyList = Object.keys(json);
for (let i = 0; i < keyList.length; i++) {
if (typeof parameters === 'string') {
(this._engine.globalState.AgoraRTC as any).setParameter(
keyList[i],
json[keyList[i]]
undefined,
parameters
);
} else {
let json = JSON.parse(parameters);

Check warning on line 1001 in packages/rtc/src/impl/IAgoraRtcEngineImpl.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
let keyList = Object.keys(json);

Check warning on line 1002 in packages/rtc/src/impl/IAgoraRtcEngineImpl.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
for (let i = 0; i < keyList.length; i++) {

Check warning on line 1003 in packages/rtc/src/impl/IAgoraRtcEngineImpl.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
(this._engine.globalState.AgoraRTC as any).setParameter(
keyList[i],
json[keyList[i]]
);

Check warning on line 1007 in packages/rtc/src/impl/IAgoraRtcEngineImpl.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
}

Check warning on line 1008 in packages/rtc/src/impl/IAgoraRtcEngineImpl.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
}

Check warning on line 1009 in packages/rtc/src/impl/IAgoraRtcEngineImpl.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch
} catch (e) {
AgoraConsole.log(e);
Expand Down Expand Up @@ -1065,7 +1072,7 @@ export class IVideoDeviceManagerImpl implements NATIVE_RTC.IVideoDeviceManager {
};
return this._engine.execute(process);
}
getDevice_73b9872(deviceIdUTF8: string): CallApiReturnType {
getDevice_73b9872(): CallApiReturnType {
let process = async () => {
let list: MediaDeviceInfo[] = [];
let deviceId = '';
Expand Down

0 comments on commit 0cb7a33

Please sign in to comment.