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

Make sure that processorElement stays muted after attach #984

Merged
merged 2 commits into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 5 additions & 0 deletions .changeset/afraid-humans-visit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"livekit-client": patch
---

Make sure that processorElement stays muted after attach
5 changes: 4 additions & 1 deletion src/room/track/LocalTrack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ export default abstract class LocalTrack extends Track {
}

attachToElement(newTrack, this.processorElement);
// ensure the processorElement itself stays muted
this.processorElement.muted = true;
await this.processor.restart({
track: newTrack,
kind: this.kind,
Expand Down Expand Up @@ -415,9 +417,10 @@ export default abstract class LocalTrack extends Track {
throw TypeError('cannot set processor on track of unknown kind');
}
this.processorElement = this.processorElement ?? document.createElement(this.kind);
this.processorElement.muted = true;

attachToElement(this._mediaStreamTrack, this.processorElement);
this.processorElement.muted = true;

this.processorElement
.play()
.catch((error) => log.error('failed to play processor element', { error }));
Expand Down
Loading