livekit-client
Advanced tools
Comparing version 0.5.3 to 0.5.4
import 'webrtc-adapter'; | ||
import { ParticipantInfo, TrackType } from '../proto/model'; | ||
import { JoinResponse, SignalRequest, SignalTarget, SpeakerInfo, TrackPublishedResponse } from '../proto/rtc'; | ||
export interface ConnectionInfo { | ||
host: string; | ||
port: number; | ||
secure?: boolean; | ||
} | ||
/** | ||
@@ -10,0 +5,0 @@ * RTCClient is the signaling layer of WebRTC, it's LiveKit's signaling protocol |
@@ -1,2 +0,1 @@ | ||
import { ConnectionInfo } from './api/SignalClient'; | ||
import { LocalParticipant } from './room/participant/LocalParticipant'; | ||
@@ -31,2 +30,2 @@ import { Participant } from './room/participant/Participant'; | ||
export * from './version'; | ||
export { ConnectionInfo, Room, RoomState, Participant, RemoteParticipant, LocalParticipant, }; | ||
export { Room, RoomState, Participant, RemoteParticipant, LocalParticipant }; |
@@ -20,2 +20,3 @@ /// <reference types="node" /> | ||
}; | ||
disconnectTimeout?: ReturnType<typeof setTimeout>; | ||
url?: string; | ||
@@ -22,0 +23,0 @@ token?: string; |
@@ -92,4 +92,6 @@ "use strict"; | ||
close() { | ||
this.publisher.close(); | ||
this.subscriber.close(); | ||
if (this.publisher) { | ||
this.publisher.close(); | ||
this.subscriber.close(); | ||
} | ||
this.client.close(); | ||
@@ -136,13 +138,29 @@ } | ||
this.publisher.pc.oniceconnectionstatechange = (ev) => { | ||
if (this.publisher.pc.iceConnectionState === 'connected' && | ||
!this.iceConnected) { | ||
if (this.publisher.pc.iceConnectionState === 'connected') { | ||
loglevel_1.default.trace('ICE connected'); | ||
this.iceConnected = true; | ||
this.emit(events_2.EngineEvent.Connected); | ||
if (this.disconnectTimeout) { | ||
clearTimeout(this.disconnectTimeout); | ||
this.disconnectTimeout = undefined; | ||
} | ||
if (!this.iceConnected) { | ||
this.iceConnected = true; | ||
this.emit(events_2.EngineEvent.Connected); | ||
} | ||
} | ||
else if (this.publisher.pc.iceConnectionState === 'disconnected') { | ||
loglevel_1.default.trace('ICE disconnected'); | ||
this.iceConnected = false; | ||
this.emit(events_2.EngineEvent.Disconnected); | ||
this.close(); | ||
if (this.disconnectTimeout) { | ||
return; | ||
} | ||
// Safari sends ICE disconnect during negotiation, it'll reconnect | ||
// once server responds | ||
// We'll trigger disconnect after a long delay if we are in the waiting-for-server-answer | ||
// state | ||
const delay = this.publisher.pc.signalingState == 'have-local-offer' ? 3000 : 100; | ||
this.disconnectTimeout = setTimeout(() => { | ||
this.disconnectTimeout = undefined; | ||
this.iceConnected = false; | ||
this.emit(events_2.EngineEvent.Disconnected); | ||
this.close(); | ||
}, delay); | ||
} | ||
@@ -149,0 +167,0 @@ }; |
@@ -124,3 +124,3 @@ "use strict"; | ||
const nackDelta = curr.nackCount - prev.nackCount; | ||
const qualityLimited = curr.qualityLimitationReason != 'none'; | ||
const qualityLimited = curr.qualityLimitationReason && curr.qualityLimitationReason != 'none'; | ||
if (pliDelta > 0 || qualityLimited) { | ||
@@ -127,0 +127,0 @@ loglevel_1.default.debug('detected publisher quality issue', 'track', this.id, 'rid', curr.rid, 'pliDelta', pliDelta, 'nackDelta', nackDelta, 'qualityLimited', curr.qualityLimitationReason, curr); |
@@ -1,2 +0,2 @@ | ||
declare const version = "0.5.2"; | ||
declare const version = "0.5.4"; | ||
export { version }; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.version = void 0; | ||
const version = '0.5.2'; | ||
const version = '0.5.4'; | ||
exports.version = version; | ||
//# sourceMappingURL=version.js.map |
{ | ||
"name": "livekit-client", | ||
"version": "0.5.3", | ||
"version": "0.5.4", | ||
"description": "JavaScript/TypeScript client SDK for LiveKit", | ||
@@ -13,3 +13,3 @@ "main": "dist/index.js", | ||
"build-docs": "yarn exec typedoc", | ||
"proto": "protoc --plugin=node_modules/ts-proto/protoc-gen-ts_proto --ts_proto_out=./src/proto --ts_proto_opt=outputClientImpl=false,useOptionals=true -I../livekit-server/proto ../livekit-server/proto/rtc.proto ../livekit-server/proto/model.proto", | ||
"proto": "protoc --plugin=node_modules/ts-proto/protoc-gen-ts_proto --ts_proto_out=./src/proto --ts_proto_opt=outputClientImpl=false,useOptionals=true -I../protocol ../protocol/rtc.proto ../protocol/model.proto", | ||
"sample": "cd example && webpack serve", | ||
@@ -16,0 +16,0 @@ "test": "jest" |
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
1451452
176
9292