@livekit/rtc-node
Advanced tools
Comparing version 0.6.2 to 0.7.0
@@ -6,5 +6,5 @@ import type TypedEmitter from 'typed-emitter'; | ||
import { LocalParticipant, RemoteParticipant } from './participant.js'; | ||
import type { ConnectionQuality, DataPacketKind, IceServer } from './proto/room_pb.js'; | ||
import type { ConnectionQuality, DataPacketKind, DisconnectReason, IceServer } from './proto/room_pb.js'; | ||
import { ConnectionState, ContinualGatheringPolicy, IceTransportType } from './proto/room_pb.js'; | ||
import type { RemoteTrack } from './track.js'; | ||
import type { LocalTrack, RemoteTrack } from './track.js'; | ||
import type { LocalTrackPublication, TrackPublication } from './track_publication.js'; | ||
@@ -52,2 +52,3 @@ import { RemoteTrackPublication } from './track_publication.js'; | ||
localTrackUnpublished: (publication: LocalTrackPublication, participant: LocalParticipant) => void; | ||
localTrackSubscribed: (track: LocalTrack) => void; | ||
trackPublished: (publication: RemoteTrackPublication, participant: RemoteParticipant) => void; | ||
@@ -71,3 +72,3 @@ trackUnpublished: (publication: RemoteTrackPublication, participant: RemoteParticipant) => void; | ||
connected: () => void; | ||
disconnected: (reason?: string) => void; | ||
disconnected: (reason: DisconnectReason) => void; | ||
reconnecting: () => void; | ||
@@ -81,2 +82,3 @@ reconnected: () => void; | ||
LocalTrackUnpublished = "localTrackUnpublished", | ||
LocalTrackSubscribed = "localTrackSubscribed", | ||
TrackPublished = "trackPublished", | ||
@@ -83,0 +85,0 @@ TrackUnpublished = "trackUnpublished", |
@@ -54,2 +54,6 @@ // SPDX-FileCopyrightText: 2024 LiveKit, Inc. | ||
} | ||
else if (ev.case == 'localTrackSubscribed') { | ||
const publication = this.localParticipant.trackPublications.get(ev.value.trackSid); | ||
this.emit(RoomEvent.LocalTrackSubscribed, publication.track); | ||
} | ||
else if (ev.case == 'trackPublished') { | ||
@@ -169,3 +173,3 @@ const participant = this.remoteParticipants.get(ev.value.participantIdentity); | ||
else if (ev.case == 'disconnected') { | ||
this.emit(RoomEvent.Disconnected); | ||
this.emit(RoomEvent.Disconnected, ev.value.reason); | ||
} | ||
@@ -280,2 +284,3 @@ else if (ev.case == 'reconnecting') { | ||
RoomEvent["LocalTrackUnpublished"] = "localTrackUnpublished"; | ||
RoomEvent["LocalTrackSubscribed"] = "localTrackSubscribed"; | ||
RoomEvent["TrackPublished"] = "trackPublished"; | ||
@@ -282,0 +287,0 @@ RoomEvent["TrackUnpublished"] = "trackUnpublished"; |
@@ -6,3 +6,3 @@ { | ||
"author": "LiveKit", | ||
"version": "0.6.2", | ||
"version": "0.7.0", | ||
"main": "dist/index.js", | ||
@@ -47,7 +47,7 @@ "types": "dist/index.d.ts", | ||
"optionalDependencies": { | ||
"@livekit/rtc-node-darwin-arm64": "0.6.2", | ||
"@livekit/rtc-node-darwin-x64": "0.6.2", | ||
"@livekit/rtc-node-linux-arm64-gnu": "0.6.2", | ||
"@livekit/rtc-node-linux-x64-gnu": "0.6.2", | ||
"@livekit/rtc-node-win32-x64-msvc": "0.6.2" | ||
"@livekit/rtc-node-darwin-arm64": "0.7.0", | ||
"@livekit/rtc-node-darwin-x64": "0.7.0", | ||
"@livekit/rtc-node-linux-arm64-gnu": "0.7.0", | ||
"@livekit/rtc-node-linux-x64-gnu": "0.7.0", | ||
"@livekit/rtc-node-win32-x64-msvc": "0.7.0" | ||
}, | ||
@@ -54,0 +54,0 @@ "engines": { |
@@ -19,2 +19,3 @@ // SPDX-FileCopyrightText: 2024 LiveKit, Inc. | ||
DataPacketKind, | ||
DisconnectReason, | ||
DisconnectResponse, | ||
@@ -31,3 +32,3 @@ IceServer, | ||
import { TrackKind } from './proto/track_pb.js'; | ||
import type { RemoteTrack } from './track.js'; | ||
import type { LocalTrack, RemoteTrack } from './track.js'; | ||
import { RemoteAudioTrack, RemoteVideoTrack } from './track.js'; | ||
@@ -190,2 +191,5 @@ import type { LocalTrackPublication, TrackPublication } from './track_publication.js'; | ||
this.emit(RoomEvent.LocalTrackUnpublished, publication, this.localParticipant); | ||
} else if (ev.case == 'localTrackSubscribed') { | ||
const publication = this.localParticipant.trackPublications.get(ev.value.trackSid); | ||
this.emit(RoomEvent.LocalTrackSubscribed, publication.track); | ||
} else if (ev.case == 'trackPublished') { | ||
@@ -301,3 +305,3 @@ const participant = this.remoteParticipants.get(ev.value.participantIdentity); | ||
} else if (ev.case == 'disconnected') { | ||
this.emit(RoomEvent.Disconnected); | ||
this.emit(RoomEvent.Disconnected, ev.value.reason); | ||
} else if (ev.case == 'reconnecting') { | ||
@@ -343,2 +347,3 @@ this.emit(RoomEvent.Reconnecting); | ||
) => void; | ||
localTrackSubscribed: (track: LocalTrack) => void; | ||
trackPublished: (publication: RemoteTrackPublication, participant: RemoteParticipant) => void; | ||
@@ -382,3 +387,3 @@ trackUnpublished: (publication: RemoteTrackPublication, participant: RemoteParticipant) => void; | ||
connected: () => void; | ||
disconnected: (reason?: string) => void; | ||
disconnected: (reason: DisconnectReason) => void; | ||
reconnecting: () => void; | ||
@@ -393,2 +398,3 @@ reconnected: () => void; | ||
LocalTrackUnpublished = 'localTrackUnpublished', | ||
LocalTrackSubscribed = 'localTrackSubscribed', | ||
TrackPublished = 'trackPublished', | ||
@@ -395,0 +401,0 @@ TrackUnpublished = 'trackUnpublished', |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
1711710
29369