@xylink/xy-rtc-sdk 2.1.1 → 2.1.2
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 +38 -73
- package/lib/index.es.js +3 -1
- package/lib/index.js +3 -1
- package/lib/src/action/index.d.ts +136 -8
- package/lib/src/enum/contraints.d.ts +3 -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 +125 -30
- package/lib/src/main/deviceManager.d.ts +3 -4
- 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 +27 -2
- package/lib/src/main/qualityManager.d.ts +39 -0
- package/lib/src/main/stream.d.ts +6 -6
- 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 +56 -3
- package/lib/src/tools/detect.d.ts +28 -2
- package/lib/src/tools/httpClient.d.ts +10 -7
- package/lib/src/tools/index.d.ts +5 -0
- package/lib/src/tools/logger.d.ts +1 -2
- package/lib/src/tools/socket.d.ts +5 -2
- package/lib/src/tools/utils.d.ts +2 -2
- package/lib/src/type/base.d.ts +7 -2
- 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 +52 -3
- package/package.json +130 -130
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,19 @@ 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;
|
|
75
|
+
private isSubscribeTranslation;
|
|
74
76
|
private onDocumentChange;
|
|
75
77
|
constructor(config: IClientConfig, servers: IServers, logger: Logger);
|
|
76
78
|
static instance: Client;
|
|
@@ -93,6 +95,7 @@ export default class Client extends Emmitter {
|
|
|
93
95
|
total: ILayoutRoster[];
|
|
94
96
|
};
|
|
95
97
|
getOriginRosters(): IRoster[];
|
|
98
|
+
getConferenceInfo(): IConferenceInfo | null;
|
|
96
99
|
getInviteInfo(): IInvite;
|
|
97
100
|
getContentSenderPid(): number;
|
|
98
101
|
getSpeakerInfo(): ISpeakerInfo;
|
|
@@ -102,7 +105,18 @@ export default class Client extends Emmitter {
|
|
|
102
105
|
getOnHold(): boolean;
|
|
103
106
|
getAudioTrackList(): ICustomStreamTrack[];
|
|
104
107
|
getLayoutList(): Map<string, ILayout> | undefined;
|
|
108
|
+
/**
|
|
109
|
+
* 获取Local roster信息
|
|
110
|
+
*
|
|
111
|
+
* @returns { IRoster}
|
|
112
|
+
*/
|
|
105
113
|
getSelfRoster(): IRoster | undefined;
|
|
114
|
+
/**
|
|
115
|
+
* 获取本地是否在分享content
|
|
116
|
+
*
|
|
117
|
+
* @returns { boolean }
|
|
118
|
+
*/
|
|
119
|
+
getLocalShareContent(): boolean;
|
|
106
120
|
/**
|
|
107
121
|
* 小鱼账号初始登录,获取token方法
|
|
108
122
|
*
|
|
@@ -146,14 +160,14 @@ export default class Client extends Emmitter {
|
|
|
146
160
|
* 绑定streamId和video ele元素,内部维护状态
|
|
147
161
|
*
|
|
148
162
|
* @public
|
|
149
|
-
* @param { string } key
|
|
163
|
+
* @param { string } key endpointId + mediagroupId 唯一的用户id值
|
|
150
164
|
* @param { string } wrapEle 包裹video组件的元素id,此元素一定要提供宽高信息,内部会基于此宽高信息计算video的旋转信息
|
|
151
165
|
*/
|
|
152
166
|
setVideoRenderer(key: string, wrapEleId: string): void;
|
|
153
167
|
/**
|
|
154
168
|
* 移除绑定的streamId
|
|
155
169
|
*
|
|
156
|
-
* @param { string } key
|
|
170
|
+
* @param { string } key endpointId + mediagroupId 唯一的用户id值
|
|
157
171
|
* @param { string } wrapEle 包裹video组件的元素id,此元素一定要提供宽高信息,内部会基于此宽高信息计算video的旋转信息
|
|
158
172
|
*/
|
|
159
173
|
removeVideoRender(key: string, wrapEleId: string): void;
|
|
@@ -203,6 +217,18 @@ export default class Client extends Emmitter {
|
|
|
203
217
|
* @private
|
|
204
218
|
*/
|
|
205
219
|
private handleConferenceInfo;
|
|
220
|
+
/**
|
|
221
|
+
* 检查会议室录制权限
|
|
222
|
+
*
|
|
223
|
+
* @public
|
|
224
|
+
*/
|
|
225
|
+
checkPermissionWithMeetingNumber(): Promise<IRecordPermission>;
|
|
226
|
+
/**
|
|
227
|
+
* 录制存储空间检查
|
|
228
|
+
*
|
|
229
|
+
* @param { string } recordingUrl
|
|
230
|
+
*/
|
|
231
|
+
checkStorageSpaceWithRecordingUrl(recordingUrl: string): Promise<any>;
|
|
206
232
|
/**
|
|
207
233
|
* 处理wss返回的数据
|
|
208
234
|
*
|
|
@@ -255,7 +281,7 @@ export default class Client extends Emmitter {
|
|
|
255
281
|
* @public
|
|
256
282
|
* @param { Stream } stream 本地contentStream
|
|
257
283
|
*/
|
|
258
|
-
|
|
284
|
+
sendContentCapabilityMessage(stream?: Stream): void;
|
|
259
285
|
/**
|
|
260
286
|
* 分享content
|
|
261
287
|
*
|
|
@@ -305,20 +331,20 @@ export default class Client extends Emmitter {
|
|
|
305
331
|
autoMute: AutoMute;
|
|
306
332
|
}): Promise<IConference>;
|
|
307
333
|
/**
|
|
308
|
-
*
|
|
334
|
+
* 获取错误码/i18n等json链接
|
|
309
335
|
*
|
|
310
336
|
* @private
|
|
311
337
|
* @returns
|
|
312
338
|
*/
|
|
313
|
-
private
|
|
339
|
+
private getServerConfig;
|
|
314
340
|
/**
|
|
315
|
-
*
|
|
341
|
+
* 获取链接内容
|
|
316
342
|
*
|
|
317
|
-
* @
|
|
318
|
-
* @param
|
|
319
|
-
* @returns
|
|
343
|
+
* @param { string } configName 'errorcode' | 'i18n'
|
|
344
|
+
* @param data
|
|
345
|
+
* @returns
|
|
320
346
|
*/
|
|
321
|
-
private
|
|
347
|
+
private getCodeByJson;
|
|
322
348
|
/**
|
|
323
349
|
* 音视频开启关闭操作
|
|
324
350
|
*
|
|
@@ -509,12 +535,19 @@ export default class Client extends Emmitter {
|
|
|
509
535
|
requestAutoPollingLayout(command: TCommand, interval: number | undefined, reqList: IReqInfo[]): Promise<boolean>;
|
|
510
536
|
/**
|
|
511
537
|
* 应用替换已经更新的的people video track轨道流,如果之前无流,则需重新setStream, replaceTrack
|
|
538
|
+
* 第一次开启音频、或视频,需重新协商offer。改变通道方向
|
|
512
539
|
*
|
|
513
540
|
* @public
|
|
514
541
|
* @param { 'video' | 'audio' } kind 设备类型
|
|
515
542
|
* @param { boolean } isFirst 是否之前无流
|
|
516
543
|
*/
|
|
517
544
|
applyVideoOrAudio(kind: 'video' | 'audio', isFirst?: boolean): void;
|
|
545
|
+
/**
|
|
546
|
+
* 上报audio状态
|
|
547
|
+
*
|
|
548
|
+
* @param { boolean | string } status
|
|
549
|
+
*/
|
|
550
|
+
sendAudioStatus(status: boolean | string): void;
|
|
518
551
|
/**
|
|
519
552
|
* 发布layout数据
|
|
520
553
|
*
|
|
@@ -540,10 +573,10 @@ export default class Client extends Emmitter {
|
|
|
540
573
|
*/
|
|
541
574
|
sendCustomLayoutMessage(): void;
|
|
542
575
|
/**
|
|
543
|
-
* 发布Layout
|
|
576
|
+
* 发布Layout Container的容器信息
|
|
544
577
|
*
|
|
545
578
|
* @public
|
|
546
|
-
* @param { IScreenInfo } screenInfo Layout
|
|
579
|
+
* @param { IScreenInfo } screenInfo Layout Container的容器信息
|
|
547
580
|
*/
|
|
548
581
|
sendScreenInfoMessage(screenInfo: IScreenInfo): void;
|
|
549
582
|
/**
|
|
@@ -580,6 +613,20 @@ export default class Client extends Emmitter {
|
|
|
580
613
|
* @param { ICustomLayout[] } customLayout 计算得到的customLayout List数据
|
|
581
614
|
*/
|
|
582
615
|
sendCustomLayout(customLayout?: ICustomLayout[]): void;
|
|
616
|
+
/**
|
|
617
|
+
* 上报会议质量数据
|
|
618
|
+
*
|
|
619
|
+
* @public
|
|
620
|
+
* @param { IInternels } internels Internels统计数据
|
|
621
|
+
*/
|
|
622
|
+
reportQualityData(internels: IInternels): void;
|
|
623
|
+
/**
|
|
624
|
+
* Internels统计数据-期望带宽
|
|
625
|
+
*
|
|
626
|
+
* @param internels
|
|
627
|
+
* @returns
|
|
628
|
+
*/
|
|
629
|
+
private getInternels;
|
|
583
630
|
/**
|
|
584
631
|
* 发布Internels统计数据
|
|
585
632
|
*
|
|
@@ -634,6 +681,12 @@ export default class Client extends Emmitter {
|
|
|
634
681
|
* @param { boolean } isLog 是否写入日志
|
|
635
682
|
*/
|
|
636
683
|
sendSocketMessage(data: any, isAutoAdd?: boolean, isLog?: boolean): void;
|
|
684
|
+
/**
|
|
685
|
+
* 获取用户、会议室基本信息
|
|
686
|
+
*
|
|
687
|
+
* @param { ICall } params
|
|
688
|
+
* @returns
|
|
689
|
+
*/
|
|
637
690
|
private getBasicInfo;
|
|
638
691
|
/**
|
|
639
692
|
* 校验会议室号
|
|
@@ -643,6 +696,10 @@ export default class Client extends Emmitter {
|
|
|
643
696
|
* @returns { Promise<{success: boolean; data: any;}> } 是否通过校验
|
|
644
697
|
*/
|
|
645
698
|
private verifyMeeting;
|
|
699
|
+
/**
|
|
700
|
+
* 刷新Token
|
|
701
|
+
*/
|
|
702
|
+
refreshToken(refresh_token: string): Promise<any>;
|
|
646
703
|
/**
|
|
647
704
|
* 设置扬声器
|
|
648
705
|
*
|
|
@@ -653,9 +710,9 @@ export default class Client extends Emmitter {
|
|
|
653
710
|
/**
|
|
654
711
|
* 移除对应的AudioRender
|
|
655
712
|
*
|
|
656
|
-
* @param { string } key
|
|
713
|
+
* @param { string } key endpointId + mediagroupId 唯一的用户id值
|
|
657
714
|
*/
|
|
658
|
-
|
|
715
|
+
removeAudioRender(key: string): void;
|
|
659
716
|
/**
|
|
660
717
|
* 开始巡课
|
|
661
718
|
*
|
|
@@ -676,26 +733,64 @@ export default class Client extends Emmitter {
|
|
|
676
733
|
* @public
|
|
677
734
|
*/
|
|
678
735
|
subscribeBulkRoster(): Promise<unknown>;
|
|
679
|
-
reSendContentOffer(): void;
|
|
680
736
|
/**
|
|
681
|
-
*
|
|
737
|
+
* 开启同传字幕消息
|
|
682
738
|
*
|
|
683
|
-
* @
|
|
739
|
+
* @public
|
|
684
740
|
*/
|
|
685
|
-
|
|
741
|
+
startTranslation(): Promise<unknown>;
|
|
686
742
|
/**
|
|
687
|
-
*
|
|
743
|
+
* 停止同传字幕消息
|
|
688
744
|
*
|
|
689
|
-
* @
|
|
690
|
-
* @private
|
|
745
|
+
* @public
|
|
691
746
|
*/
|
|
692
|
-
|
|
747
|
+
stopTranslation(): Promise<unknown>;
|
|
693
748
|
/**
|
|
694
|
-
*
|
|
749
|
+
* 同传字幕: 设置本地说话的语言
|
|
695
750
|
*
|
|
696
|
-
* @
|
|
751
|
+
* @param { TLocalLanguage } language
|
|
752
|
+
* @returns
|
|
753
|
+
*/
|
|
754
|
+
setTranslationLanguage(language: TLocalLanguage): Promise<unknown>;
|
|
755
|
+
/**
|
|
756
|
+
* 开启云端录制
|
|
757
|
+
*
|
|
758
|
+
* @public
|
|
759
|
+
*/
|
|
760
|
+
startCloudRecord(): Promise<undefined>;
|
|
761
|
+
/**
|
|
762
|
+
* 停止录制
|
|
763
|
+
*
|
|
764
|
+
* @public
|
|
765
|
+
*/
|
|
766
|
+
stopCloudRecord(): Promise<undefined>;
|
|
767
|
+
/**
|
|
768
|
+
* 配置web节点接收带宽
|
|
769
|
+
*
|
|
770
|
+
* @public
|
|
697
771
|
*/
|
|
698
|
-
|
|
772
|
+
setWebRxBandwidth(): Promise<undefined>;
|
|
773
|
+
/**
|
|
774
|
+
* 重新发送content offer
|
|
775
|
+
*
|
|
776
|
+
* @public
|
|
777
|
+
*/
|
|
778
|
+
reSendContentOffer(): void;
|
|
779
|
+
startMonitorGroup(mediagrpIds: Key[]): true | {
|
|
780
|
+
code: string;
|
|
781
|
+
msg: string;
|
|
782
|
+
detail: any;
|
|
783
|
+
};
|
|
784
|
+
stopMonitorGroup(mediagrpIds: Key[]): true | {
|
|
785
|
+
code: string;
|
|
786
|
+
msg: string;
|
|
787
|
+
detail: any;
|
|
788
|
+
};
|
|
789
|
+
setMonitorGroup(type: 'start' | 'stop', mediagrpIds: Key[]): true | {
|
|
790
|
+
code: string;
|
|
791
|
+
msg: string;
|
|
792
|
+
detail: any;
|
|
793
|
+
};
|
|
699
794
|
/**
|
|
700
795
|
* 初始化DeviceManager事件
|
|
701
796
|
*
|
|
@@ -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';
|
|
@@ -19,7 +19,6 @@ import { IDeviceList, ISelectedDevice, ICurrentPermission } from '../type';
|
|
|
19
19
|
*/
|
|
20
20
|
declare class DeviceManager extends Emmitter {
|
|
21
21
|
private navigator;
|
|
22
|
-
private mediaDevices;
|
|
23
22
|
private currentDeviceList;
|
|
24
23
|
private nextDeviceList;
|
|
25
24
|
private currentUsedDevice;
|
|
@@ -43,7 +42,7 @@ declare class DeviceManager extends Emmitter {
|
|
|
43
42
|
*
|
|
44
43
|
* @param devices 设备数据
|
|
45
44
|
*/
|
|
46
|
-
setCurrentUsedDevice(
|
|
45
|
+
setCurrentUsedDevice(currentDevice: ISelectedDevice): Promise<void>;
|
|
47
46
|
/**
|
|
48
47
|
* 设置当前正在使用的设备信息
|
|
49
48
|
* 切换设备时,需重新设置此值,为下次diffDevice 使用
|
|
@@ -112,7 +111,7 @@ declare class DeviceManager extends Emmitter {
|
|
|
112
111
|
* 获取摄像头和麦克风权限方法,初始化时直接调用
|
|
113
112
|
*
|
|
114
113
|
* TODO:兼容方式通过获取devices设备去检测是否授予了权限
|
|
115
|
-
* TODO:可以通过
|
|
114
|
+
* TODO:可以通过looping的形式检测,后续在处理
|
|
116
115
|
*/
|
|
117
116
|
getPermission(): Promise<ICurrentPermission>;
|
|
118
117
|
/**
|
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
|
@@ -32,6 +32,7 @@ export default class Peer {
|
|
|
32
32
|
private senderInterval;
|
|
33
33
|
private isResendContentOffer;
|
|
34
34
|
private isRestartIceConnection;
|
|
35
|
+
private isFirstConnected;
|
|
35
36
|
constructor(client: Client, stream: Stream);
|
|
36
37
|
getInternels(): IInternels;
|
|
37
38
|
/**
|
|
@@ -110,7 +111,7 @@ export default class Peer {
|
|
|
110
111
|
*/
|
|
111
112
|
setBandWidth(trackId: string, bandwidth: number | undefined, isIncreaseBase: boolean | undefined, stream: MediaStream | null): Promise<void>;
|
|
112
113
|
/**
|
|
113
|
-
* View the cb of ice
|
|
114
|
+
* View the cb of ice connection status change
|
|
114
115
|
* Maybe status:'new', 'checking', 'connected', 'completed', 'failed', 'disconnected', 'closed'
|
|
115
116
|
*
|
|
116
117
|
* @private
|
|
@@ -135,6 +136,7 @@ export default class Peer {
|
|
|
135
136
|
* 关闭PeerConnection连接、销毁状态
|
|
136
137
|
*/
|
|
137
138
|
close(): void;
|
|
139
|
+
setRestartIceConnection(isRestartIceConnection?: boolean): void;
|
|
138
140
|
/**
|
|
139
141
|
* add Track for stream, default push all
|
|
140
142
|
*
|
|
@@ -158,7 +160,7 @@ export default class Peer {
|
|
|
158
160
|
*/
|
|
159
161
|
initSenderStatus(): void;
|
|
160
162
|
/**
|
|
161
|
-
* Reset content
|
|
163
|
+
* Reset content sender track
|
|
162
164
|
*
|
|
163
165
|
* @public
|
|
164
166
|
*/
|
|
@@ -184,6 +186,21 @@ export default class Peer {
|
|
|
184
186
|
* @private
|
|
185
187
|
*/
|
|
186
188
|
private calcMeetingStats;
|
|
189
|
+
/**
|
|
190
|
+
* 过滤远端音频中没有带宽或者没有音量的数据
|
|
191
|
+
*
|
|
192
|
+
* @param { IInternels } internels
|
|
193
|
+
* @returns
|
|
194
|
+
*/
|
|
195
|
+
private filterInternels;
|
|
196
|
+
/**
|
|
197
|
+
* 计算丢包率
|
|
198
|
+
*
|
|
199
|
+
* @param sum 包的总数
|
|
200
|
+
* @param lost 丢失包的数量
|
|
201
|
+
* @returns 丢包率
|
|
202
|
+
*/
|
|
203
|
+
private getLost;
|
|
187
204
|
/**
|
|
188
205
|
* 批量向peer通道添加Track轨道数据
|
|
189
206
|
*
|
|
@@ -253,12 +270,20 @@ export default class Peer {
|
|
|
253
270
|
* @returns { ISender } 自定义统计数据内容
|
|
254
271
|
*/
|
|
255
272
|
private getSenderStatus;
|
|
273
|
+
/**
|
|
274
|
+
* 计算音量值, 显示0-100
|
|
275
|
+
*
|
|
276
|
+
* @param { number } audioLevel
|
|
277
|
+
* @returns
|
|
278
|
+
*/
|
|
279
|
+
private calcAudioLevel;
|
|
256
280
|
/**
|
|
257
281
|
* 获取receiver的数据
|
|
258
282
|
*
|
|
259
283
|
* @private
|
|
260
284
|
* @param { RTCStatsReport } stats sender发送器的统计数据
|
|
261
285
|
* @param { ILayout } layoutItem layout布局数据
|
|
286
|
+
* @param { IInternels } internels 自定义internels统计数据
|
|
262
287
|
* @returns { IReceiver } 接收端的统计数据
|
|
263
288
|
*/
|
|
264
289
|
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 是否开启摄像头
|
|
@@ -206,8 +206,8 @@ export default class Stream extends Emmitter {
|
|
|
206
206
|
*/
|
|
207
207
|
createElectronContentStream(selectedSourceId: string): Promise<IStreamObj[]>;
|
|
208
208
|
getPreviewStream(isVideo?: boolean, isAudio?: boolean, params?: {
|
|
209
|
-
video:
|
|
210
|
-
audio:
|
|
209
|
+
video: any;
|
|
210
|
+
audio: any;
|
|
211
211
|
}): Promise<MediaStream>;
|
|
212
212
|
private getUserMedia;
|
|
213
213
|
private handleCloseShareContentEvent;
|
|
@@ -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-08-31 20:10:23
|
|
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 - build on 2022-09-20 14:31";
|
|
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,72 @@
|
|
|
7
7
|
declare class DB {
|
|
8
8
|
db: any;
|
|
9
9
|
num: number;
|
|
10
|
-
|
|
10
|
+
dbName: string;
|
|
11
|
+
tableCount: number;
|
|
12
|
+
tableName: string;
|
|
13
|
+
maxTableCount: number;
|
|
14
|
+
constructor(tableCount?: number, tableName?: string, dbName?: string);
|
|
15
|
+
/**
|
|
16
|
+
* 表 添加数据
|
|
17
|
+
*
|
|
18
|
+
* @param data
|
|
19
|
+
*/
|
|
11
20
|
add(data: any): Promise<void>;
|
|
12
21
|
deleteDB(): Promise<void>;
|
|
13
22
|
close(): void;
|
|
14
23
|
stop(): void;
|
|
15
24
|
isOpen(): any;
|
|
25
|
+
/**
|
|
26
|
+
* 本地下载日志
|
|
27
|
+
*
|
|
28
|
+
* @returns { boolean } 日志下载是否成功
|
|
29
|
+
*/
|
|
16
30
|
export(): Promise<boolean>;
|
|
31
|
+
/**
|
|
32
|
+
* 日志上传
|
|
33
|
+
*
|
|
34
|
+
* @param { string } displayName 上传文件名
|
|
35
|
+
* @returns
|
|
36
|
+
*/
|
|
17
37
|
upload(displayName: string): Promise<Blob | null>;
|
|
18
38
|
progressCallback({ totalRows, completedRows }: any): boolean;
|
|
19
39
|
open(): void;
|
|
20
|
-
|
|
40
|
+
/**
|
|
41
|
+
* 初始化db
|
|
42
|
+
*/
|
|
21
43
|
init(): Promise<void>;
|
|
22
|
-
|
|
44
|
+
/**
|
|
45
|
+
* 获取需要在某个版本中添加的表。
|
|
46
|
+
*
|
|
47
|
+
* @param {string} field 表 字段
|
|
48
|
+
* @returns 表对象 每个键代表一个表名,每个值代表主键,后跟索引属性列表
|
|
49
|
+
*/
|
|
50
|
+
getStores(field: string): {
|
|
51
|
+
[key: string]: string;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* 创建表
|
|
55
|
+
*
|
|
56
|
+
* @param log
|
|
57
|
+
*/
|
|
58
|
+
initStores(): void;
|
|
59
|
+
/**
|
|
60
|
+
* 存储日志版本
|
|
61
|
+
*
|
|
62
|
+
* @param version
|
|
63
|
+
*/
|
|
64
|
+
setLogVersion(version: number): void;
|
|
65
|
+
/**
|
|
66
|
+
* 升级数据库
|
|
67
|
+
*
|
|
68
|
+
* @param log
|
|
69
|
+
*/
|
|
70
|
+
upgradeStores({ version, tableCount, tableName, field }?: {
|
|
71
|
+
version?: number | undefined;
|
|
72
|
+
tableCount?: number | undefined;
|
|
73
|
+
tableName?: string | undefined;
|
|
74
|
+
field?: string | undefined;
|
|
75
|
+
}): void;
|
|
23
76
|
/**
|
|
24
77
|
* Generate zip blob use json's blob async
|
|
25
78
|
*
|