livekit-client 0.16.2 → 0.16.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/RequestQueue.d.ts +12 -0
- package/dist/api/RequestQueue.js +61 -0
- package/dist/api/RequestQueue.js.map +1 -0
- package/dist/api/SignalClient.d.ts +4 -1
- package/dist/api/SignalClient.js +14 -1
- package/dist/api/SignalClient.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/options.d.ts +0 -10
- package/dist/room/RTCEngine.d.ts +18 -4
- package/dist/room/RTCEngine.js +13 -5
- package/dist/room/RTCEngine.js.map +1 -1
- package/dist/room/Room.d.ts +43 -6
- package/dist/room/Room.js +62 -51
- package/dist/room/Room.js.map +1 -1
- package/dist/room/events.d.ts +8 -1
- package/dist/room/events.js +10 -3
- package/dist/room/events.js.map +1 -1
- package/dist/room/participant/LocalParticipant.js +2 -3
- package/dist/room/participant/LocalParticipant.js.map +1 -1
- package/dist/room/participant/Participant.d.ts +30 -4
- package/dist/room/participant/Participant.js +2 -2
- package/dist/room/participant/Participant.js.map +1 -1
- package/dist/room/participant/RemoteParticipant.d.ts +3 -4
- package/dist/room/participant/RemoteParticipant.js.map +1 -1
- package/dist/room/track/LocalAudioTrack.js +8 -1
- package/dist/room/track/LocalAudioTrack.js.map +1 -1
- package/dist/room/track/LocalVideoTrack.d.ts +1 -5
- package/dist/room/track/LocalVideoTrack.js +12 -117
- package/dist/room/track/LocalVideoTrack.js.map +1 -1
- package/dist/room/track/Track.d.ts +16 -3
- package/dist/room/track/Track.js +3 -1
- package/dist/room/track/Track.js.map +1 -1
- package/dist/room/track/types.d.ts +4 -4
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -1
- package/src/api/RequestQueue.ts +53 -0
- package/src/api/SignalClient.ts +19 -1
- package/src/index.ts +1 -1
- package/src/options.ts +0 -12
- package/src/room/RTCEngine.ts +38 -7
- package/src/room/Room.ts +135 -59
- package/src/room/events.ts +10 -1
- package/src/room/participant/LocalParticipant.ts +1 -2
- package/src/room/participant/Participant.ts +39 -4
- package/src/room/participant/RemoteParticipant.ts +6 -4
- package/src/room/track/LocalAudioTrack.ts +8 -1
- package/src/room/track/LocalVideoTrack.ts +11 -142
- package/src/room/track/Track.ts +19 -3
- package/src/room/track/types.ts +4 -4
- package/src/version.ts +1 -1
package/src/room/track/Track.ts
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
import { EventEmitter } from 'events';
|
2
|
+
import type TypedEventEmitter from 'typed-emitter';
|
2
3
|
import { TrackSource, TrackType } from '../../proto/livekit_models';
|
3
4
|
import { StreamState as ProtoStreamState } from '../../proto/livekit_rtc';
|
4
5
|
import { TrackEvent } from '../events';
|
5
|
-
import { isSafari } from '../utils';
|
6
|
+
import { isFireFox, isSafari } from '../utils';
|
6
7
|
|
7
8
|
// keep old audio elements when detached, we would re-use them since on iOS
|
8
9
|
// Safari tracks which audio elements have been "blessed" by the user.
|
9
10
|
const recycledElements: Array<HTMLAudioElement> = [];
|
10
11
|
|
11
|
-
export class Track extends EventEmitter {
|
12
|
+
export class Track extends (EventEmitter as new () => TypedEventEmitter<TrackEventCallbacks>) {
|
12
13
|
kind: Track.Kind;
|
13
14
|
|
14
15
|
mediaStreamTrack: MediaStreamTrack;
|
@@ -183,7 +184,9 @@ export function attachToElement(track: MediaStreamTrack, element: HTMLMediaEleme
|
|
183
184
|
// avoid flicker
|
184
185
|
if (element.srcObject !== mediaStream) {
|
185
186
|
element.srcObject = mediaStream;
|
186
|
-
if (isSafari() && element instanceof HTMLVideoElement) {
|
187
|
+
if ((isSafari() || isFireFox()) && element instanceof HTMLVideoElement) {
|
188
|
+
// Firefox also has a timing issue where video doesn't actually get attached unless
|
189
|
+
// performed out-of-band
|
187
190
|
// Safari 15 has a bug where in certain layouts, video element renders
|
188
191
|
// black until the page is resized or other changes take place.
|
189
192
|
// Resetting the src triggers it to render.
|
@@ -305,3 +308,16 @@ export namespace Track {
|
|
305
308
|
}
|
306
309
|
}
|
307
310
|
}
|
311
|
+
|
312
|
+
export type TrackEventCallbacks = {
|
313
|
+
message: () => void,
|
314
|
+
muted: (track?: any) => void,
|
315
|
+
unmuted: (track?: any) => void,
|
316
|
+
ended: (track?: any) => void,
|
317
|
+
updateSettings: () => void,
|
318
|
+
updateSubscription: () => void,
|
319
|
+
audioPlaybackStarted: () => void,
|
320
|
+
audioPlaybackFailed: (error: Error) => void,
|
321
|
+
visibilityChanged: (visible: boolean, track?: any) => void,
|
322
|
+
videoDimensionsChanged: (dimensions: Track.Dimensions, track?: any) => void,
|
323
|
+
};
|
package/src/room/track/types.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
import LocalAudioTrack from './LocalAudioTrack';
|
2
|
-
import LocalVideoTrack from './LocalVideoTrack';
|
3
|
-
import RemoteAudioTrack from './RemoteAudioTrack';
|
4
|
-
import RemoteVideoTrack from './RemoteVideoTrack';
|
1
|
+
import type LocalAudioTrack from './LocalAudioTrack';
|
2
|
+
import type LocalVideoTrack from './LocalVideoTrack';
|
3
|
+
import type RemoteAudioTrack from './RemoteAudioTrack';
|
4
|
+
import type RemoteVideoTrack from './RemoteVideoTrack';
|
5
5
|
|
6
6
|
export type RemoteTrack = RemoteAudioTrack | RemoteVideoTrack;
|
7
7
|
export type AudioTrack = RemoteAudioTrack | LocalAudioTrack;
|
package/src/version.ts
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
export const version = '0.16.
|
1
|
+
export const version = '0.16.3';
|
2
2
|
export const protocolVersion = 6;
|