livekit-client
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -11,3 +11,3 @@ import { Writer, Reader } from 'protobufjs/minimal'; | ||
sid: string; | ||
name: string; | ||
identity: string; | ||
state: ParticipantInfo_State; | ||
@@ -14,0 +14,0 @@ tracks: TrackInfo[]; |
@@ -35,3 +35,3 @@ "use strict"; | ||
sid: "", | ||
name: "", | ||
identity: "", | ||
state: 0, | ||
@@ -262,3 +262,3 @@ }; | ||
writer.uint32(10).string(message.sid); | ||
writer.uint32(18).string(message.name); | ||
writer.uint32(18).string(message.identity); | ||
writer.uint32(24).int32(message.state); | ||
@@ -282,3 +282,3 @@ for (const v of message.tracks) { | ||
case 2: | ||
message.name = reader.string(); | ||
message.identity = reader.string(); | ||
break; | ||
@@ -307,7 +307,7 @@ case 3: | ||
} | ||
if (object.name !== undefined && object.name !== null) { | ||
message.name = String(object.name); | ||
if (object.identity !== undefined && object.identity !== null) { | ||
message.identity = String(object.identity); | ||
} | ||
else { | ||
message.name = ""; | ||
message.identity = ""; | ||
} | ||
@@ -336,7 +336,7 @@ if (object.state !== undefined && object.state !== null) { | ||
} | ||
if (object.name !== undefined && object.name !== null) { | ||
message.name = object.name; | ||
if (object.identity !== undefined && object.identity !== null) { | ||
message.identity = object.identity; | ||
} | ||
else { | ||
message.name = ""; | ||
message.identity = ""; | ||
} | ||
@@ -359,3 +359,3 @@ if (object.state !== undefined && object.state !== null) { | ||
message.sid !== undefined && (obj.sid = message.sid); | ||
message.name !== undefined && (obj.name = message.name); | ||
message.identity !== undefined && (obj.identity = message.identity); | ||
message.state !== undefined && (obj.state = participantInfo_StateToJSON(message.state)); | ||
@@ -362,0 +362,0 @@ if (message.tracks) { |
@@ -140,3 +140,6 @@ "use strict"; | ||
let publication = this.getPublicationForTrack(track); | ||
loglevel_1.default.debug('unpublishTrack', 'unpublishing track', track); | ||
// TODO: add logging | ||
if (!publication) { | ||
loglevel_1.default.warn('unpublishTrack', 'track was not unpublished because no publication was found', track); | ||
return null; | ||
@@ -158,2 +161,3 @@ } | ||
const senders = this.engine.peerConn.getSenders(); | ||
loglevel_1.default.debug('unpublishTrack:', `removing the track from ${senders.length} senders`, track); | ||
senders.forEach((sender) => { | ||
@@ -160,0 +164,0 @@ if (sender.track === mediaStreamTrack) { |
@@ -21,5 +21,5 @@ /// <reference types="node" /> | ||
identity: string; | ||
constructor(sid: string, name: string); | ||
constructor(sid: string, identity: string); | ||
getTracks(): TrackPublication[]; | ||
protected addTrackPublication(publication: TrackPublication): void; | ||
} |
@@ -8,6 +8,6 @@ "use strict"; | ||
class Participant extends events_1.EventEmitter { | ||
constructor(sid, name) { | ||
constructor(sid, identity) { | ||
super(); | ||
this.sid = sid; | ||
this.identity = name; | ||
this.identity = identity; | ||
this.audioTracks = new Map(); | ||
@@ -14,0 +14,0 @@ this.videoTracks = new Map(); |
@@ -26,3 +26,3 @@ "use strict"; | ||
static fromParticipantInfo(pi) { | ||
const rp = new RemoteParticipant(pi.sid, pi.name); | ||
const rp = new RemoteParticipant(pi.sid, pi.identity); | ||
rp.updateMetadata(pi); | ||
@@ -118,3 +118,3 @@ return rp; | ||
const alreadyHasMetadata = this.hasMetadata; | ||
this.identity = info.name; | ||
this.identity = info.identity; | ||
this.sid = info.sid; | ||
@@ -121,0 +121,0 @@ this.participantInfo = info; |
@@ -38,3 +38,3 @@ "use strict"; | ||
const pi = joinResponse.participant; | ||
this.localParticipant = new LocalParticipant_1.LocalParticipant(pi.sid, pi.name, this.engine); | ||
this.localParticipant = new LocalParticipant_1.LocalParticipant(pi.sid, pi.identity, this.engine); | ||
// populate remote participants, these should not trigger new events | ||
@@ -41,0 +41,0 @@ joinResponse.otherParticipants.forEach((pi) => { |
{ | ||
"name": "livekit-client", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "JavaScript/TypeScript client SDK for LiveKit", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
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 not supported yet
Sorry, the diff of this file is not supported yet
276141
4304