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

Don't create data channel of publisher until sending data message #1118

Merged
merged 4 commits into from
May 6, 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
Prev Previous commit
check protocol version
  • Loading branch information
cnderrauber committed Apr 28, 2024
commit 8ed27d7f03a252a3ee55540425878e18cdd369cb
8 changes: 8 additions & 0 deletions src/room/RTCEngine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,10 @@ export default class RTCEngine extends (EventEmitter as new () => TypedEventEmit
this.pcManager.onTrack = (ev: RTCTrackEvent) => {
this.emit(EngineEvent.MediaTrackAdded, ev.track, ev.streams[0], ev.receiver);
};

if (!supportOptionalDatachannel(joinResponse.serverInfo?.protocol)) {
this.createDataChannels();
}
}

private setupSignalClientCallbacks() {
Expand Down Expand Up @@ -1390,3 +1394,7 @@ export type EngineEventCallbacks = {
remoteMute: (trackSid: string, muted: boolean) => void;
offline: () => void;
};

function supportOptionalDatachannel(protocol: number | undefined): boolean {
return protocol !== undefined && protocol > 13;
}
Loading