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

fix: video not publishing on sfu migration #3436

Merged
merged 1 commit into from
Jan 14, 2025
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
14 changes: 6 additions & 8 deletions packages/hms-video-store/src/media/tracks/HMSLocalAudioTrack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,12 @@ export class HMSLocalAudioTrack extends HMSAudioTrack {
}

clone(stream: HMSLocalStream) {
const track = new HMSLocalAudioTrack(
stream,
this.nativeTrack.clone(),
this.source!,
this.eventBus,
this.settings,
this.room,
);
const clonedTrack = this.nativeTrack.clone();
/**
* stream only becomes active when the track is added to it.
*/
stream.nativeStream.addTrack(clonedTrack);
const track = new HMSLocalAudioTrack(stream, clonedTrack, this.source!, this.eventBus, this.settings, this.room);
track.peerId = this.peerId;

if (this.pluginsManager.pluginsMap.size > 0) {
Expand Down
15 changes: 7 additions & 8 deletions packages/hms-video-store/src/media/tracks/HMSLocalVideoTrack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,13 @@ export class HMSLocalVideoTrack extends HMSVideoTrack {
}

clone(stream: HMSLocalStream) {
const track = new HMSLocalVideoTrack(
stream,
this.nativeTrack.clone(),
this.source!,
this.eventBus,
this.settings,
this.room,
);
const clonedTrack = this.nativeTrack.clone();
/**
* stream only becomes active when the track is added to it. If this is not added, after sfu migration, in non-simulcast case, the video will not be
* published to the server
*/
stream.nativeStream.addTrack(clonedTrack);
const track = new HMSLocalVideoTrack(stream, clonedTrack, this.source!, this.eventBus, this.settings, this.room);
track.peerId = this.peerId;

if (this.pluginsManager.pluginsMap.size > 0) {
Expand Down
Loading