@techsee/techsee-media-service 6.2.0 → 7.0.1
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/README.md +27 -28
- package/lib/LocalStreamManager.d.ts.map +1 -1
- package/lib/LocalStreamManager.js +9 -8
- package/lib/LocalStreamManager.js.map +1 -1
- package/lib/MediaContracts.d.ts.map +1 -1
- package/lib/MediaPublisher.d.ts.map +1 -1
- package/lib/MediaPublisher.js.map +1 -1
- package/lib/MediaServiceBase.d.ts.map +1 -1
- package/lib/MediaServiceBase.js +2 -0
- package/lib/MediaServiceBase.js.map +1 -1
- package/lib/MediaSession/MediaServer.d.ts.map +1 -1
- package/lib/MediaSession/MediaServer.js.map +1 -1
- package/lib/MediaSession/MediaSessionBase.d.ts.map +1 -1
- package/lib/MediaSession/MediaSessionBase.js.map +1 -1
- package/lib/MediaSession/SessionOpentok.d.ts.map +1 -1
- package/lib/MediaSession/SessionOpentok.js.map +1 -1
- package/lib/MediaSession/SessionTurn.d.ts.map +1 -1
- package/lib/MediaSession/SessionTurn.js +5 -5
- package/lib/MediaSession/SessionTurn.js.map +1 -1
- package/lib/MediaSubscriber.d.ts.map +1 -1
- package/lib/MediaSubscriber.js.map +1 -1
- package/lib/MediaUtils/Compatibility.d.ts.map +1 -1
- package/lib/MediaUtils/Compatibility.js +2 -1
- package/lib/MediaUtils/Compatibility.js.map +1 -1
- package/lib/MediaUtils/MediaDomUtils.d.ts.map +1 -1
- package/lib/MediaUtils/MediaDomUtils.js +2 -1
- package/lib/MediaUtils/MediaDomUtils.js.map +1 -1
- package/lib/MultiParty/Contracts.d.ts.map +1 -1
- package/lib/MultiParty/MediaCapabilitiesService.d.ts.map +1 -1
- package/lib/MultiParty/MediaCapabilitiesService.js +42 -23
- package/lib/MultiParty/MediaCapabilitiesService.js.map +1 -1
- package/lib/MultiParty/MediaCapabilitiesUtils.d.ts.map +1 -1
- package/lib/MultiParty/MultiPartyService.d.ts.map +1 -1
- package/lib/MultiParty/MultiPartyServiceFactory.d.ts.map +1 -1
- package/lib/MultiParty/OpentokMultiPartyService.d.ts.map +1 -1
- package/lib/MultiParty/OpentokMultiPartyService.js +9 -4
- package/lib/MultiParty/OpentokMultiPartyService.js.map +1 -1
- package/lib/MultiParty/VideoLayoutType.d.ts.map +1 -1
- package/lib/MultiParty/index.d.ts.map +1 -1
- package/lib/MultiParty/opentok.d.ts +407 -457
- package/lib/TechseeMediaStream.d.ts.map +1 -1
- package/lib/TechseeMediaStream.js.map +1 -1
- package/lib/qos/raw-qos.js.map +1 -1
- package/package.json +21 -8
|
@@ -1,503 +1,453 @@
|
|
|
1
1
|
declare namespace OT {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
export type Dimensions = {
|
|
8
|
-
width: number;
|
|
9
|
-
height: number;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export type ScreenSharingCapabilityResponse = {
|
|
13
|
-
extensionInstalled?: boolean;
|
|
14
|
-
supported: boolean;
|
|
15
|
-
supportedSources: {
|
|
16
|
-
application?: boolean;
|
|
17
|
-
screen?: boolean;
|
|
18
|
-
window?: boolean;
|
|
2
|
+
export type OTError = {
|
|
3
|
+
name: string;
|
|
4
|
+
message: string;
|
|
19
5
|
};
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
export function checkScreenSharingCapability(
|
|
25
|
-
callback: (response: ScreenSharingCapabilityResponse) => void
|
|
26
|
-
): void;
|
|
27
|
-
|
|
28
|
-
export function checkSystemRequirements(): number;
|
|
29
|
-
|
|
30
|
-
export type Device = {
|
|
31
|
-
kind: 'audioInput' | 'videoInput';
|
|
32
|
-
deviceId: string;
|
|
33
|
-
label: string;
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export function getDevices(
|
|
37
|
-
callback: (error: OTError | undefined, devices?: Device[]) => void
|
|
38
|
-
): void;
|
|
39
|
-
|
|
40
|
-
export function setProxyUrl(proxyUrl: string): void;
|
|
41
|
-
|
|
42
|
-
export function getSupportedCodecs(): Promise<{ videoEncoders: ('H264' | 'VP8')[], videoDecoders: ('H264' | 'VP8')[] }>;
|
|
43
|
-
|
|
44
|
-
export type WidgetStyle = {
|
|
45
|
-
audioLevelDisplayMode: 'auto' | 'on' | 'off';
|
|
46
|
-
backgroundImageURI: string;
|
|
47
|
-
buttonDisplayMode: 'auto' | 'on' | 'off';
|
|
48
|
-
nameDisplayMode: 'auto' | 'on' | 'off';
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
export type WidgetProperties = {
|
|
52
|
-
fitMode?: 'cover' | 'contain';
|
|
53
|
-
insertDefaultUI?: boolean;
|
|
54
|
-
insertMode?: 'replace' | 'after' | 'before' | 'append';
|
|
55
|
-
showControls?: boolean;
|
|
56
|
-
width?: string | number;
|
|
57
|
-
height?: string | number;
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
export type PublisherStyle = WidgetStyle & {
|
|
61
|
-
archiveStatusDisplayMode: 'auto' | 'off';
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
export type GetUserMediaProperties = {
|
|
65
|
-
audioSource?: string | null | boolean | MediaStreamTrack;
|
|
66
|
-
disableAudioProcessing?: boolean;
|
|
67
|
-
echoCancellation?: boolean;
|
|
68
|
-
noiseSuppression?: boolean;
|
|
69
|
-
autoGainControl?: boolean;
|
|
70
|
-
facingMode?: 'user' | 'environment' | 'left' | 'right';
|
|
71
|
-
frameRate?: 30 | 15 | 7 | 1;
|
|
72
|
-
maxResolution?: Dimensions;
|
|
73
|
-
resolution?: (
|
|
74
|
-
'1280x960' |
|
|
75
|
-
'1280x720' |
|
|
76
|
-
'640x480' |
|
|
77
|
-
'640x360' |
|
|
78
|
-
'320x240' |
|
|
79
|
-
'320x180'
|
|
80
|
-
);
|
|
81
|
-
videoSource?: string | null | boolean | MediaStreamTrack;
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
export type PublisherProperties = WidgetProperties & GetUserMediaProperties & {
|
|
85
|
-
audioBitrate?: number;
|
|
86
|
-
audioFallbackEnabled?: boolean;
|
|
87
|
-
mirror?: boolean;
|
|
88
|
-
name?: string;
|
|
89
|
-
publishAudio?: boolean;
|
|
90
|
-
publishVideo?: boolean;
|
|
91
|
-
style?: Partial<PublisherStyle>;
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
export type SubscriberStyle = WidgetStyle & {
|
|
95
|
-
videoDisabledDisplayMode: 'auto' | 'on' | 'off';
|
|
96
|
-
audioBlockedDisplayMode: 'auto' | 'on' | 'off';
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
export type SubscriberProperties = WidgetProperties & {
|
|
100
|
-
audioVolume?: number;
|
|
101
|
-
preferredFrameRate?: number;
|
|
102
|
-
preferredResolution?: Dimensions;
|
|
103
|
-
style?: Partial<SubscriberStyle>;
|
|
104
|
-
subscribeToAudio?: boolean;
|
|
105
|
-
subscribeToVideo?: boolean;
|
|
106
|
-
testNetwork?: boolean;
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
export class Connection {
|
|
110
|
-
connectionId: string;
|
|
111
|
-
creationTime: number;
|
|
112
|
-
data: string;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
export class Stream {
|
|
116
|
-
connection: Connection;
|
|
117
|
-
creationTime: number;
|
|
118
|
-
frameRate: number;
|
|
119
|
-
hasAudio: boolean;
|
|
120
|
-
hasVideo: boolean;
|
|
121
|
-
name: string;
|
|
122
|
-
streamId: string;
|
|
123
|
-
videoDimensions: {
|
|
124
|
-
width: number;
|
|
125
|
-
height: number;
|
|
6
|
+
|
|
7
|
+
export type Dimensions = {
|
|
8
|
+
width: number;
|
|
9
|
+
height: number;
|
|
126
10
|
};
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
export type ExceptionEvent = Event<'exception', {}> & {
|
|
140
|
-
code: number;
|
|
141
|
-
message: string;
|
|
142
|
-
title: string;
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
export type VideoDimensionsChangedEvent<Target> = Event<'videoDimensionsChanged', Target> & {
|
|
146
|
-
oldValue: Dimensions;
|
|
147
|
-
newValue: Dimensions;
|
|
148
|
-
};
|
|
149
|
-
|
|
150
|
-
class OTEventEmitter<EventMap> {
|
|
151
|
-
on<EventName extends keyof EventMap>(
|
|
152
|
-
eventName: EventName,
|
|
153
|
-
callback: (event: EventMap[EventName]) => void,
|
|
154
|
-
context?: object
|
|
155
|
-
): void;
|
|
156
|
-
|
|
157
|
-
on(
|
|
158
|
-
eventName: string,
|
|
159
|
-
callback: (event: Event<string, any>) => void,
|
|
160
|
-
context?: object
|
|
161
|
-
): void;
|
|
162
|
-
|
|
163
|
-
on(
|
|
164
|
-
eventMap: object,
|
|
165
|
-
context?: object
|
|
166
|
-
): void;
|
|
167
|
-
|
|
168
|
-
once<EventName extends keyof EventMap>(
|
|
169
|
-
eventName: EventName,
|
|
170
|
-
callback: (event: EventMap[EventName]) => void,
|
|
171
|
-
context?: object
|
|
172
|
-
): void;
|
|
173
|
-
|
|
174
|
-
once(
|
|
175
|
-
eventName: string,
|
|
176
|
-
callback: (event: Event<string, any>) => void,
|
|
177
|
-
context?: object
|
|
178
|
-
): void;
|
|
179
|
-
|
|
180
|
-
once(
|
|
181
|
-
eventMap: object,
|
|
182
|
-
context?: object
|
|
183
|
-
): void;
|
|
184
|
-
|
|
185
|
-
off<EventName extends keyof EventMap>(
|
|
186
|
-
eventName?: EventName,
|
|
187
|
-
callback?: (event: EventMap[EventName]) => void,
|
|
188
|
-
context?: object
|
|
189
|
-
): void;
|
|
190
|
-
|
|
191
|
-
off(
|
|
192
|
-
eventName?: string,
|
|
193
|
-
callback?: (event: Event<string, any>) => void,
|
|
194
|
-
context?: object
|
|
195
|
-
): void;
|
|
196
|
-
|
|
197
|
-
off(
|
|
198
|
-
eventMap: object,
|
|
199
|
-
context?: object
|
|
200
|
-
): void;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
export class Publisher extends OTEventEmitter<{
|
|
204
|
-
accessAllowed: Event<'accessAllowed', Publisher>;
|
|
205
|
-
accessDenied: Event<'accessDenied', Publisher>;
|
|
206
|
-
accessDialogClosed: Event<'accessDialogClosed', Publisher>;
|
|
207
|
-
accessDialogOpened: Event<'accessDialogOpened', Publisher>;
|
|
208
|
-
|
|
209
|
-
audioLevelUpdated: Event<'audioLevelUpdated', Publisher> & {
|
|
210
|
-
audioLevel: number
|
|
11
|
+
|
|
12
|
+
export type ScreenSharingCapabilityResponse = {
|
|
13
|
+
extensionInstalled?: boolean;
|
|
14
|
+
supported: boolean;
|
|
15
|
+
supportedSources: {
|
|
16
|
+
application?: boolean;
|
|
17
|
+
screen?: boolean;
|
|
18
|
+
window?: boolean;
|
|
19
|
+
};
|
|
20
|
+
extensionRequired?: string;
|
|
21
|
+
extensionRegistered?: boolean;
|
|
211
22
|
};
|
|
212
23
|
|
|
213
|
-
|
|
24
|
+
export function checkScreenSharingCapability(callback: (response: ScreenSharingCapabilityResponse) => void): void;
|
|
214
25
|
|
|
215
|
-
|
|
216
|
-
track: MediaStreamTrack | undefined
|
|
217
|
-
};
|
|
26
|
+
export function checkSystemRequirements(): number;
|
|
218
27
|
|
|
219
|
-
|
|
220
|
-
|
|
28
|
+
export type Device = {
|
|
29
|
+
kind: 'audioInput' | 'videoInput';
|
|
30
|
+
deviceId: string;
|
|
31
|
+
label: string;
|
|
221
32
|
};
|
|
222
33
|
|
|
223
|
-
|
|
224
|
-
stream: Stream;
|
|
225
|
-
reason: string;
|
|
226
|
-
};
|
|
34
|
+
export function getDevices(callback: (error: OTError | undefined, devices?: Device[]) => void): void;
|
|
227
35
|
|
|
228
|
-
|
|
36
|
+
export function setProxyUrl(proxyUrl: string): void;
|
|
229
37
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
destroy(): void;
|
|
241
|
-
getImgData(): string | null;
|
|
242
|
-
getStats(callback: (error?: OTError, stats?: PublisherStatsArr) => void): void;
|
|
243
|
-
getRtcStatsReport(): Promise<PublisherRtcStatsReportArr>;
|
|
244
|
-
getStyle(): PublisherProperties;
|
|
245
|
-
publishAudio(value: boolean): void;
|
|
246
|
-
publishVideo(value: boolean): void;
|
|
247
|
-
cycleVideo(): Promise<{ deviceId: string }>;
|
|
248
|
-
setAudioSource(audioSource:string | MediaStreamTrack): Promise<undefined>;
|
|
249
|
-
getAudioSource(): MediaStreamTrack;
|
|
250
|
-
setVideoSource(videoSourceId: string): Promise<undefined>;
|
|
251
|
-
getVideoSource(): {deviceId: string | null, type: string | null, track: MediaStreamTrack | null};
|
|
252
|
-
setStyle<Style extends keyof PublisherStyle>(style: Style, value: PublisherStyle[Style]): void;
|
|
253
|
-
videoWidth(): number | undefined;
|
|
254
|
-
videoHeight(): number | undefined;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
export function getUserMedia(
|
|
258
|
-
properties?: GetUserMediaProperties
|
|
259
|
-
): Promise<MediaStream>;
|
|
260
|
-
|
|
261
|
-
export function initPublisher(
|
|
262
|
-
targetElement?: HTMLElement | string,
|
|
263
|
-
properties?: PublisherProperties,
|
|
264
|
-
callback?: (error?: OTError) => void
|
|
265
|
-
): Publisher;
|
|
266
|
-
|
|
267
|
-
export function log(message: string): void;
|
|
268
|
-
|
|
269
|
-
export function off(
|
|
270
|
-
eventName?: 'exception',
|
|
271
|
-
callback?: (event: ExceptionEvent) => void,
|
|
272
|
-
context?: object
|
|
273
|
-
): void;
|
|
274
|
-
|
|
275
|
-
export function on(
|
|
276
|
-
eventName: 'exception',
|
|
277
|
-
callback: (event: ExceptionEvent) => void,
|
|
278
|
-
context?: object
|
|
279
|
-
): void;
|
|
280
|
-
|
|
281
|
-
export function once(
|
|
282
|
-
eventName: 'exception',
|
|
283
|
-
callback: (event: ExceptionEvent) => void,
|
|
284
|
-
context?: object
|
|
285
|
-
): void;
|
|
286
|
-
|
|
287
|
-
export class Session extends OTEventEmitter<{
|
|
288
|
-
archiveStarted: Event<'archiveStarted', Session> & {
|
|
289
|
-
id: string;
|
|
290
|
-
name: string;
|
|
38
|
+
export function getSupportedCodecs(): Promise<{
|
|
39
|
+
videoEncoders: ('H264' | 'VP8')[];
|
|
40
|
+
videoDecoders: ('H264' | 'VP8')[];
|
|
41
|
+
}>;
|
|
42
|
+
|
|
43
|
+
export type WidgetStyle = {
|
|
44
|
+
audioLevelDisplayMode: 'auto' | 'on' | 'off';
|
|
45
|
+
backgroundImageURI: string;
|
|
46
|
+
buttonDisplayMode: 'auto' | 'on' | 'off';
|
|
47
|
+
nameDisplayMode: 'auto' | 'on' | 'off';
|
|
291
48
|
};
|
|
292
49
|
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
50
|
+
export type WidgetProperties = {
|
|
51
|
+
fitMode?: 'cover' | 'contain';
|
|
52
|
+
insertDefaultUI?: boolean;
|
|
53
|
+
insertMode?: 'replace' | 'after' | 'before' | 'append';
|
|
54
|
+
showControls?: boolean;
|
|
55
|
+
width?: string | number;
|
|
56
|
+
height?: string | number;
|
|
296
57
|
};
|
|
297
58
|
|
|
298
|
-
|
|
299
|
-
|
|
59
|
+
export type PublisherStyle = WidgetStyle & {
|
|
60
|
+
archiveStatusDisplayMode: 'auto' | 'off';
|
|
300
61
|
};
|
|
301
62
|
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
63
|
+
export type GetUserMediaProperties = {
|
|
64
|
+
audioSource?: string | null | boolean | MediaStreamTrack;
|
|
65
|
+
disableAudioProcessing?: boolean;
|
|
66
|
+
echoCancellation?: boolean;
|
|
67
|
+
noiseSuppression?: boolean;
|
|
68
|
+
autoGainControl?: boolean;
|
|
69
|
+
facingMode?: 'user' | 'environment' | 'left' | 'right';
|
|
70
|
+
frameRate?: 30 | 15 | 7 | 1;
|
|
71
|
+
maxResolution?: Dimensions;
|
|
72
|
+
resolution?: '1280x960' | '1280x720' | '640x480' | '640x360' | '320x240' | '320x180';
|
|
73
|
+
videoSource?: string | null | boolean | MediaStreamTrack;
|
|
305
74
|
};
|
|
306
75
|
|
|
307
|
-
|
|
76
|
+
export type PublisherProperties = WidgetProperties &
|
|
77
|
+
GetUserMediaProperties & {
|
|
78
|
+
audioBitrate?: number;
|
|
79
|
+
audioFallbackEnabled?: boolean;
|
|
80
|
+
mirror?: boolean;
|
|
81
|
+
name?: string;
|
|
82
|
+
publishAudio?: boolean;
|
|
83
|
+
publishVideo?: boolean;
|
|
84
|
+
style?: Partial<PublisherStyle>;
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
export type SubscriberStyle = WidgetStyle & {
|
|
88
|
+
videoDisabledDisplayMode: 'auto' | 'on' | 'off';
|
|
89
|
+
audioBlockedDisplayMode: 'auto' | 'on' | 'off';
|
|
90
|
+
};
|
|
308
91
|
|
|
309
|
-
|
|
310
|
-
|
|
92
|
+
export type SubscriberProperties = WidgetProperties & {
|
|
93
|
+
audioVolume?: number;
|
|
94
|
+
preferredFrameRate?: number;
|
|
95
|
+
preferredResolution?: Dimensions;
|
|
96
|
+
style?: Partial<SubscriberStyle>;
|
|
97
|
+
subscribeToAudio?: boolean;
|
|
98
|
+
subscribeToVideo?: boolean;
|
|
99
|
+
testNetwork?: boolean;
|
|
311
100
|
};
|
|
312
101
|
|
|
313
|
-
|
|
314
|
-
|
|
102
|
+
export class Connection {
|
|
103
|
+
connectionId: string;
|
|
104
|
+
creationTime: number;
|
|
105
|
+
data: string;
|
|
106
|
+
}
|
|
315
107
|
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
108
|
+
export class Stream {
|
|
109
|
+
connection: Connection;
|
|
110
|
+
creationTime: number;
|
|
111
|
+
frameRate: number;
|
|
112
|
+
hasAudio: boolean;
|
|
113
|
+
hasVideo: boolean;
|
|
114
|
+
name: string;
|
|
115
|
+
streamId: string;
|
|
116
|
+
videoDimensions: {
|
|
117
|
+
width: number;
|
|
118
|
+
height: number;
|
|
119
|
+
};
|
|
120
|
+
videoType: 'camera' | 'screen';
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export type Event<Type, Target> = {
|
|
124
|
+
type: Type;
|
|
125
|
+
cancelable: boolean;
|
|
126
|
+
target: Target;
|
|
321
127
|
|
|
322
|
-
|
|
323
|
-
|
|
128
|
+
isDefaultPrevented(): boolean;
|
|
129
|
+
preventDefault(): void;
|
|
324
130
|
};
|
|
325
131
|
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
132
|
+
export type ExceptionEvent = Event<'exception', {}> & {
|
|
133
|
+
code: number;
|
|
134
|
+
message: string;
|
|
135
|
+
title: string;
|
|
329
136
|
};
|
|
330
137
|
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
} & (
|
|
335
|
-
{ changedProperty: 'hasAudio'; oldValue: boolean; newValue: boolean; } |
|
|
336
|
-
{ changedProperty: 'hasVideo'; oldValue: boolean; newValue: boolean; } |
|
|
337
|
-
{ changedProperty: 'videoDimensions'; oldValue: Dimensions; newValue: Dimensions; }
|
|
338
|
-
)
|
|
339
|
-
);
|
|
340
|
-
}> {
|
|
341
|
-
capabilities: {
|
|
342
|
-
forceDisconnect: number;
|
|
343
|
-
forceUnpublish: number;
|
|
344
|
-
publish: number;
|
|
345
|
-
subscribe: number;
|
|
138
|
+
export type VideoDimensionsChangedEvent<Target> = Event<'videoDimensionsChanged', Target> & {
|
|
139
|
+
oldValue: Dimensions;
|
|
140
|
+
newValue: Dimensions;
|
|
346
141
|
};
|
|
347
142
|
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
|
|
143
|
+
class OTEventEmitter<EventMap> {
|
|
144
|
+
on<EventName extends keyof EventMap>(
|
|
145
|
+
eventName: EventName,
|
|
146
|
+
callback: (event: EventMap[EventName]) => void,
|
|
147
|
+
context?: object
|
|
148
|
+
): void;
|
|
149
|
+
|
|
150
|
+
on(eventName: string, callback: (event: Event<string, any>) => void, context?: object): void;
|
|
151
|
+
|
|
152
|
+
on(eventMap: object, context?: object): void;
|
|
153
|
+
|
|
154
|
+
once<EventName extends keyof EventMap>(
|
|
155
|
+
eventName: EventName,
|
|
156
|
+
callback: (event: EventMap[EventName]) => void,
|
|
157
|
+
context?: object
|
|
158
|
+
): void;
|
|
159
|
+
|
|
160
|
+
once(eventName: string, callback: (event: Event<string, any>) => void, context?: object): void;
|
|
161
|
+
|
|
162
|
+
once(eventMap: object, context?: object): void;
|
|
163
|
+
|
|
164
|
+
off<EventName extends keyof EventMap>(
|
|
165
|
+
eventName?: EventName,
|
|
166
|
+
callback?: (event: EventMap[EventName]) => void,
|
|
167
|
+
context?: object
|
|
168
|
+
): void;
|
|
169
|
+
|
|
170
|
+
off(eventName?: string, callback?: (event: Event<string, any>) => void, context?: object): void;
|
|
171
|
+
|
|
172
|
+
off(eventMap: object, context?: object): void;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
export class Publisher extends OTEventEmitter<{
|
|
176
|
+
accessAllowed: Event<'accessAllowed', Publisher>;
|
|
177
|
+
accessDenied: Event<'accessDenied', Publisher>;
|
|
178
|
+
accessDialogClosed: Event<'accessDialogClosed', Publisher>;
|
|
179
|
+
accessDialogOpened: Event<'accessDialogOpened', Publisher>;
|
|
180
|
+
|
|
181
|
+
audioLevelUpdated: Event<'audioLevelUpdated', Publisher> & {
|
|
182
|
+
audioLevel: number;
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
destroyed: Event<'destroyed', Publisher>;
|
|
186
|
+
|
|
187
|
+
mediaStopped: Event<'mediaStopped', Publisher> & {
|
|
188
|
+
track: MediaStreamTrack | undefined;
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
streamCreated: Event<'streamCreated', Publisher> & {
|
|
192
|
+
stream: Stream;
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
streamDestroyed: Event<'streamDestroyed', Publisher> & {
|
|
196
|
+
stream: Stream;
|
|
197
|
+
reason: string;
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
videoDimensionsChanged: VideoDimensionsChangedEvent<Publisher>;
|
|
201
|
+
|
|
202
|
+
videoElementCreated: Event<'videoElementCreated', Publisher> & {
|
|
203
|
+
element: HTMLVideoElement | HTMLObjectElement;
|
|
204
|
+
};
|
|
205
|
+
}> {
|
|
206
|
+
accessAllowed: boolean;
|
|
207
|
+
element?: HTMLElement | undefined;
|
|
208
|
+
id?: string;
|
|
209
|
+
stream?: Stream;
|
|
210
|
+
session?: Session;
|
|
211
|
+
|
|
212
|
+
destroy(): void;
|
|
213
|
+
getImgData(): string | null;
|
|
214
|
+
getStats(callback: (error?: OTError, stats?: PublisherStatsArr) => void): void;
|
|
215
|
+
getRtcStatsReport(): Promise<PublisherRtcStatsReportArr>;
|
|
216
|
+
getStyle(): PublisherProperties;
|
|
217
|
+
publishAudio(value: boolean): void;
|
|
218
|
+
publishVideo(value: boolean): void;
|
|
219
|
+
cycleVideo(): Promise<{deviceId: string}>;
|
|
220
|
+
setAudioSource(audioSource: string | MediaStreamTrack): Promise<undefined>;
|
|
221
|
+
getAudioSource(): MediaStreamTrack;
|
|
222
|
+
setVideoSource(videoSourceId: string): Promise<undefined>;
|
|
223
|
+
getVideoSource(): {deviceId: string | null; type: string | null; track: MediaStreamTrack | null};
|
|
224
|
+
setStyle<Style extends keyof PublisherStyle>(style: Style, value: PublisherStyle[Style]): void;
|
|
225
|
+
videoWidth(): number | undefined;
|
|
226
|
+
videoHeight(): number | undefined;
|
|
391
227
|
}
|
|
392
|
-
): Session;
|
|
393
|
-
|
|
394
|
-
export type IncomingTrackStats = {
|
|
395
|
-
bytesReceived: number;
|
|
396
|
-
packetsLost: number;
|
|
397
|
-
packetsReceived: number;
|
|
398
|
-
};
|
|
399
|
-
|
|
400
|
-
export type OutgoingTrackStats = {
|
|
401
|
-
bytesSent: number;
|
|
402
|
-
packetsLost: number;
|
|
403
|
-
packetsSent: number;
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
export type SubscriberStats = {
|
|
407
|
-
audio: IncomingTrackStats;
|
|
408
|
-
video: IncomingTrackStats & { frameRate: number; };
|
|
409
|
-
timestamp: number;
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
export type PublisherStats = {
|
|
413
|
-
audio: OutgoingTrackStats;
|
|
414
|
-
video: OutgoingTrackStats & { frameRate: number; };
|
|
415
|
-
timestamp: number;
|
|
416
|
-
}
|
|
417
|
-
|
|
418
|
-
export type PublisherStatContainer = {
|
|
419
|
-
subscriberId?: string,
|
|
420
|
-
connectionId?: string,
|
|
421
|
-
stats: PublisherStats
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
export type PublisherStatsArr = PublisherStatContainer[];
|
|
425
|
-
|
|
426
|
-
export type PublisherRtcStatsReportContainer = {
|
|
427
|
-
subscriberId?: string,
|
|
428
|
-
connectionId?: string,
|
|
429
|
-
rtcStatsReport: RTCStatsReport
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
export type PublisherRtcStatsReportArr = PublisherRtcStatsReportContainer[];
|
|
433
|
-
|
|
434
|
-
export class Subscriber extends OTEventEmitter<{
|
|
435
|
-
audioLevelUpdated: Event<'audioLevelUpdated', Subscriber> & {
|
|
436
|
-
audioLevel: number
|
|
437
|
-
};
|
|
438
228
|
|
|
439
|
-
|
|
229
|
+
export function getUserMedia(properties?: GetUserMediaProperties): Promise<MediaStream>;
|
|
230
|
+
|
|
231
|
+
export function initPublisher(
|
|
232
|
+
targetElement?: HTMLElement | string,
|
|
233
|
+
properties?: PublisherProperties,
|
|
234
|
+
callback?: (error?: OTError) => void
|
|
235
|
+
): Publisher;
|
|
236
|
+
|
|
237
|
+
export function log(message: string): void;
|
|
238
|
+
|
|
239
|
+
export function off(eventName?: 'exception', callback?: (event: ExceptionEvent) => void, context?: object): void;
|
|
240
|
+
|
|
241
|
+
export function on(eventName: 'exception', callback: (event: ExceptionEvent) => void, context?: object): void;
|
|
242
|
+
|
|
243
|
+
export function once(eventName: 'exception', callback: (event: ExceptionEvent) => void, context?: object): void;
|
|
244
|
+
|
|
245
|
+
export class Session extends OTEventEmitter<{
|
|
246
|
+
archiveStarted: Event<'archiveStarted', Session> & {
|
|
247
|
+
id: string;
|
|
248
|
+
name: string;
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
archiveStopped: Event<'archiveStopped', Session> & {
|
|
252
|
+
id: string;
|
|
253
|
+
name: string;
|
|
254
|
+
};
|
|
255
|
+
|
|
256
|
+
connectionCreated: Event<'connectionCreated', Session> & {
|
|
257
|
+
connection: Connection;
|
|
258
|
+
};
|
|
259
|
+
|
|
260
|
+
connectionDestroyed: Event<'connectionDestroyed', Session> & {
|
|
261
|
+
connection: Connection;
|
|
262
|
+
reason: string;
|
|
263
|
+
};
|
|
264
|
+
|
|
265
|
+
sessionConnected: Event<'sessionConnected', Session>;
|
|
266
|
+
|
|
267
|
+
sessionDisconnected: Event<'sessionDisconnected', Session> & {
|
|
268
|
+
reason: string;
|
|
269
|
+
};
|
|
270
|
+
|
|
271
|
+
sessionReconnected: Event<'sessionReconnected', Session>;
|
|
272
|
+
sessionReconnecting: Event<'sessionReconnecting', Session>;
|
|
273
|
+
|
|
274
|
+
signal: Event<'signal', Session> & {
|
|
275
|
+
type?: string;
|
|
276
|
+
data?: string;
|
|
277
|
+
from: Connection;
|
|
278
|
+
};
|
|
279
|
+
|
|
280
|
+
streamCreated: Event<'streamCreated', Session> & {
|
|
281
|
+
stream: Stream;
|
|
282
|
+
};
|
|
283
|
+
|
|
284
|
+
streamDestroyed: Event<'streamDestroyed', Session> & {
|
|
285
|
+
stream: Stream;
|
|
286
|
+
reason: string;
|
|
287
|
+
};
|
|
288
|
+
|
|
289
|
+
streamPropertyChanged: Event<'streamPropertyChanged', Session> & {
|
|
290
|
+
stream: Stream;
|
|
291
|
+
} & (
|
|
292
|
+
| {changedProperty: 'hasAudio'; oldValue: boolean; newValue: boolean}
|
|
293
|
+
| {changedProperty: 'hasVideo'; oldValue: boolean; newValue: boolean}
|
|
294
|
+
| {changedProperty: 'videoDimensions'; oldValue: Dimensions; newValue: Dimensions}
|
|
295
|
+
);
|
|
296
|
+
}> {
|
|
297
|
+
capabilities: {
|
|
298
|
+
forceDisconnect: number;
|
|
299
|
+
forceUnpublish: number;
|
|
300
|
+
publish: number;
|
|
301
|
+
subscribe: number;
|
|
302
|
+
};
|
|
303
|
+
|
|
304
|
+
connection?: Connection;
|
|
305
|
+
sessionId: string;
|
|
306
|
+
|
|
307
|
+
connect(token: string, callback: (error?: OTError) => void): void;
|
|
308
|
+
disconnect(): void;
|
|
309
|
+
forceDisconnect(connection: Connection, callback: (error?: OTError) => void): void;
|
|
310
|
+
forceUnpublish(stream: Stream, callback: (error?: OTError) => void): void;
|
|
311
|
+
getPublisherForStream(stream: Stream): Publisher | undefined;
|
|
312
|
+
getSubscribersForStream(stream: Stream): [Subscriber];
|
|
313
|
+
publish(publisher: Publisher, callback?: (error?: OTError) => void): Publisher;
|
|
314
|
+
publish(
|
|
315
|
+
targetElement: string | HTMLElement,
|
|
316
|
+
properties?: PublisherProperties,
|
|
317
|
+
callback?: (error?: OTError) => void
|
|
318
|
+
): Publisher;
|
|
319
|
+
|
|
320
|
+
signal(signal: {type?: string; data?: string; to?: Connection}, callback: (error?: OTError) => void): void;
|
|
321
|
+
|
|
322
|
+
subscribe(
|
|
323
|
+
stream: Stream,
|
|
324
|
+
targetElement?: HTMLElement | string,
|
|
325
|
+
properties?: SubscriberProperties,
|
|
326
|
+
callback?: (error?: OTError) => void
|
|
327
|
+
): Subscriber;
|
|
328
|
+
|
|
329
|
+
unpublish(publisher: Publisher): void;
|
|
330
|
+
unsubscribe(subscriber: Subscriber): void;
|
|
331
|
+
}
|
|
440
332
|
|
|
441
|
-
|
|
442
|
-
|
|
333
|
+
export function initSession(
|
|
334
|
+
partnerId: string,
|
|
335
|
+
sessionId: string,
|
|
336
|
+
options?: {
|
|
337
|
+
connectionEventsSuppressed?: boolean;
|
|
338
|
+
iceConfig?: {
|
|
339
|
+
includeServers: 'all' | 'custom';
|
|
340
|
+
transportPolicy: 'all' | 'relay';
|
|
341
|
+
customServers: {
|
|
342
|
+
urls: string | string[];
|
|
343
|
+
username?: string;
|
|
344
|
+
credential?: string;
|
|
345
|
+
}[];
|
|
346
|
+
};
|
|
347
|
+
ipWhitelist?: boolean;
|
|
348
|
+
}
|
|
349
|
+
): Session;
|
|
350
|
+
|
|
351
|
+
export type IncomingTrackStats = {
|
|
352
|
+
bytesReceived: number;
|
|
353
|
+
packetsLost: number;
|
|
354
|
+
packetsReceived: number;
|
|
443
355
|
};
|
|
444
356
|
|
|
445
|
-
|
|
357
|
+
export type OutgoingTrackStats = {
|
|
358
|
+
bytesSent: number;
|
|
359
|
+
packetsLost: number;
|
|
360
|
+
packetsSent: number;
|
|
361
|
+
};
|
|
446
362
|
|
|
447
|
-
|
|
448
|
-
|
|
363
|
+
export type SubscriberStats = {
|
|
364
|
+
audio: IncomingTrackStats;
|
|
365
|
+
video: IncomingTrackStats & {frameRate: number};
|
|
366
|
+
timestamp: number;
|
|
449
367
|
};
|
|
450
368
|
|
|
451
|
-
|
|
452
|
-
|
|
369
|
+
export type PublisherStats = {
|
|
370
|
+
audio: OutgoingTrackStats;
|
|
371
|
+
video: OutgoingTrackStats & {frameRate: number};
|
|
372
|
+
timestamp: number;
|
|
373
|
+
};
|
|
453
374
|
|
|
454
|
-
|
|
455
|
-
|
|
375
|
+
export type PublisherStatContainer = {
|
|
376
|
+
subscriberId?: string;
|
|
377
|
+
connectionId?: string;
|
|
378
|
+
stats: PublisherStats;
|
|
456
379
|
};
|
|
457
380
|
|
|
458
|
-
|
|
459
|
-
|
|
381
|
+
export type PublisherStatsArr = PublisherStatContainer[];
|
|
382
|
+
|
|
383
|
+
export type PublisherRtcStatsReportContainer = {
|
|
384
|
+
subscriberId?: string;
|
|
385
|
+
connectionId?: string;
|
|
386
|
+
rtcStatsReport: RTCStatsReport;
|
|
460
387
|
};
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
388
|
+
|
|
389
|
+
export type PublisherRtcStatsReportArr = PublisherRtcStatsReportContainer[];
|
|
390
|
+
|
|
391
|
+
export class Subscriber extends OTEventEmitter<{
|
|
392
|
+
audioLevelUpdated: Event<'audioLevelUpdated', Subscriber> & {
|
|
393
|
+
audioLevel: number;
|
|
394
|
+
};
|
|
395
|
+
|
|
396
|
+
connected: Event<'connected', Subscriber>;
|
|
397
|
+
|
|
398
|
+
destroyed: Event<'destroyed', Subscriber> & {
|
|
399
|
+
reason: string;
|
|
400
|
+
};
|
|
401
|
+
|
|
402
|
+
videoDimensionsChanged: VideoDimensionsChangedEvent<Subscriber>;
|
|
403
|
+
|
|
404
|
+
videoDisabled: Event<'videoDisabled', Subscriber> & {
|
|
405
|
+
reason: string;
|
|
406
|
+
};
|
|
407
|
+
|
|
408
|
+
videoDisableWarning: Event<'videoDisableWarning', Subscriber>;
|
|
409
|
+
videoDisableWarningLifted: Event<'videoDisableWarningLifted', Subscriber>;
|
|
410
|
+
|
|
411
|
+
videoElementCreated: Event<'videoElementCreated', Subscriber> & {
|
|
412
|
+
element: HTMLVideoElement | HTMLObjectElement;
|
|
413
|
+
};
|
|
414
|
+
|
|
415
|
+
videoEnabled: Event<'videoEnabled', Subscriber> & {
|
|
416
|
+
reason: string;
|
|
417
|
+
};
|
|
418
|
+
}> {
|
|
419
|
+
element?: HTMLElement;
|
|
420
|
+
id?: string;
|
|
421
|
+
stream?: Stream;
|
|
422
|
+
|
|
423
|
+
getAudioVolume(): number;
|
|
424
|
+
getImgData(): string | null;
|
|
425
|
+
getStats(callback: (error?: OTError, stats?: SubscriberStats) => void): void;
|
|
426
|
+
getRtcStatsReport(): Promise<RTCStatsReport>;
|
|
427
|
+
restrictFrameRate(value: boolean): void;
|
|
428
|
+
setAudioVolume(volume: number): void;
|
|
429
|
+
setPreferredFrameRate(frameRate: number): void;
|
|
430
|
+
setPreferredResolution(resolution: Dimensions): void;
|
|
431
|
+
subscribeToAudio(value: boolean): void;
|
|
432
|
+
subscribeToVideo(value: boolean): void;
|
|
433
|
+
|
|
434
|
+
setStyle<Style extends keyof SubscriberStyle>(style: Style, value: SubscriberStyle[Style]): void;
|
|
435
|
+
|
|
436
|
+
videoHeight(): number | undefined;
|
|
437
|
+
videoWidth(): number | undefined;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
export function registerScreenSharingExtension(kind: string, id: string, version: number): void;
|
|
441
|
+
|
|
442
|
+
export function reportIssue(callback: (error?: OTError, reportId?: string) => void): void;
|
|
443
|
+
|
|
444
|
+
export function setLogLevel(level: number): void;
|
|
445
|
+
|
|
446
|
+
export function upgradeSystemRequirements(): void;
|
|
447
|
+
|
|
448
|
+
export function unblockAudio(): Promise<undefined>;
|
|
499
449
|
}
|
|
500
450
|
|
|
501
451
|
declare module '@opentok/client' {
|
|
502
|
-
|
|
452
|
+
export = OT;
|
|
503
453
|
}
|