Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only wait for publications that are pending already #1339

Merged
merged 3 commits into from
Dec 3, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions src/room/participant/LocalParticipant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,10 @@ export default class LocalParticipant extends Participant {
if (this.pendingPublishing.has(source)) {
const pendingTrack = await this.waitForPendingPublicationOfSource(source);
if (!pendingTrack) {
this.log.info('skipping duplicate published source', { ...this.logContext, source });
this.log.info('waiting for pending publication promise timed out', {
...this.logContext,
source,
});
}
await pendingTrack?.unmute();
return pendingTrack;
Expand Down Expand Up @@ -508,9 +511,15 @@ export default class LocalParticipant extends Participant {
}
}
} else {
if (!track?.track) {
if (!track?.track && this.pendingPublishing.has(source)) {
// if there's no track available yet first wait for pending publishing promises of that source to see if it becomes available
track = await this.waitForPendingPublicationOfSource(source);
if (!track) {
this.log.info('waiting for pending publication promise timed out', {
...this.logContext,
source,
});
}
}
if (track && track.track) {
// screenshare cannot be muted, unpublish instead
Expand Down Expand Up @@ -2029,6 +2038,5 @@ export default class LocalParticipant extends Participant {
}
await sleep(20);
}
throw new Error('waiting for pending publication promise timed out');
}
}
Loading