diff options
author | RaindropsSys <contact@minteck.org> | 2023-04-24 14:03:36 +0200 |
---|---|---|
committer | RaindropsSys <contact@minteck.org> | 2023-04-24 14:03:36 +0200 |
commit | 633c92eae865e957121e08de634aeee11a8b3992 (patch) | |
tree | 09d881bee1dae0b6eee49db1dfaf0f500240606c /includes/external/matrix/node_modules/matrix-js-sdk/lib/webrtc/callFeed.d.ts | |
parent | c4657e4509733699c0f26a3c900bab47e915d5a0 (diff) | |
download | pluralconnect-633c92eae865e957121e08de634aeee11a8b3992.tar.gz pluralconnect-633c92eae865e957121e08de634aeee11a8b3992.tar.bz2 pluralconnect-633c92eae865e957121e08de634aeee11a8b3992.zip |
Updated 18 files, added 1692 files and deleted includes/system/compare.inc (automated)
Diffstat (limited to 'includes/external/matrix/node_modules/matrix-js-sdk/lib/webrtc/callFeed.d.ts')
-rw-r--r-- | includes/external/matrix/node_modules/matrix-js-sdk/lib/webrtc/callFeed.d.ts | 128 |
1 files changed, 128 insertions, 0 deletions
diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/webrtc/callFeed.d.ts b/includes/external/matrix/node_modules/matrix-js-sdk/lib/webrtc/callFeed.d.ts new file mode 100644 index 0000000..e9ffa64 --- /dev/null +++ b/includes/external/matrix/node_modules/matrix-js-sdk/lib/webrtc/callFeed.d.ts @@ -0,0 +1,128 @@ +import { SDPStreamMetadataPurpose } from "./callEventTypes"; +import { MatrixClient } from "../client"; +import { RoomMember } from "../models/room-member"; +import { TypedEventEmitter } from "../models/typed-event-emitter"; +import { MatrixCall } from "./call"; +export declare const SPEAKING_THRESHOLD = -60; +export interface ICallFeedOpts { + client: MatrixClient; + roomId?: string; + userId: string; + deviceId: string | undefined; + stream: MediaStream; + purpose: SDPStreamMetadataPurpose; + /** + * Whether or not the remote SDPStreamMetadata says audio is muted + */ + audioMuted: boolean; + /** + * Whether or not the remote SDPStreamMetadata says video is muted + */ + videoMuted: boolean; + /** + * The MatrixCall which is the source of this CallFeed + */ + call?: MatrixCall; +} +export declare enum CallFeedEvent { + NewStream = "new_stream", + MuteStateChanged = "mute_state_changed", + LocalVolumeChanged = "local_volume_changed", + VolumeChanged = "volume_changed", + ConnectedChanged = "connected_changed", + Speaking = "speaking", + Disposed = "disposed" +} +type EventHandlerMap = { + [CallFeedEvent.NewStream]: (stream: MediaStream) => void; + [CallFeedEvent.MuteStateChanged]: (audioMuted: boolean, videoMuted: boolean) => void; + [CallFeedEvent.LocalVolumeChanged]: (localVolume: number) => void; + [CallFeedEvent.VolumeChanged]: (volume: number) => void; + [CallFeedEvent.ConnectedChanged]: (connected: boolean) => void; + [CallFeedEvent.Speaking]: (speaking: boolean) => void; + [CallFeedEvent.Disposed]: () => void; +}; +export declare class CallFeed extends TypedEventEmitter<CallFeedEvent, EventHandlerMap> { + stream: MediaStream; + sdpMetadataStreamId: string; + userId: string; + readonly deviceId: string | undefined; + purpose: SDPStreamMetadataPurpose; + speakingVolumeSamples: number[]; + private client; + private call?; + private roomId?; + private audioMuted; + private videoMuted; + private localVolume; + private measuringVolumeActivity; + private audioContext?; + private analyser?; + private frequencyBinCount?; + private speakingThreshold; + private speaking; + private volumeLooperTimeout?; + private _disposed; + private _connected; + constructor(opts: ICallFeedOpts); + get connected(): boolean; + private set connected(value); + private get hasAudioTrack(); + private updateStream; + private initVolumeMeasuring; + private onAddTrack; + private onCallState; + /** + * Returns callRoom member + * @returns member of the callRoom + */ + getMember(): RoomMember | null; + /** + * Returns true if CallFeed is local, otherwise returns false + * @returns is local? + */ + isLocal(): boolean; + /** + * Returns true if audio is muted or if there are no audio + * tracks, otherwise returns false + * @returns is audio muted? + */ + isAudioMuted(): boolean; + /** + * Returns true video is muted or if there are no video + * tracks, otherwise returns false + * @returns is video muted? + */ + isVideoMuted(): boolean; + isSpeaking(): boolean; + /** + * Replaces the current MediaStream with a new one. + * The stream will be different and new stream as remote parties are + * concerned, but this can be used for convenience locally to set up + * volume listeners automatically on the new stream etc. + * @param newStream - new stream with which to replace the current one + */ + setNewStream(newStream: MediaStream): void; + /** + * Set one or both of feed's internal audio and video video mute state + * Either value may be null to leave it as-is + * @param audioMuted - is the feed's audio muted? + * @param videoMuted - is the feed's video muted? + */ + setAudioVideoMuted(audioMuted: boolean | null, videoMuted: boolean | null): void; + /** + * Starts emitting volume_changed events where the emitter value is in decibels + * @param enabled - emit volume changes + */ + measureVolumeActivity(enabled: boolean): void; + setSpeakingThreshold(threshold: number): void; + private volumeLooper; + clone(): CallFeed; + dispose(): void; + get disposed(): boolean; + private set disposed(value); + getLocalVolume(): number; + setLocalVolume(localVolume: number): void; +} +export {}; +//# sourceMappingURL=callFeed.d.ts.map
\ No newline at end of file |