Skip to content

Commit

Permalink
fix: publish track issue
Browse files Browse the repository at this point in the history
  • Loading branch information
guoxianzhe committed Nov 4, 2024
1 parent 9a2fc5b commit 7d1e3be
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 11 deletions.
2 changes: 1 addition & 1 deletion packages/fake/rtc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "iris-web-rtc-fake",
"version": "0.8.2",
"version": "0.8.3",
"description": "wait",
"main": "./index.ts",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/rtc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "iris-web-rtc",
"version": "0.8.2",
"version": "0.8.3",
"description": "wait",
"main": "./src/index.ts",
"scripts": {
Expand Down
14 changes: 8 additions & 6 deletions packages/rtc/src/IrisRtcApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@ function initIrisRtc(
);
// set the first irisApiEngine apiInterceptors to irisClientManager
// this is a convenient way to get irisClientManager in most cases
if (window.__AGORA_IRIS_API_ENGINE_LIST__.length === 1) {
window.__AGORA_IRIS_CLIENT_MANAGER__ =
window.__AGORA_IRIS_API_ENGINE_LIST__[0][
'apiInterceptors'
][0]?.irisClientManager;
}
setTimeout(() => {

Check warning on line 26 in packages/rtc/src/IrisRtcApi.ts

View workflow job for this annotation

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

🕹️ Function is not covered

Warning! Not covered function
if (window.__AGORA_IRIS_API_ENGINE_LIST__.length === 1) {
window.__AGORA_IRIS_CLIENT_MANAGER__ =
window.__AGORA_IRIS_API_ENGINE_LIST__[0][
'apiInterceptors'
][0]?.irisClientManager;

Check warning on line 31 in packages/rtc/src/IrisRtcApi.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 31 in packages/rtc/src/IrisRtcApi.ts

View workflow job for this annotation

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

🌿 Branch is not covered

Warning! Not covered branch

Check warning on line 31 in packages/rtc/src/IrisRtcApi.ts

View workflow job for this annotation

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

🌿 Branch is not covered

Warning! Not covered branch

Check warning on line 31 in packages/rtc/src/IrisRtcApi.ts

View workflow job for this annotation

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

🌿 Branch is not covered

Warning! Not covered branch

Check warning on line 31 in packages/rtc/src/IrisRtcApi.ts

View workflow job for this annotation

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

🌿 Branch is not covered

Warning! Not covered branch
}

Check warning on line 32 in packages/rtc/src/IrisRtcApi.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 32 in packages/rtc/src/IrisRtcApi.ts

View workflow job for this annotation

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

🌿 Branch is not covered

Warning! Not covered branch
}, 1000);
}

export let IrisWebRtc = {
Expand Down
6 changes: 6 additions & 0 deletions packages/rtc/src/engine/IrisClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,12 @@ export class IrisClient {
}

addLocalAudioTrack(trackPackage: AudioTrackPackage) {
let find = this.audioTrackPackages.find(
(track) => track.track === trackPackage.track
);
if (find) {
return;
}
this.audioTrackPackages.push(trackPackage);
trackPackage.irisClient = this;
}
Expand Down
3 changes: 1 addition & 2 deletions packages/rtc/src/engine/IrisClientObserver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,11 @@ export class IrisClientObserver {
const globalState = this._engine.globalState;
if (!trackPackage.track) return;

let needPublish: boolean = false;
let track = trackPackage.track as ILocalTrack;

for (const irisClient of irisClientList) {
let needPublish: boolean = false;
const options = irisClient.irisClientState;

if (globalState.enabledAudio && globalState.enabledLocalAudio) {
switch (trackPackage.type) {
case IrisAudioSourceType.kAudioSourceTypeMicrophonePrimary:
Expand Down
1 change: 0 additions & 1 deletion packages/rtc/src/helper/ImplHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,6 @@ export class ImplHelper {
connection
);
}

//clientRole update
if (isDefined(options.clientRoleType)) {
if (
Expand Down

0 comments on commit 7d1e3be

Please sign in to comment.