summaryrefslogtreecommitdiff
path: root/includes/external/matrix/node_modules/matrix-js-sdk/lib/webrtc/mediaHandler.d.ts
blob: 8841691d09ebc2642ac89bacb3b1ca93277557e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
import { TypedEventEmitter } from "../models/typed-event-emitter";
import { MatrixClient } from "../client";
export declare enum MediaHandlerEvent {
    LocalStreamsChanged = "local_streams_changed"
}
export type MediaHandlerEventHandlerMap = {
    [MediaHandlerEvent.LocalStreamsChanged]: () => void;
};
export interface IScreensharingOpts {
    desktopCapturerSourceId?: string;
    audio?: boolean;
    throwOnFail?: boolean;
}
export interface AudioSettings {
    autoGainControl: boolean;
    echoCancellation: boolean;
    noiseSuppression: boolean;
}
export declare class MediaHandler extends TypedEventEmitter<MediaHandlerEvent.LocalStreamsChanged, MediaHandlerEventHandlerMap> {
    private client;
    private audioInput?;
    private audioSettings?;
    private videoInput?;
    private localUserMediaStream?;
    userMediaStreams: MediaStream[];
    screensharingStreams: MediaStream[];
    private getMediaStreamPromise?;
    constructor(client: MatrixClient);
    restoreMediaSettings(audioInput: string, videoInput: string): void;
    /**
     * Set an audio input device to use for MatrixCalls
     * @param deviceId - the identifier for the device
     * undefined treated as unset
     */
    setAudioInput(deviceId: string): Promise<void>;
    /**
     * Set audio settings for MatrixCalls
     * @param opts - audio options to set
     */
    setAudioSettings(opts: AudioSettings): Promise<void>;
    /**
     * Set a video input device to use for MatrixCalls
     * @param deviceId - the identifier for the device
     * undefined treated as unset
     */
    setVideoInput(deviceId: string): Promise<void>;
    /**
     * Set media input devices to use for MatrixCalls
     * @param audioInput - the identifier for the audio device
     * @param videoInput - the identifier for the video device
     * undefined treated as unset
     */
    setMediaInputs(audioInput: string, videoInput: string): Promise<void>;
    updateLocalUsermediaStreams(): Promise<void>;
    hasAudioDevice(): Promise<boolean>;
    hasVideoDevice(): Promise<boolean>;
    /**
     * @param audio - should have an audio track
     * @param video - should have a video track
     * @param reusable - is allowed to be reused by the MediaHandler
     * @returns based on passed parameters
     */
    getUserMediaStream(audio: boolean, video: boolean, reusable?: boolean): Promise<MediaStream>;
    private getUserMediaStreamInternal;
    /**
     * Stops all tracks on the provided usermedia stream
     */
    stopUserMediaStream(mediaStream: MediaStream): void;
    /**
     * @param desktopCapturerSourceId - sourceId for Electron DesktopCapturer
     * @param reusable - is allowed to be reused by the MediaHandler
     * @returns based on passed parameters
     */
    getScreensharingStream(opts?: IScreensharingOpts, reusable?: boolean): Promise<MediaStream>;
    /**
     * Stops all tracks on the provided screensharing stream
     */
    stopScreensharingStream(mediaStream: MediaStream): void;
    /**
     * Stops all local media tracks
     */
    stopAllStreams(): void;
    private getUserMediaContraints;
    private getScreenshareContraints;
}
//# sourceMappingURL=mediaHandler.d.ts.map