@livekit/components-core
Advanced tools
Comparing version 0.11.2 to 0.11.3
@@ -12,3 +12,3 @@ import type { AudioCaptureOptions } from 'livekit-client'; | ||
import { Observable } from 'rxjs'; | ||
import type { Participant } from 'livekit-client'; | ||
import { Participant } from 'livekit-client'; | ||
import { ParticipantEvent } from 'livekit-client'; | ||
@@ -141,3 +141,3 @@ import type { ParticipantEventCallbacks } from 'livekit-client/dist/src/room/participant/Participant'; | ||
export declare function encryptionStatusObservable(room: Room, participant: Participant): Observable<boolean>; | ||
export declare function encryptionStatusObservable(room: Room, participant: Participant | undefined): Observable<boolean>; | ||
@@ -320,3 +320,3 @@ export declare function getActiveTranscriptionSegments(segments: ReceivedTranscriptionSegment[], syncTimes: { | ||
pendingObserver: Observable<boolean>; | ||
toggle: (forceState?: boolean, captureOptions?: CaptureOptionsBySource<T>) => Promise<void>; | ||
toggle: (forceState?: boolean, captureOptions?: CaptureOptionsBySource<T>) => Promise<boolean | undefined>; | ||
className: string; | ||
@@ -345,7 +345,9 @@ enabledObserver: Observable<boolean>; | ||
attributes: Readonly<Record<string, string>>; | ||
} | { | ||
changed: Readonly<Record<string, string>>; | ||
attributes: Readonly<Record<string, string>>; | ||
}>; | ||
export declare function participantAttributesObserver(participant: undefined): Observable<{ | ||
changed: undefined; | ||
attributes: undefined; | ||
}>; | ||
export declare function participantByIdentifierObserver(room: Room, { kind, identity }: ParticipantIdentifier, options?: ConnectedParticipantObserverOptions): Observable<RemoteParticipant | undefined>; | ||
@@ -371,3 +373,3 @@ | ||
export declare function participantInfoObserver(participant: Participant): Observable<{ | ||
export declare function participantInfoObserver(participant?: Participant): Observable<{ | ||
name: string | undefined; | ||
@@ -380,3 +382,3 @@ identity: string; | ||
metadata: string | undefined; | ||
}>; | ||
}> | undefined; | ||
@@ -586,3 +588,3 @@ export declare interface ParticipantMedia<T extends Participant = Participant> { | ||
metadata: string | undefined; | ||
}>; | ||
}> | undefined; | ||
}; | ||
@@ -589,0 +591,0 @@ |
@@ -7,3 +7,3 @@ import type { AudioCaptureOptions, Room, ScreenShareCaptureOptions, TrackPublishOptions, VideoCaptureOptions } from 'livekit-client'; | ||
pendingObserver: Observable<boolean>; | ||
toggle: (forceState?: boolean, captureOptions?: CaptureOptionsBySource<T>) => Promise<void>; | ||
toggle: (forceState?: boolean, captureOptions?: CaptureOptionsBySource<T>) => Promise<boolean | undefined>; | ||
className: string; | ||
@@ -10,0 +10,0 @@ enabledObserver: Observable<boolean>; |
@@ -12,4 +12,4 @@ import type { Participant } from 'livekit-client'; | ||
metadata: string | undefined; | ||
}>; | ||
}> | undefined; | ||
}; | ||
//# sourceMappingURL=participantName.d.ts.map |
import type { ParticipantPermission } from '@livekit/protocol'; | ||
import type { Participant, RemoteParticipant, Room, TrackPublication } from 'livekit-client'; | ||
import { Participant, RemoteParticipant, Room, TrackPublication } from 'livekit-client'; | ||
import { ParticipantEvent, RoomEvent } from 'livekit-client'; | ||
@@ -21,3 +21,3 @@ import type { ParticipantEventCallbacks } from 'livekit-client/dist/src/room/participant/Participant'; | ||
}>; | ||
export declare function participantInfoObserver(participant: Participant): Observable<{ | ||
export declare function participantInfoObserver(participant?: Participant): Observable<{ | ||
name: string | undefined; | ||
@@ -30,3 +30,3 @@ identity: string; | ||
metadata: string | undefined; | ||
}>; | ||
}> | undefined; | ||
export declare function createConnectionQualityObserver(participant: Participant): Observable<import("livekit-client").ConnectionQuality>; | ||
@@ -49,7 +49,8 @@ export declare function participantEventSelector<T extends ParticipantEvent>(participant: Participant, event: T): Observable<Parameters<ParticipantEventCallbacks[Extract<T, keyof ParticipantEventCallbacks>]>>; | ||
attributes: Readonly<Record<string, string>>; | ||
} | { | ||
changed: Readonly<Record<string, string>>; | ||
attributes: Readonly<Record<string, string>>; | ||
}>; | ||
export declare function participantAttributesObserver(participant: undefined): Observable<{ | ||
changed: undefined; | ||
attributes: undefined; | ||
}>; | ||
export {}; | ||
//# sourceMappingURL=participant.d.ts.map |
@@ -28,4 +28,4 @@ import { Observable } from 'rxjs'; | ||
export declare function createActiveDeviceObservable(room: Room, kind: MediaDeviceKind): Observable<string | undefined>; | ||
export declare function encryptionStatusObservable(room: Room, participant: Participant): Observable<boolean>; | ||
export declare function encryptionStatusObservable(room: Room, participant: Participant | undefined): Observable<boolean>; | ||
export declare function recordingStatusObservable(room: Room): Observable<boolean>; | ||
//# sourceMappingURL=room.d.ts.map |
{ | ||
"name": "@livekit/components-core", | ||
"version": "0.11.2", | ||
"version": "0.11.3", | ||
"license": "Apache-2.0", | ||
@@ -46,3 +46,3 @@ "author": "LiveKit", | ||
"@livekit/components-styles": "1.0.12", | ||
"eslint-config-lk-custom": "0.1.1" | ||
"eslint-config-lk-custom": "0.1.2" | ||
}, | ||
@@ -49,0 +49,0 @@ "engines": { |
@@ -25,3 +25,6 @@ import type { | ||
pendingObserver: Observable<boolean>; | ||
toggle: (forceState?: boolean, captureOptions?: CaptureOptionsBySource<T>) => Promise<void>; | ||
toggle: ( | ||
forceState?: boolean, | ||
captureOptions?: CaptureOptionsBySource<T>, | ||
) => Promise<boolean | undefined>; | ||
className: string; | ||
@@ -83,3 +86,3 @@ enabledObserver: Observable<boolean>; | ||
); | ||
break; | ||
return localParticipant.isCameraEnabled; | ||
case Track.Source.Microphone: | ||
@@ -91,3 +94,3 @@ await localParticipant.setMicrophoneEnabled( | ||
); | ||
break; | ||
return localParticipant.isMicrophoneEnabled; | ||
case Track.Source.ScreenShare: | ||
@@ -99,5 +102,5 @@ await localParticipant.setScreenShareEnabled( | ||
); | ||
break; | ||
return localParticipant.isScreenShareEnabled; | ||
default: | ||
break; | ||
throw new TypeError('Tried to toggle unsupported source'); | ||
} | ||
@@ -107,2 +110,3 @@ } catch (e) { | ||
onError?.(e); | ||
return undefined; | ||
} else { | ||
@@ -109,0 +113,0 @@ throw e; |
import type { ParticipantPermission } from '@livekit/protocol'; | ||
import type { Participant, RemoteParticipant, Room, TrackPublication } from 'livekit-client'; | ||
import { Participant, RemoteParticipant, Room, TrackPublication } from 'livekit-client'; | ||
import { ParticipantEvent, RoomEvent, Track } from 'livekit-client'; | ||
@@ -88,3 +88,6 @@ import type { ParticipantEventCallbacks } from 'livekit-client/dist/src/room/participant/Participant'; | ||
export function participantInfoObserver(participant: Participant) { | ||
export function participantInfoObserver(participant?: Participant) { | ||
if (!participant) { | ||
return undefined; | ||
} | ||
const observer = observeParticipantEvents( | ||
@@ -291,3 +294,14 @@ participant, | ||
export function participantAttributesObserver(participant: Participant) { | ||
export function participantAttributesObserver(participant: Participant): Observable<{ | ||
changed: Readonly<Record<string, string>>; | ||
attributes: Readonly<Record<string, string>>; | ||
}>; | ||
export function participantAttributesObserver(participant: undefined): Observable<{ | ||
changed: undefined; | ||
attributes: undefined; | ||
}>; | ||
export function participantAttributesObserver(participant: Participant | undefined) { | ||
if (typeof participant === 'undefined') { | ||
return new Observable<{ changed: undefined; attributes: undefined }>(); | ||
} | ||
return participantEventSelector(participant, ParticipantEvent.AttributesChanged).pipe( | ||
@@ -294,0 +308,0 @@ map(([changedAttributes]) => { |
@@ -251,12 +251,14 @@ import type { Subscriber, Subscription } from 'rxjs'; | ||
export function encryptionStatusObservable(room: Room, participant: Participant) { | ||
export function encryptionStatusObservable(room: Room, participant: Participant | undefined) { | ||
return roomEventSelector(room, RoomEvent.ParticipantEncryptionStatusChanged).pipe( | ||
filter( | ||
([, p]) => | ||
participant.identity === p?.identity || | ||
(!p && participant.identity === room.localParticipant.identity), | ||
participant?.identity === p?.identity || | ||
(!p && participant?.identity === room.localParticipant.identity), | ||
), | ||
map(([encrypted]) => encrypted), | ||
startWith( | ||
participant instanceof LocalParticipant ? participant.isE2EEEnabled : participant.isEncrypted, | ||
participant instanceof LocalParticipant | ||
? participant.isE2EEEnabled | ||
: !!participant?.isEncrypted, | ||
), | ||
@@ -263,0 +265,0 @@ ); |
@@ -19,3 +19,6 @@ import { log } from '../logger'; | ||
try { | ||
localStorage.setItem(key, JSON.stringify(value)); | ||
if (value) { | ||
const nonEmptySettings = Object.entries(value).filter(([, value]) => value !== ''); | ||
localStorage.setItem(key, JSON.stringify(nonEmptySettings)); | ||
} | ||
} catch (error) { | ||
@@ -22,0 +25,0 @@ log.error(`Error setting item to local storage: ${error}`); |
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 not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
675602
9244