Skip to content
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
2 changes: 1 addition & 1 deletion packages/protobufs/fishjam/agent_notifications.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/protobufs/fishjam/media_events/peer/peer.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/protobufs/fishjam/media_events/server/server.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/protobufs/fishjam/media_events/shared.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/protobufs/fishjam/notifications/shared.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

156 changes: 153 additions & 3 deletions packages/protobufs/fishjam/peer_notifications.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/protobufs/fishjam/server_notifications.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 22 additions & 1 deletion packages/ts-client/src/FishjamClient.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import { PeerMessage, PeerMessage_RoomType } from '@fishjam-cloud/protobufs/fishjamPeer';
import type { PeerMessage_SdkDeprecation } from '@fishjam-cloud/protobufs/fishjamPeer';
import {
PeerMessage,
PeerMessage_RoomType,
PeerMessage_SdkDeprecation_Status,
} from '@fishjam-cloud/protobufs/fishjamPeer';
import { MediaEvent as PeerMediaEvent } from '@fishjam-cloud/protobufs/peer';
import { MediaEvent as ServerMediaEvent } from '@fishjam-cloud/protobufs/server';
import { ChannelMessage } from '@fishjam-cloud/protobufs/shared';
Expand Down Expand Up @@ -210,6 +215,9 @@ export class FishjamClient<PeerMetadata = GenericMetadata, ServerMetadata = Gene
const serverMediaEvent = data.serverMediaEvent;
if (data.authenticated) {
this.isAudioOnlyConnection = data.authenticated.roomType === PeerMessage_RoomType.ROOM_TYPE_AUDIO_ONLY;
if (data.authenticated.sdkDeprecation) {
this.handleSdkDeprecation(data.authenticated.sdkDeprecation);
}

this.emit('authSuccess');
this.webrtc?.connect(peerMetadata);
Expand All @@ -233,6 +241,19 @@ export class FishjamClient<PeerMetadata = GenericMetadata, ServerMetadata = Gene
};
}

public handleSdkDeprecation(sdkDeprecation: PeerMessage_SdkDeprecation) {
switch (sdkDeprecation.status) {
case PeerMessage_SdkDeprecation_Status.STATUS_UNSUPPORTED:
this.logger.error(sdkDeprecation.message);
break;
case PeerMessage_SdkDeprecation_Status.STATUS_DEPRECATED:
this.logger.warn(sdkDeprecation.message);
break;
default:
break;
}
}

/**
* Retrieves statistics related to the RTCPeerConnection.
* These statistics provide insights into the performance and status of the connection.
Expand Down
Loading