@xylink/xy-rtc-sdk 2.1.1 → 2.1.2-beta.7
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/lib/index.es.js +3 -1
- package/lib/index.js +3 -1
- package/lib/src/action/index.d.ts +130 -8
- package/lib/src/enum/contraints.d.ts +2 -104
- package/lib/src/enum/index.d.ts +84 -0
- package/lib/src/index.d.ts +2 -2
- package/lib/src/main/client.d.ts +114 -30
- package/lib/src/main/deviceManager.d.ts +2 -2
- package/lib/src/main/helper.d.ts +5 -5
- package/lib/src/main/layoutManager.d.ts +2 -2
- package/lib/src/main/peer.d.ts +11 -2
- package/lib/src/main/qualityManager.d.ts +39 -0
- package/lib/src/main/stream.d.ts +4 -4
- package/lib/src/main/videoManager.d.ts +4 -4
- package/lib/src/tools/browser.d.ts +2 -2
- package/lib/src/tools/config.d.ts +1 -1
- package/lib/src/tools/db.d.ts +55 -3
- package/lib/src/tools/httpClient.d.ts +6 -6
- package/lib/src/tools/logger.d.ts +1 -2
- package/lib/src/tools/socket.d.ts +1 -1
- package/lib/src/tools/utils.d.ts +2 -2
- package/lib/src/type/base.d.ts +2 -1
- package/lib/src/type/client.d.ts +171 -48
- package/lib/src/type/device.d.ts +2 -2
- package/lib/src/type/index.d.ts +1 -1
- package/lib/src/type/quality.d.ts +77 -0
- package/lib/src/type/stream.d.ts +48 -3
- package/package.json +1 -1
package/lib/src/main/client.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @authors Luo-jinghui (luojinghui424@gmail.com)
|
|
5
5
|
* @date 2019-10-23 12:04:44
|
|
6
6
|
*/
|
|
7
|
-
import { IClientConfig, IMackCall, IInvite, IRoster, ILayoutRoster, ISpeakerInfo, IScreenInfo, IServers, ILoginExtAccount, IPublishParams, ICustomLayout, ICustomStreamTrack, IInternels, IVideoAudioType, IShareContentStatus, IPushType, IMode, IReqInfo, TCommand, ILayout, IConference, IContentMode, IToken, AutoMute } from '../type';
|
|
7
|
+
import { IClientConfig, IMackCall, IInvite, IRoster, ILayoutRoster, ISpeakerInfo, IScreenInfo, IServers, ILoginExtAccount, IPublishParams, ICustomLayout, ICustomStreamTrack, IInternels, IVideoAudioType, IShareContentStatus, IPushType, IMode, IReqInfo, TCommand, ILayout, IConference, IConferenceInfo, IContentMode, IToken, AutoMute, Key, IRecordPermission, TLocalLanguage } from '../type';
|
|
8
8
|
import Emmitter from '../tools/emmitter';
|
|
9
9
|
import Socket from '../tools/socket';
|
|
10
10
|
import Stream from './stream';
|
|
@@ -44,7 +44,6 @@ export default class Client extends Emmitter {
|
|
|
44
44
|
private servers;
|
|
45
45
|
private callInfo;
|
|
46
46
|
private stream;
|
|
47
|
-
private meetingControl;
|
|
48
47
|
private videoTrackList;
|
|
49
48
|
private audioTrackList;
|
|
50
49
|
private cacheMeetingControlMessage;
|
|
@@ -61,16 +60,18 @@ export default class Client extends Emmitter {
|
|
|
61
60
|
private autoSwitchDevice;
|
|
62
61
|
private audioManagers;
|
|
63
62
|
private errorcode;
|
|
63
|
+
private i18nCode;
|
|
64
64
|
private clientErrorState;
|
|
65
65
|
private limitResolution;
|
|
66
|
-
private reportDataTimer;
|
|
67
|
-
private reportDataFrequency;
|
|
68
|
-
private meetingQualityData;
|
|
69
66
|
private conferenceInfo;
|
|
70
67
|
private customLayoutCacheList;
|
|
71
68
|
private contentMode;
|
|
72
69
|
private contentOnholdInfo;
|
|
73
70
|
private isSubscribeBulkRoster;
|
|
71
|
+
private recordPermission;
|
|
72
|
+
private recordState;
|
|
73
|
+
private qualityManager;
|
|
74
|
+
private isShareContent;
|
|
74
75
|
private onDocumentChange;
|
|
75
76
|
constructor(config: IClientConfig, servers: IServers, logger: Logger);
|
|
76
77
|
static instance: Client;
|
|
@@ -93,6 +94,7 @@ export default class Client extends Emmitter {
|
|
|
93
94
|
total: ILayoutRoster[];
|
|
94
95
|
};
|
|
95
96
|
getOriginRosters(): IRoster[];
|
|
97
|
+
getConferenceInfo(): IConferenceInfo | null;
|
|
96
98
|
getInviteInfo(): IInvite;
|
|
97
99
|
getContentSenderPid(): number;
|
|
98
100
|
getSpeakerInfo(): ISpeakerInfo;
|
|
@@ -102,7 +104,18 @@ export default class Client extends Emmitter {
|
|
|
102
104
|
getOnHold(): boolean;
|
|
103
105
|
getAudioTrackList(): ICustomStreamTrack[];
|
|
104
106
|
getLayoutList(): Map<string, ILayout> | undefined;
|
|
107
|
+
/**
|
|
108
|
+
* 获取Local roster信息
|
|
109
|
+
*
|
|
110
|
+
* @returns { IRoster}
|
|
111
|
+
*/
|
|
105
112
|
getSelfRoster(): IRoster | undefined;
|
|
113
|
+
/**
|
|
114
|
+
* 获取本地是否在分享content
|
|
115
|
+
*
|
|
116
|
+
* @returns { boolean }
|
|
117
|
+
*/
|
|
118
|
+
getLocalShareContent(): boolean;
|
|
106
119
|
/**
|
|
107
120
|
* 小鱼账号初始登录,获取token方法
|
|
108
121
|
*
|
|
@@ -146,14 +159,14 @@ export default class Client extends Emmitter {
|
|
|
146
159
|
* 绑定streamId和video ele元素,内部维护状态
|
|
147
160
|
*
|
|
148
161
|
* @public
|
|
149
|
-
* @param { string } key
|
|
162
|
+
* @param { string } key endpointId + mediagroupId 唯一的用户id值
|
|
150
163
|
* @param { string } wrapEle 包裹video组件的元素id,此元素一定要提供宽高信息,内部会基于此宽高信息计算video的旋转信息
|
|
151
164
|
*/
|
|
152
165
|
setVideoRenderer(key: string, wrapEleId: string): void;
|
|
153
166
|
/**
|
|
154
167
|
* 移除绑定的streamId
|
|
155
168
|
*
|
|
156
|
-
* @param { string } key
|
|
169
|
+
* @param { string } key endpointId + mediagroupId 唯一的用户id值
|
|
157
170
|
* @param { string } wrapEle 包裹video组件的元素id,此元素一定要提供宽高信息,内部会基于此宽高信息计算video的旋转信息
|
|
158
171
|
*/
|
|
159
172
|
removeVideoRender(key: string, wrapEleId: string): void;
|
|
@@ -203,6 +216,18 @@ export default class Client extends Emmitter {
|
|
|
203
216
|
* @private
|
|
204
217
|
*/
|
|
205
218
|
private handleConferenceInfo;
|
|
219
|
+
/**
|
|
220
|
+
* 检查会议室录制权限
|
|
221
|
+
*
|
|
222
|
+
* @public
|
|
223
|
+
*/
|
|
224
|
+
checkPermissionWithMeetingNumber(): Promise<IRecordPermission>;
|
|
225
|
+
/**
|
|
226
|
+
* 录制存储空间检查
|
|
227
|
+
*
|
|
228
|
+
* @param { string } recordingUrl
|
|
229
|
+
*/
|
|
230
|
+
checkStorageSpaceWithRecordingUrl(recordingUrl: string): Promise<any>;
|
|
206
231
|
/**
|
|
207
232
|
* 处理wss返回的数据
|
|
208
233
|
*
|
|
@@ -255,7 +280,7 @@ export default class Client extends Emmitter {
|
|
|
255
280
|
* @public
|
|
256
281
|
* @param { Stream } stream 本地contentStream
|
|
257
282
|
*/
|
|
258
|
-
|
|
283
|
+
sendContentCapabilityMessage(stream?: Stream): void;
|
|
259
284
|
/**
|
|
260
285
|
* 分享content
|
|
261
286
|
*
|
|
@@ -305,20 +330,20 @@ export default class Client extends Emmitter {
|
|
|
305
330
|
autoMute: AutoMute;
|
|
306
331
|
}): Promise<IConference>;
|
|
307
332
|
/**
|
|
308
|
-
*
|
|
333
|
+
* 获取错误码/i18n等json链接
|
|
309
334
|
*
|
|
310
335
|
* @private
|
|
311
336
|
* @returns
|
|
312
337
|
*/
|
|
313
|
-
private
|
|
338
|
+
private getServerConfig;
|
|
314
339
|
/**
|
|
315
|
-
*
|
|
340
|
+
* 获取链接内容
|
|
316
341
|
*
|
|
317
|
-
* @
|
|
318
|
-
* @param
|
|
319
|
-
* @returns
|
|
342
|
+
* @param { string } configName 'errorcode' | 'i18n'
|
|
343
|
+
* @param data
|
|
344
|
+
* @returns
|
|
320
345
|
*/
|
|
321
|
-
private
|
|
346
|
+
private getCodeByJson;
|
|
322
347
|
/**
|
|
323
348
|
* 音视频开启关闭操作
|
|
324
349
|
*
|
|
@@ -509,12 +534,19 @@ export default class Client extends Emmitter {
|
|
|
509
534
|
requestAutoPollingLayout(command: TCommand, interval: number | undefined, reqList: IReqInfo[]): Promise<boolean>;
|
|
510
535
|
/**
|
|
511
536
|
* 应用替换已经更新的的people video track轨道流,如果之前无流,则需重新setStream, replaceTrack
|
|
537
|
+
* 第一次开启音频、或视频,需重新协商offer。改变通道方向
|
|
512
538
|
*
|
|
513
539
|
* @public
|
|
514
540
|
* @param { 'video' | 'audio' } kind 设备类型
|
|
515
541
|
* @param { boolean } isFirst 是否之前无流
|
|
516
542
|
*/
|
|
517
543
|
applyVideoOrAudio(kind: 'video' | 'audio', isFirst?: boolean): void;
|
|
544
|
+
/**
|
|
545
|
+
* 上报audio状态
|
|
546
|
+
*
|
|
547
|
+
* @param { boolean | string } status
|
|
548
|
+
*/
|
|
549
|
+
sendAudioStatus(status: boolean | string): void;
|
|
518
550
|
/**
|
|
519
551
|
* 发布layout数据
|
|
520
552
|
*
|
|
@@ -540,10 +572,10 @@ export default class Client extends Emmitter {
|
|
|
540
572
|
*/
|
|
541
573
|
sendCustomLayoutMessage(): void;
|
|
542
574
|
/**
|
|
543
|
-
* 发布Layout
|
|
575
|
+
* 发布Layout Container的容器信息
|
|
544
576
|
*
|
|
545
577
|
* @public
|
|
546
|
-
* @param { IScreenInfo } screenInfo Layout
|
|
578
|
+
* @param { IScreenInfo } screenInfo Layout Container的容器信息
|
|
547
579
|
*/
|
|
548
580
|
sendScreenInfoMessage(screenInfo: IScreenInfo): void;
|
|
549
581
|
/**
|
|
@@ -580,6 +612,20 @@ export default class Client extends Emmitter {
|
|
|
580
612
|
* @param { ICustomLayout[] } customLayout 计算得到的customLayout List数据
|
|
581
613
|
*/
|
|
582
614
|
sendCustomLayout(customLayout?: ICustomLayout[]): void;
|
|
615
|
+
/**
|
|
616
|
+
* 上报会议质量数据
|
|
617
|
+
*
|
|
618
|
+
* @public
|
|
619
|
+
* @param { IInternels } internels Internels统计数据
|
|
620
|
+
*/
|
|
621
|
+
reportQualityData(internels: IInternels): void;
|
|
622
|
+
/**
|
|
623
|
+
* Internels统计数据-期望带宽
|
|
624
|
+
*
|
|
625
|
+
* @param internels
|
|
626
|
+
* @returns
|
|
627
|
+
*/
|
|
628
|
+
private getInternels;
|
|
583
629
|
/**
|
|
584
630
|
* 发布Internels统计数据
|
|
585
631
|
*
|
|
@@ -653,9 +699,9 @@ export default class Client extends Emmitter {
|
|
|
653
699
|
/**
|
|
654
700
|
* 移除对应的AudioRender
|
|
655
701
|
*
|
|
656
|
-
* @param { string } key
|
|
702
|
+
* @param { string } key endpointId + mediagroupId 唯一的用户id值
|
|
657
703
|
*/
|
|
658
|
-
|
|
704
|
+
removeAudioRender(key: string): void;
|
|
659
705
|
/**
|
|
660
706
|
* 开始巡课
|
|
661
707
|
*
|
|
@@ -676,26 +722,64 @@ export default class Client extends Emmitter {
|
|
|
676
722
|
* @public
|
|
677
723
|
*/
|
|
678
724
|
subscribeBulkRoster(): Promise<unknown>;
|
|
679
|
-
reSendContentOffer(): void;
|
|
680
725
|
/**
|
|
681
|
-
*
|
|
726
|
+
* 开启同传字幕消息
|
|
682
727
|
*
|
|
683
|
-
* @
|
|
728
|
+
* @public
|
|
684
729
|
*/
|
|
685
|
-
|
|
730
|
+
startTranslation(): Promise<unknown>;
|
|
686
731
|
/**
|
|
687
|
-
*
|
|
732
|
+
* 停止同传字幕消息
|
|
688
733
|
*
|
|
689
|
-
* @
|
|
690
|
-
* @private
|
|
734
|
+
* @public
|
|
691
735
|
*/
|
|
692
|
-
|
|
736
|
+
stopTranslation(): Promise<unknown>;
|
|
693
737
|
/**
|
|
694
|
-
*
|
|
738
|
+
* 同传字幕: 设置本地说话的语言
|
|
695
739
|
*
|
|
696
|
-
* @
|
|
740
|
+
* @param { TLocalLanguage } language
|
|
741
|
+
* @returns
|
|
697
742
|
*/
|
|
698
|
-
|
|
743
|
+
setTranslationLanguage(language: TLocalLanguage): Promise<unknown>;
|
|
744
|
+
/**
|
|
745
|
+
* 开启云端录制
|
|
746
|
+
*
|
|
747
|
+
* @public
|
|
748
|
+
*/
|
|
749
|
+
startCloudRecord(): Promise<undefined>;
|
|
750
|
+
/**
|
|
751
|
+
* 停止录制
|
|
752
|
+
*
|
|
753
|
+
* @public
|
|
754
|
+
*/
|
|
755
|
+
stopCloudRecord(): Promise<undefined>;
|
|
756
|
+
/**
|
|
757
|
+
* 配置web节点接收带宽
|
|
758
|
+
*
|
|
759
|
+
* @public
|
|
760
|
+
*/
|
|
761
|
+
setWebRxBandwidth(): Promise<undefined>;
|
|
762
|
+
/**
|
|
763
|
+
* 重新发送content offer
|
|
764
|
+
*
|
|
765
|
+
* @public
|
|
766
|
+
*/
|
|
767
|
+
reSendContentOffer(): void;
|
|
768
|
+
startMonitorGroup(mediagrpIds: Key[]): true | {
|
|
769
|
+
code: string;
|
|
770
|
+
msg: string;
|
|
771
|
+
detail: any;
|
|
772
|
+
};
|
|
773
|
+
stopMonitorGroup(mediagrpIds: Key[]): true | {
|
|
774
|
+
code: string;
|
|
775
|
+
msg: string;
|
|
776
|
+
detail: any;
|
|
777
|
+
};
|
|
778
|
+
setMonitorGroup(type: 'start' | 'stop', mediagrpIds: Key[]): true | {
|
|
779
|
+
code: string;
|
|
780
|
+
msg: string;
|
|
781
|
+
detail: any;
|
|
782
|
+
};
|
|
699
783
|
/**
|
|
700
784
|
* 初始化DeviceManager事件
|
|
701
785
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @author jinghui-luo、chengfei
|
|
7
7
|
*
|
|
8
8
|
* Created at : 2020-11-26 14:41:51
|
|
9
|
-
* Last modified :
|
|
9
|
+
* Last modified : 2022-06-09 17:33:47
|
|
10
10
|
*/
|
|
11
11
|
import Logger from '../tools/logger';
|
|
12
12
|
import Emmitter from '../tools/emmitter';
|
|
@@ -112,7 +112,7 @@ declare class DeviceManager extends Emmitter {
|
|
|
112
112
|
* 获取摄像头和麦克风权限方法,初始化时直接调用
|
|
113
113
|
*
|
|
114
114
|
* TODO:兼容方式通过获取devices设备去检测是否授予了权限
|
|
115
|
-
* TODO:可以通过
|
|
115
|
+
* TODO:可以通过looping的形式检测,后续在处理
|
|
116
116
|
*/
|
|
117
117
|
getPermission(): Promise<ICurrentPermission>;
|
|
118
118
|
/**
|
package/lib/src/main/helper.d.ts
CHANGED
|
@@ -5,19 +5,19 @@
|
|
|
5
5
|
* @email luojinghui424@gmail.com
|
|
6
6
|
*
|
|
7
7
|
* Created at : 2021-01-09 14:45:46
|
|
8
|
-
* Last modified :
|
|
8
|
+
* Last modified : 2022-06-09 17:35:24
|
|
9
9
|
*/
|
|
10
10
|
import { ILayout, IVideoManagerState, IRotationInfoTotalItem } from '../type';
|
|
11
11
|
export declare const getLayoutItemState: (item: ILayout | ILayout, stream: MediaStream | null, vmState: IVideoManagerState) => "REQUEST" | "MUTE" | "NORMAL" | "AUDIO_TEL" | "AUDIO_ONLY" | "AUDIO_CONTENT";
|
|
12
12
|
/**
|
|
13
|
-
* Get video real display size and
|
|
14
|
-
* @param width video real width of
|
|
15
|
-
* @param height video real height of
|
|
13
|
+
* Get video real display size and rotate of transform infos
|
|
14
|
+
* @param width video real width of resolution
|
|
15
|
+
* @param height video real height of resolution
|
|
16
16
|
* @param containerHeight display video container size
|
|
17
17
|
* @param containerWidth display video container size
|
|
18
18
|
* @param rotate video real ratio
|
|
19
19
|
*/
|
|
20
|
-
export declare const
|
|
20
|
+
export declare const getVideoInfoByRotation: (width: number, height: number, containerHeight: number, containerWidth: number, rotate: number) => {
|
|
21
21
|
realWidth: number;
|
|
22
22
|
realHeight: number;
|
|
23
23
|
realRotate: number;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @email luojinghui424@gmail.com
|
|
7
7
|
*
|
|
8
8
|
* Created at : 2021-01-05 17:24:07
|
|
9
|
-
* Last modified : 2022-
|
|
9
|
+
* Last modified : 2022-06-09 17:37:50
|
|
10
10
|
*/
|
|
11
11
|
import Logger from '../tools/logger';
|
|
12
12
|
import { ILayout, IVideoRenders, IRoster, ITemplateObj, IScreenInfo, IMode, IOutputCustomLayout, ILayoutRoster, IResolutionType, IConfInfo, IPageInfo, IReqInfo, IQualityType } from '../type/index';
|
|
@@ -64,7 +64,7 @@ export default class LayoutManager {
|
|
|
64
64
|
/**
|
|
65
65
|
* 设置发布全屏layout id
|
|
66
66
|
*
|
|
67
|
-
* @param { string } id
|
|
67
|
+
* @param { string } id forceLayout roster id
|
|
68
68
|
*/
|
|
69
69
|
setForceFullScreenId(id?: string): void;
|
|
70
70
|
setTemplateMode(templateMode: IMode): void;
|
package/lib/src/main/peer.d.ts
CHANGED
|
@@ -110,7 +110,7 @@ export default class Peer {
|
|
|
110
110
|
*/
|
|
111
111
|
setBandWidth(trackId: string, bandwidth: number | undefined, isIncreaseBase: boolean | undefined, stream: MediaStream | null): Promise<void>;
|
|
112
112
|
/**
|
|
113
|
-
* View the cb of ice
|
|
113
|
+
* View the cb of ice connection status change
|
|
114
114
|
* Maybe status:'new', 'checking', 'connected', 'completed', 'failed', 'disconnected', 'closed'
|
|
115
115
|
*
|
|
116
116
|
* @private
|
|
@@ -158,7 +158,7 @@ export default class Peer {
|
|
|
158
158
|
*/
|
|
159
159
|
initSenderStatus(): void;
|
|
160
160
|
/**
|
|
161
|
-
* Reset content
|
|
161
|
+
* Reset content sender track
|
|
162
162
|
*
|
|
163
163
|
* @public
|
|
164
164
|
*/
|
|
@@ -184,6 +184,14 @@ export default class Peer {
|
|
|
184
184
|
* @private
|
|
185
185
|
*/
|
|
186
186
|
private calcMeetingStats;
|
|
187
|
+
/**
|
|
188
|
+
* 计算丢包率
|
|
189
|
+
*
|
|
190
|
+
* @param sum 包的总数
|
|
191
|
+
* @param lost 丢失包的数量
|
|
192
|
+
* @returns 丢包率
|
|
193
|
+
*/
|
|
194
|
+
private getLost;
|
|
187
195
|
/**
|
|
188
196
|
* 批量向peer通道添加Track轨道数据
|
|
189
197
|
*
|
|
@@ -259,6 +267,7 @@ export default class Peer {
|
|
|
259
267
|
* @private
|
|
260
268
|
* @param { RTCStatsReport } stats sender发送器的统计数据
|
|
261
269
|
* @param { ILayout } layoutItem layout布局数据
|
|
270
|
+
* @param { IInternels } internels 自定义internels统计数据
|
|
262
271
|
* @returns { IReceiver } 接收端的统计数据
|
|
263
272
|
*/
|
|
264
273
|
private getReceiverStatus;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import Client from './client';
|
|
2
|
+
import LayoutManager from './layoutManager';
|
|
3
|
+
import { IInternels } from '../type';
|
|
4
|
+
declare class QualityManager {
|
|
5
|
+
private client;
|
|
6
|
+
private reportDataTimer;
|
|
7
|
+
private meetingQualityData;
|
|
8
|
+
private layoutManager;
|
|
9
|
+
private previousInternals;
|
|
10
|
+
private internals;
|
|
11
|
+
constructor(client: Client, layoutManager: LayoutManager);
|
|
12
|
+
/**
|
|
13
|
+
* 定时上报会议质量、网络数据
|
|
14
|
+
*
|
|
15
|
+
* @private
|
|
16
|
+
*/
|
|
17
|
+
reportQualityData(internals: IInternels): void;
|
|
18
|
+
/**
|
|
19
|
+
* webrtc audioLevel 转换成 播放能量
|
|
20
|
+
* @param audioLevel
|
|
21
|
+
* @returns
|
|
22
|
+
*/
|
|
23
|
+
private calcAudioLevel;
|
|
24
|
+
/**
|
|
25
|
+
* 发送会议质量数据
|
|
26
|
+
*
|
|
27
|
+
* @param { number ? } sessionName 0:people 1:content
|
|
28
|
+
* @param { boolean ? } isLast 挂断状态
|
|
29
|
+
* @private
|
|
30
|
+
*/
|
|
31
|
+
private calcQualityData;
|
|
32
|
+
/**
|
|
33
|
+
* 停止上报网络数据
|
|
34
|
+
*
|
|
35
|
+
* @private
|
|
36
|
+
*/
|
|
37
|
+
stopReportData(): void;
|
|
38
|
+
}
|
|
39
|
+
export default QualityManager;
|
package/lib/src/main/stream.d.ts
CHANGED
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import Logger from '../tools/logger';
|
|
8
8
|
import Emmitter from '../tools/emmitter';
|
|
9
|
-
import { IStreamChangeType, IStreamObj, IGetMediaStreams, ISource,
|
|
9
|
+
import { IStreamChangeType, IStreamObj, IGetMediaStreams, ISource, IStreamInitConfig, IStreamCurrent, IMediaSupportedConstraints, IStreamChange, IStatus } from '../type';
|
|
10
10
|
import Peer from './peer';
|
|
11
11
|
import Client from './client';
|
|
12
12
|
export default class Stream extends Emmitter {
|
|
13
13
|
streams: IStreamObj[];
|
|
14
|
-
config:
|
|
14
|
+
config: IStreamInitConfig;
|
|
15
15
|
current: IStreamCurrent;
|
|
16
16
|
isSupportReauthorize: boolean;
|
|
17
17
|
private isSupportAppendTrack;
|
|
@@ -111,7 +111,7 @@ export default class Stream extends Emmitter {
|
|
|
111
111
|
* @param params
|
|
112
112
|
* @returns
|
|
113
113
|
*/
|
|
114
|
-
init(config?:
|
|
114
|
+
init(config?: IStreamInitConfig, params?: {
|
|
115
115
|
muteVideo?: boolean;
|
|
116
116
|
muteAudio?: boolean;
|
|
117
117
|
}): Promise<IStatus>;
|
|
@@ -128,7 +128,7 @@ export default class Stream extends Emmitter {
|
|
|
128
128
|
* @param { 720 | 1080 } resolution
|
|
129
129
|
* @returns
|
|
130
130
|
*/
|
|
131
|
-
private
|
|
131
|
+
private getContentContraints;
|
|
132
132
|
/**
|
|
133
133
|
*
|
|
134
134
|
* @param { boolean } video 是否开启摄像头
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @author jinghui-Luo
|
|
6
6
|
*
|
|
7
7
|
* Created at : 2020-12-18 16:54:15
|
|
8
|
-
* Last modified : 2022-
|
|
8
|
+
* Last modified : 2022-06-09 17:42:49
|
|
9
9
|
*/
|
|
10
10
|
import Logger from '../tools/logger';
|
|
11
11
|
declare class VideoManager {
|
|
@@ -26,7 +26,7 @@ declare class VideoManager {
|
|
|
26
26
|
/**
|
|
27
27
|
* client set video stream data
|
|
28
28
|
*
|
|
29
|
-
* @param key
|
|
29
|
+
* @param key endpointId + mediagroupId => pid
|
|
30
30
|
* @param stream MediaStream or null
|
|
31
31
|
*/
|
|
32
32
|
initVideoStreamById(key: string, stream: MediaStream | null): void;
|
|
@@ -34,7 +34,7 @@ declare class VideoManager {
|
|
|
34
34
|
updateLocalTrack(): void;
|
|
35
35
|
private initVideoSource;
|
|
36
36
|
private setSrcObject;
|
|
37
|
-
private
|
|
37
|
+
private initEventListener;
|
|
38
38
|
private removeEventListener;
|
|
39
39
|
private initStreamTrackEventListener;
|
|
40
40
|
private removeStreamTrackEventListener;
|
|
@@ -49,7 +49,7 @@ declare class VideoManager {
|
|
|
49
49
|
private onMute;
|
|
50
50
|
private onUnmute;
|
|
51
51
|
private onSuspend;
|
|
52
|
-
private
|
|
52
|
+
private onWaiting;
|
|
53
53
|
private onStalled;
|
|
54
54
|
private onLoadeddata;
|
|
55
55
|
private onVideoEnded;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Browser version tools
|
|
3
3
|
*
|
|
4
4
|
* @authors Luo-jinghui (luojinghui424@gmail.com)
|
|
5
5
|
* @date 2020-02-21 16:29:12
|
|
@@ -50,6 +50,6 @@ export declare const getIOSVersion: () => {
|
|
|
50
50
|
major: any;
|
|
51
51
|
minor: any;
|
|
52
52
|
} | undefined;
|
|
53
|
-
export declare const
|
|
53
|
+
export declare const getVersion: () => number;
|
|
54
54
|
export declare const isPC: boolean;
|
|
55
55
|
export declare const isMobile: boolean;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @authors Luo-jinghui (luojinghui424@gmail.com)
|
|
5
5
|
* @date 2019-10-24 14:06:05
|
|
6
6
|
*/
|
|
7
|
-
export declare const version = "2.1.
|
|
7
|
+
export declare const version = "2.1.2-beta.7 - build on 2022-08-01 17:25";
|
|
8
8
|
export declare const proxy: {
|
|
9
9
|
wssHost: string;
|
|
10
10
|
restHost: string;
|
package/lib/src/tools/db.d.ts
CHANGED
|
@@ -7,19 +7,71 @@
|
|
|
7
7
|
declare class DB {
|
|
8
8
|
db: any;
|
|
9
9
|
num: number;
|
|
10
|
-
|
|
10
|
+
dbName: string;
|
|
11
|
+
tableCount: number;
|
|
12
|
+
tableName: string;
|
|
13
|
+
constructor(tableCount?: number, tableName?: string, dbName?: string);
|
|
14
|
+
/**
|
|
15
|
+
* 表 添加数据
|
|
16
|
+
*
|
|
17
|
+
* @param data
|
|
18
|
+
*/
|
|
11
19
|
add(data: any): Promise<void>;
|
|
12
20
|
deleteDB(): Promise<void>;
|
|
13
21
|
close(): void;
|
|
14
22
|
stop(): void;
|
|
15
23
|
isOpen(): any;
|
|
24
|
+
/**
|
|
25
|
+
* 本地下载日志
|
|
26
|
+
*
|
|
27
|
+
* @returns { boolean } 日志下载是否成功
|
|
28
|
+
*/
|
|
16
29
|
export(): Promise<boolean>;
|
|
30
|
+
/**
|
|
31
|
+
* 日志上传
|
|
32
|
+
*
|
|
33
|
+
* @param { string } displayName 上传文件名
|
|
34
|
+
* @returns
|
|
35
|
+
*/
|
|
17
36
|
upload(displayName: string): Promise<Blob | null>;
|
|
18
37
|
progressCallback({ totalRows, completedRows }: any): boolean;
|
|
19
38
|
open(): void;
|
|
20
|
-
|
|
39
|
+
/**
|
|
40
|
+
* 初始化db
|
|
41
|
+
*/
|
|
21
42
|
init(): Promise<void>;
|
|
22
|
-
|
|
43
|
+
/**
|
|
44
|
+
* 获取需要在某个版本中添加的表。
|
|
45
|
+
*
|
|
46
|
+
* @param {string} field 表 字段
|
|
47
|
+
* @returns 表对象 每个键代表一个表名,每个值代表主键,后跟索引属性列表
|
|
48
|
+
*/
|
|
49
|
+
getStores(field: string): {
|
|
50
|
+
[key: string]: string;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* 创建表
|
|
54
|
+
*
|
|
55
|
+
* @param log
|
|
56
|
+
*/
|
|
57
|
+
initStores(): void;
|
|
58
|
+
/**
|
|
59
|
+
* 存储日志版本
|
|
60
|
+
*
|
|
61
|
+
* @param version
|
|
62
|
+
*/
|
|
63
|
+
setLogVersion(version: number): void;
|
|
64
|
+
/**
|
|
65
|
+
* 升级数据库
|
|
66
|
+
*
|
|
67
|
+
* @param log
|
|
68
|
+
*/
|
|
69
|
+
upgradeStores({ version, tableCount, tableName, field }?: {
|
|
70
|
+
version?: number | undefined;
|
|
71
|
+
tableCount?: number | undefined;
|
|
72
|
+
tableName?: string | undefined;
|
|
73
|
+
field?: string | undefined;
|
|
74
|
+
}): void;
|
|
23
75
|
/**
|
|
24
76
|
* Generate zip blob use json's blob async
|
|
25
77
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* webrtc
|
|
2
|
+
* webrtc axios request lib
|
|
3
3
|
*
|
|
4
4
|
* @authors Luo-jinghui (luojinghui424@gmail.com)
|
|
5
5
|
* @date 2019-11-01 14:14:45
|
|
@@ -50,12 +50,12 @@ declare class HttpClient {
|
|
|
50
50
|
};
|
|
51
51
|
setLoginInfo(loginInfo: IToken | null): void;
|
|
52
52
|
getLoginInfo(): any;
|
|
53
|
-
assignOptions: (option?: AxiosRequestConfig
|
|
53
|
+
assignOptions: (option?: AxiosRequestConfig) => AxiosRequestConfig & {
|
|
54
54
|
params: any;
|
|
55
55
|
};
|
|
56
|
-
get: (url: string, option?: IAxiosRequestConfig
|
|
57
|
-
put: (url: string, data?: any, option?: AxiosRequestConfig
|
|
58
|
-
post: (url: string, data?: any, option?: AxiosRequestConfig
|
|
59
|
-
delete: (url: string, option?: AxiosRequestConfig
|
|
56
|
+
get: (url: string, option?: IAxiosRequestConfig) => any;
|
|
57
|
+
put: (url: string, data?: any, option?: AxiosRequestConfig) => any;
|
|
58
|
+
post: (url: string, data?: any, option?: AxiosRequestConfig) => any;
|
|
59
|
+
delete: (url: string, option?: AxiosRequestConfig) => any;
|
|
60
60
|
}
|
|
61
61
|
export default HttpClient;
|
|
@@ -131,8 +131,7 @@ declare class Logger {
|
|
|
131
131
|
*/
|
|
132
132
|
downloadLog: () => Promise<void>;
|
|
133
133
|
/**
|
|
134
|
-
* Upload sdk log file to
|
|
135
|
-
* redmine url: http://172.20.33.81:8080/redmine/projects/crashandupload/issues
|
|
134
|
+
* Upload sdk log file to devops
|
|
136
135
|
*
|
|
137
136
|
* @public
|
|
138
137
|
* @param { string } name 上传文件名
|
|
@@ -43,7 +43,7 @@ declare class Socket {
|
|
|
43
43
|
reset(): void;
|
|
44
44
|
on(type: string, fn: any): void;
|
|
45
45
|
close(isReconnect?: boolean): void;
|
|
46
|
-
send(data: any,
|
|
46
|
+
send(data: any, parse?: boolean, isLog?: boolean): void;
|
|
47
47
|
stopCall(): void;
|
|
48
48
|
reConnect(): void;
|
|
49
49
|
}
|
package/lib/src/tools/utils.d.ts
CHANGED
|
@@ -51,7 +51,7 @@ export declare const getStatus: (code: string, detail?: any, msg?: string) => {
|
|
|
51
51
|
msg: string;
|
|
52
52
|
detail: any;
|
|
53
53
|
};
|
|
54
|
-
export declare const getMeetingStatus: (success: boolean, code?: string
|
|
54
|
+
export declare const getMeetingStatus: (success: boolean, code?: string, msg?: string) => {
|
|
55
55
|
success: boolean;
|
|
56
56
|
data: {
|
|
57
57
|
code: string;
|
|
@@ -64,4 +64,4 @@ export declare const getMeetingStatus: (success: boolean, code?: string | undefi
|
|
|
64
64
|
msg?: undefined;
|
|
65
65
|
};
|
|
66
66
|
};
|
|
67
|
-
export declare const
|
|
67
|
+
export declare const hideKeyInfo: (data: any, key: string | string[]) => any;
|
package/lib/src/type/base.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @property { string } code 错误码
|
|
5
5
|
* @property { string } msg 错误信息
|
|
6
|
-
* @property {
|
|
6
|
+
* @property { any } detail 数据详情
|
|
7
7
|
*/
|
|
8
8
|
export interface IStatus {
|
|
9
9
|
code: string;
|
|
@@ -64,3 +64,4 @@ export interface ISignParams {
|
|
|
64
64
|
token: string;
|
|
65
65
|
signSecret: string;
|
|
66
66
|
}
|
|
67
|
+
export declare type Key = string | number;
|