@xylink/xy-rtc-sdk 2.0.6 → 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.
@@ -1,4 +1,7 @@
1
+ import { IToken } from './base';
1
2
  import VideoManager from '../main/videoManager';
3
+ import { IInternels } from './stream';
4
+ import { SupportLocalLanguages } from 'src/enum';
2
5
  /**
3
6
  * 向Client推送流类型
4
7
  *
@@ -20,7 +23,7 @@ export declare type IClientLayout = 'AUTO' | 'CUSTOM' | 'auto' | 'custom';
20
23
  * @value STARTING 分享中
21
24
  * @value PENDING 等待
22
25
  */
23
- export declare type ISahreContentStatus = 'ENDED' | 'STARTING' | 'PENDING';
26
+ export declare type IShareContentStatus = 'ENDED' | 'STARTING' | 'PENDING';
24
27
  /**
25
28
  * VIDEO事件回调状态状态
26
29
  *
@@ -48,10 +51,10 @@ export declare type ITemplateMode = 'SPEAKER' | 'GALLERY';
48
51
  * 主画面/Content布局模式
49
52
  *
50
53
  * @value MULTI_PIC_CONTENT_HIGH_PRIORITY Content是大窗口
51
- * @value MULTI_PIC_ACTIVE_HIGH_PRIORITY ActiveSpecker是大窗口
54
+ * @value MULTI_PIC_ACTIVE_HIGH_PRIORITY ActiveSpeaker是大窗口
52
55
  * @value TWO_PIC_PIP 画中画模式(picture in picture)
53
56
  * @value CONTENT_ONLY 只显示Content
54
- * @value TWO_PIC_SYMMETRIC 对称显示content和speker(side by side)
57
+ * @value TWO_PIC_SYMMETRIC 对称显示content和speaker(side by side)
55
58
  */
56
59
  export declare type IContentTemplateMode = 'MULTI_PIC_CONTENT_HIGH_PRIORITY' | 'MULTI_PIC_ACTIVE_HIGH_PRIORITY' | 'TWO_PIC_PIP' | 'CONTENT_ONLY' | 'TWO_PIC_SYMMETRIC';
57
60
  /**
@@ -77,15 +80,15 @@ export declare type IVideoType = 'muteVideo' | 'unmuteVideo';
77
80
  /**
78
81
  * 音频状态
79
82
  *
80
- * @valule muteAudio 关闭麦克风
81
- * @valule unmuteAudio 开启麦克风
83
+ * @value muteAudio 关闭麦克风
84
+ * @value unmuteAudio 开启麦克风
82
85
  */
83
86
  export declare type IAudioType = 'muteAudio' | 'unmuteAudio';
84
87
  /**
85
88
  * 视频/音频状态
86
89
  *
87
- * @valule muteAudio 关闭麦克风
88
- * @valule unmuteAudio 开启麦克风
90
+ * @value muteAudio 关闭麦克风
91
+ * @value unmuteAudio 开启麦克风
89
92
  * @value muteVideo 关闭摄像头
90
93
  * @value unmuteVideo:开启摄像头
91
94
  */
@@ -167,6 +170,42 @@ export declare type IResolutionType = 0 | 1 | 2 | 3 | 4 | 5;
167
170
  * @value 3 300
168
171
  */
169
172
  export declare type IQualityType = 0 | 1 | 2;
173
+ /**
174
+ * 是否禁止收听
175
+ *
176
+ * @value 'keep' 保持上次的状态
177
+ * @value 'on' 禁止收听
178
+ * @value 'off' 取消禁止收听
179
+ */
180
+ export declare type IMuteSpeaker = 'keep' | 'on' | 'off';
181
+ /**
182
+ * 录制状态
183
+ *
184
+ * @value RECORD_STATE_IDLE 停止成功
185
+ * @value RECORD_STATE_STARTING 开启录制
186
+ * @value RECORD_STATE_STARTED 开启成功
187
+ * @value RECORD_STATE_STOPING 停止录制
188
+ */
189
+ export declare enum RecordingState {
190
+ RECORD_STATE_IDLE = "RECORD_STATE_IDLE",
191
+ RECORD_STATE_STARTING = "RECORD_STATE_STARTING",
192
+ RECORD_STATE_STARTED = "RECORD_STATE_STARTED",
193
+ RECORD_STATE_STOPING = "RECORD_STATE_STOPING"
194
+ }
195
+ /**
196
+ * 录制状态
197
+ *
198
+ * @param NONE 未开启录制
199
+ * @param LOCAL_START 本地开启录制
200
+ * @param REMOTE_STAR 远端开启录制
201
+ * @param REMOTE_PAUSED 远端录制暂停中
202
+ */
203
+ export declare enum RecordStatus {
204
+ NONE = 0,
205
+ LOCAL_START = 1,
206
+ REMOTE_STAR = 2,
207
+ REMOTE_PAUSED = 3
208
+ }
170
209
  /**
171
210
  * client配置参数
172
211
  *
@@ -187,11 +226,14 @@ export declare type IQualityType = 0 | 1 | 2;
187
226
  * @property { string } __hideId 是否是隐身入会模式,hide代表隐身入会,为空代表正常模式
188
227
  * @property { string } __monitorMode 是否是巡课模式,默认是'',MONITOR代表巡课模式
189
228
  * @property { boolean } isThird 埋点
190
- * @property { boolean } isSupportHybridCloud 是否是混合云
229
+ * @property { boolean } isSupportHybridCloud 是否是混合云,默认公有云。 如果有探测到内网地址,则此值为true,将不进行鉴权。
230
+ * @property { boolean } isVerifyMeetingId 是否校验会议号,默认校验
231
+ * @property { boolean } bandwidthSetting 带宽配置
191
232
  *
192
233
  */
193
234
  export interface IClientConfig {
194
- clientId?: string;
235
+ clientId: string;
236
+ clientSecret?: string;
195
237
  wssServer?: string;
196
238
  httpServer?: string;
197
239
  logServer?: string;
@@ -206,10 +248,12 @@ export interface IClientConfig {
206
248
  localHide?: boolean;
207
249
  localMirror?: boolean;
208
250
  templateMode?: ITemplateMode;
209
- __hideId?: string;
251
+ __hideId?: number | string;
210
252
  __monitorMode?: string;
211
253
  isThird?: boolean;
212
254
  isSupportHybridCloud?: boolean;
255
+ isVerifyMeetingId?: boolean;
256
+ bandwidthSetting?: boolean;
213
257
  }
214
258
  export interface ILayoutParams {
215
259
  rosters: IRoster[];
@@ -224,6 +268,7 @@ export declare type ITemplateObj = {
224
268
  position: number[];
225
269
  resolution: IResolutionType;
226
270
  zIndex?: number;
271
+ isContent?: boolean;
227
272
  };
228
273
  export interface ITypeTemplate {
229
274
  [id: string]: ITemplateObj[];
@@ -245,16 +290,7 @@ export interface ITemplate {
245
290
  */
246
291
  export interface IDefault {
247
292
  CLIENT_TYPE: string;
248
- INIT_INTERNELS: {
249
- bytesReceived: number;
250
- bytesReceivedSecond: number;
251
- bytesSent: number;
252
- bytesSentSecond: number;
253
- mimeType: string;
254
- timestamp: number;
255
- receiver: {};
256
- sender: {};
257
- };
293
+ INIT_INTERNELS: IInternels;
258
294
  RESOLUTION: number;
259
295
  ROSTER: IRoster;
260
296
  SELF_MOCK_PID: number;
@@ -285,6 +321,7 @@ export interface IDefault {
285
321
  height: number;
286
322
  };
287
323
  };
324
+ CONF_INFO: IConfInfo;
288
325
  }
289
326
  /**
290
327
  * SDK登录结果
@@ -307,7 +344,7 @@ export interface ILoginInfo {
307
344
  cellPhone?: string;
308
345
  extUserId?: string;
309
346
  }
310
- export interface IErrorCodeList {
347
+ export interface ICodeList {
311
348
  version: string;
312
349
  zh_CN: {
313
350
  [key: string]: string;
@@ -448,16 +485,9 @@ export interface IHttpConfig {
448
485
  *
449
486
  * 此信息是由业务层提供网关配置
450
487
  */
451
- export interface IConfig {
488
+ export interface IConfig extends IToken {
452
489
  client_id: string;
453
- access_token: string;
454
- signSecret?: string;
455
- refresh_token?: string;
456
- domain?: string;
457
- expires_in?: number;
458
- openid?: string;
459
- scope?: string;
460
- token_type?: string;
490
+ client_secret: string;
461
491
  }
462
492
  /**
463
493
  * 会议室配置信息
@@ -524,6 +554,7 @@ export interface ICall extends IMackCall {
524
554
  * @property { string } vcNumber 最终的会议号
525
555
  * @property { "true" | "false" } inoutReminder 是否设置了出入会提醒
526
556
  * @property { string } commonJson 其他会议室配置
557
+ * @property { string } remoteUri 云会议室URI
527
558
  */
528
559
  export interface IInvite {
529
560
  callerUri: string;
@@ -533,6 +564,19 @@ export interface IInvite {
533
564
  vcNumber?: string;
534
565
  inoutReminder?: 'true' | 'false';
535
566
  commonJson?: string;
567
+ remoteUri?: string;
568
+ }
569
+ /**
570
+ * 分组会议信息
571
+ *
572
+ * @property { boolean } groupLeader 是否设置本终端为管理员 true:设置, false:取消
573
+ * @property { string } groupName 此名称显示至用户界面
574
+ * @property { number } groupType 是否进入讨论组 1:进入,0:退出
575
+ */
576
+ export interface IGroupInfo {
577
+ groupLeader: boolean;
578
+ groupName: string;
579
+ groupType: number;
536
580
  }
537
581
  /**
538
582
  * 会控回调信息
@@ -546,6 +590,8 @@ export interface IInvite {
546
590
  * @property { string } role 未知
547
591
  * @property { string } type 未知
548
592
  * @property { string } commonJson 会控修改名称等
593
+ * @property { IMuteSpeaker } isMuteSpeaker 禁止收听
594
+ * @property { boolean } recordIsDisabled 录制权限
549
595
  */
550
596
  export interface IMeetingControl {
551
597
  callIndex: number;
@@ -557,6 +603,9 @@ export interface IMeetingControl {
557
603
  role: string;
558
604
  type: string;
559
605
  commonJson: string;
606
+ isMuteSpeaker: IMuteSpeaker;
607
+ recordIsDisabled: boolean;
608
+ groupInfoList: IGroupInfo[];
560
609
  }
561
610
  /**
562
611
  * Roster:参会者的基本信息,包含基本信息,设备信息,画面信息等
@@ -580,6 +629,8 @@ export interface IMeetingControl {
580
629
  * @property { string } id 参会者唯一id,值为 endpointId + mediagroupid,用于区分一个人同时发送people+content画面数据
581
630
  * @property { string } extUserId 三方userId
582
631
  * @property { boolean } isLocal 参会者是否是自己
632
+ * @property { number } ExpectHeight 期望分辨率
633
+ * @property { number } ExpectWidth 期望分辨率
583
634
  */
584
635
  export interface IRoster {
585
636
  deviceType: IDeviceType;
@@ -601,6 +652,8 @@ export interface IRoster {
601
652
  id: string;
602
653
  extUserId: string;
603
654
  isLocal?: boolean;
655
+ ExpectHeight?: number;
656
+ ExpectWidth?: number;
604
657
  }
605
658
  /**
606
659
  * Layout Result布局结果中返回的基础数据
@@ -725,11 +778,11 @@ export interface ILocalLayout extends ILayout {
725
778
  isLocal: true;
726
779
  }
727
780
  /**
728
- * 自动布局模式下,Layout Cotnaienr的容器信息
781
+ * 自动布局模式下,Layout Container的容器信息
729
782
  * 计算得到的宽高能给铺满当前参会者的布局
730
783
  *
731
- * @property { number } width 减掉偏移左右值的container容器宽
732
- * @property { number } height 减掉偏移上下值的ontainer容器高
784
+ * @property { number } width 减掉偏移左右值的Container容器宽
785
+ * @property { number } height 减掉偏移上下值的Container容器高
733
786
  * @property { number } rateWidth 基于width配合 Layout Rate 计算得到的Layout Container容器宽
734
787
  * @property { number } rateHeight 基于height配合 Layout Rate 计算得到的Layout Container容器高
735
788
  */
@@ -802,22 +855,6 @@ export interface ICustomLayout {
802
855
  quality: IQualityType;
803
856
  mediagroupid: number;
804
857
  }
805
- /**
806
- * 1.x版本customLayoutSender所需的请流参数
807
- *
808
- * @property { number } pid 用户id,从roster中获取
809
- * @property { 'low' | 'normal' | 'high' | 'hd' } quality 请求视频质量
810
- * @param low 1 180P
811
- * @param normal 2 360P
812
- * @param high 3 720P
813
- * @param hd 4 1080P
814
- * @property { boolean } isContent 是否是共享内容,从roster中获取
815
- */
816
- export interface IThidrCustomLayout {
817
- pid: number;
818
- quality: 'low' | 'normal' | 'high' | 'hd';
819
- isContent: boolean;
820
- }
821
858
  /**
822
859
  * 封装MediaStream
823
860
  */
@@ -859,18 +896,21 @@ export interface ISubTitle {
859
896
  /**
860
897
  * 字幕规则
861
898
  *
899
+ * @property { string } content 字幕内容
900
+ * @property { string? } i18nKey 字幕内容key
862
901
  * @property { string? } fontFamily 字体
863
902
  * @property { string? } fontRGB 字体色
864
903
  * @property { "1" | "0" } scroll 是否滚动
865
904
  * @property { string? } action 动作
866
- * @property { string } location 位置'top' | 'middle' | 'bottom'
867
- * @property { string } fontSize 位置'small' | 'middle' | 'big'
868
- * @property { string } backgroundAlpha 背景色
869
- * @property { string } scrollSpeed 滚动速度
870
- * @property { string } content 字幕内容
871
- * @property { string } backgroundRGB 背景色
905
+ * @property { string? } location 位置'top' | 'middle' | 'bottom'
906
+ * @property { string? } fontSize 位置'small' | 'middle' | 'big'
907
+ * @property { string? } backgroundAlpha 背景色
908
+ * @property { string? } scrollSpeed 滚动速度
909
+ * @property { string? } backgroundRGB 背景色
872
910
  */
873
911
  export interface ISubTitleContent {
912
+ content: string;
913
+ i18nKey?: string;
874
914
  fontFamily?: string;
875
915
  fontRGB?: string;
876
916
  scroll?: '1' | '0';
@@ -879,7 +919,6 @@ export interface ISubTitleContent {
879
919
  fontSize?: 'small' | 'middle' | 'big';
880
920
  backgroundAlpha?: string;
881
921
  scrollSpeed?: string;
882
- content: string;
883
922
  backgroundRGB?: string;
884
923
  }
885
924
  export declare type IAudioRenders = {
@@ -892,6 +931,10 @@ export declare type IVideoRenders = {
892
931
  match?: boolean;
893
932
  };
894
933
  };
934
+ /**
935
+ * 同传字幕: 本地支持的语言
936
+ */
937
+ export declare type TLocalLanguage = typeof SupportLocalLanguages[number];
895
938
  export interface IOutputCustomLayout {
896
939
  [pid: string]: {
897
940
  resolution: number;
@@ -920,14 +963,144 @@ export interface IConference {
920
963
  * @property { 0 | 1 } bulkRosterType 全量roster类型,0表示全量数据,1表示增量数据
921
964
  * @property { IRoster[] } addRosterInfo 新增的roster信息 当bulkRosterType是0的时候,此参数表示全量数据
922
965
  * @property { IRoster[] } changeRosterInfo 变化的roster信息
923
- * @property { { participantId: string }[] } deleteRosterInfo 被删除的roster信息
966
+ * @property { { participantId: number }[] } deleteRosterInfo 被删除的roster信息
924
967
  */
925
968
  export interface IBulkRoster {
926
969
  bulkRosterType: 0 | 1;
927
970
  addRosterInfo: IRoster[];
928
971
  changeRosterInfo: IRoster[];
929
972
  deleteRosterInfo: {
930
- participantId: string;
973
+ participantId: number;
931
974
  }[];
932
975
  }
976
+ /**
977
+ * conf 会议属性
978
+ *
979
+ * @property { 'contentOnhold' } type 类型
980
+ * @property { string } audioTrackId content audio track id
981
+ * @property { string } contentUrl content uri
982
+ */
983
+ export interface IConfProperty {
984
+ type: 'contentOnhold';
985
+ audioTrackId?: string;
986
+ contentUrl?: string;
987
+ }
988
+ /**
989
+ * track 信息
990
+ *
991
+ * @property { string } streamId stream id
992
+ * @property { MediaStreamTrack } track
993
+ * @property { string } trackId track id
994
+ */
995
+ export interface ITrackInfo {
996
+ streamId: string;
997
+ track: MediaStreamTrack;
998
+ trackId: string;
999
+ }
1000
+ /**
1001
+ * ws close reason
1002
+ */
1003
+ export declare type TErrorReason<P = {}> = P & {
1004
+ code?: number;
1005
+ };
1006
+ /**
1007
+ * 是否静音
1008
+ *
1009
+ * @enum
1010
+ *
1011
+ * @property {number} AutoMute.SMART 智能静音
1012
+ * @property {number} AutoMute.ALL 全部静音
1013
+ * @property {number} AutoMute.NOT 不静音
1014
+ * @property {number} AutoMute.FORCE 强制静音
1015
+ */
1016
+ export declare enum AutoMute {
1017
+ SMART = 0,
1018
+ ALL = 1,
1019
+ NOT = 2,
1020
+ FORCE = 3
1021
+ }
1022
+ export interface IGetConferenceParams {
1023
+ autoMute: AutoMute;
1024
+ }
1025
+ /**
1026
+ * 录制结果上报
1027
+ *
1028
+ * @property { string } reason stream id
1029
+ * @property { string } state
1030
+ * @property { boolean } isRecorded
1031
+ * @property { string } controlUri
1032
+ */
1033
+ export interface IRecordingStateChanged {
1034
+ reason: string;
1035
+ state: string;
1036
+ isRecorded: boolean;
1037
+ controlUri: string;
1038
+ reasonText: string;
1039
+ }
1040
+ /**
1041
+ * 录制状态上报
1042
+ *
1043
+ * @property { boolean } isStart stream id
1044
+ * @property { string } uri
1045
+ * @property { string } callUri
1046
+ * @property { string } callerUri
1047
+ * @property { string } status
1048
+ * @property { boolean } isLocal 是否是local开启的录制
1049
+ */
1050
+ export interface IRecordStatusNotification {
1051
+ isStart: Boolean;
1052
+ uri: string;
1053
+ callUri: string;
1054
+ callerUri: string;
1055
+ status: string;
1056
+ isLocal: boolean;
1057
+ }
1058
+ /**
1059
+ * 录制权限
1060
+ *
1061
+ * @property { boolean } authorize 权限
1062
+ * @property { string } recordingUrl 云会议室URI
1063
+ * @property { string? } developerMessage 云会议室的所属用户名称
1064
+ * @property { number? } errorCode 错误码
1065
+ * @property { string? } userMessage 错误信息
1066
+ */
1067
+ export interface IRecordPermission {
1068
+ authorize: boolean;
1069
+ recordingUrl: string;
1070
+ developerMessage?: string;
1071
+ errorCode?: number;
1072
+ userMessage?: string;
1073
+ }
1074
+ /**
1075
+ * 同传字幕内容
1076
+ *
1077
+ * @property { number } pid 当前说话的终端
1078
+ * @property { string } src 原文
1079
+ * @property { string } target 译文
1080
+ * @property { number } seTime 发送时间
1081
+ * @property { number } startTime 开始时间
1082
+ * @property { number } endTime 结束时间
1083
+ * @property { boolean } isEnd 一句话是否结束
1084
+ * @property { boolean } isActive 活跃标志,收三路,同时只有一路active
1085
+ * @property { string } url 终端calluri
1086
+ * @property { string } dn 显示名称
1087
+ * @property { string } meetingId 会议号
1088
+ * @property { string } srcLang 原语言,zh表示中文,en表示英文
1089
+ * @property { string } targetLang 译文语言,zh表示中文,en表示英文
1090
+ */
1091
+ export interface ITranslationContent {
1092
+ pid: number;
1093
+ src: string;
1094
+ target: string;
1095
+ seTime: number;
1096
+ startTime: number;
1097
+ endTime: number;
1098
+ isEnd: boolean;
1099
+ isActive: boolean;
1100
+ url: string;
1101
+ dn: string;
1102
+ meetingId: string;
1103
+ srcLang: string;
1104
+ targetLang: string;
1105
+ }
933
1106
  export {};
@@ -4,10 +4,10 @@
4
4
  * @value granted 已授权
5
5
  * @value denied 已拒绝
6
6
  * @value prompt 询问中
7
- * @value unknow 未知
7
+ * @value unknown 未知
8
8
  * @value '' 默认
9
9
  */
10
- export declare type TPermissionType = 'granted' | 'denied' | 'prompt' | 'unknow' | 'failed' | '';
10
+ export declare type TPermissionType = 'granted' | 'denied' | 'prompt' | 'unknown' | 'failed' | '';
11
11
  /**
12
12
  * 获取设备信息
13
13
  *
@@ -1,5 +1,5 @@
1
1
  /**
2
- * WebRTC SDK Lib TypeScript Decelare
2
+ * WebRTC SDK Lib TypeScript Declare
3
3
  *
4
4
  * @authors luojinghui (luojinghui424@gmail.com)
5
5
  * chengfei (chengfei@xylink.com)
@@ -0,0 +1,77 @@
1
+ /**
2
+ * 会议质量上报 基础数据
3
+ *
4
+ * @property { string } callNumber 会议号callUri
5
+ * @property { string } deviceId
6
+ * @property { string } meetingId 会议ID
7
+ * @property { string } osVersion 终端系统版本; 目前上报的是navigator.userAgent
8
+ * @property { string } sockProto 终端接入协议方式 udpProto
9
+ * @property { string } swVersion 终端软件版本
10
+ * @property { string } cdrVersion 统计版本号 目前传的是10
11
+ * @property { string } deviceType 设备类型 17
12
+ *
13
+ */
14
+ export interface IMeetingQualityData {
15
+ callNumber: string;
16
+ deviceId: string;
17
+ meetingId: string;
18
+ osVersion: string;
19
+ sockProto: string;
20
+ swVersion: string;
21
+ cdrVersion: number;
22
+ deviceType: number;
23
+ }
24
+ /**
25
+ * video 数据
26
+ *
27
+ * @property { number } fr 帧率
28
+ * @property { number } height 高
29
+ * @property { number } width 宽
30
+ */
31
+ export interface IQualityVideoStream {
32
+ fr: number;
33
+ height: number;
34
+ width: number;
35
+ }
36
+ /**
37
+ * 远端video数据
38
+ *
39
+ * @property { number } participantId
40
+ * @property { IQualityVideoStream[] } videoStream
41
+ */
42
+ export interface IQualityRecvStreams {
43
+ participantId: number;
44
+ videoStream: IQualityVideoStream[];
45
+ }
46
+ /**
47
+ * 本地发送video数据
48
+ *
49
+ * @property { string } callUri
50
+ * @property { number } participantId
51
+ * @property { number } sessionId 媒体提供
52
+ * @property { IQualityVideoStream[] } audioStream
53
+ * @property { IQualityVideoStream[] } videoStream
54
+ */
55
+ export interface IQualitySendStreams {
56
+ callUri: string;
57
+ participantId: number;
58
+ sessionId: number;
59
+ audioStream: IQualityVideoStream[];
60
+ videoStream: IQualityVideoStream[];
61
+ }
62
+ /**
63
+ * video质量相关数据 统计相同分辨率的路数、平均帧率
64
+ *
65
+ * @property { number } Height 分辨率-高
66
+ * @property { number } Width 分辨率-宽
67
+ * @property { number } framerate 当前分辨率4s内平均帧率
68
+ * @property { number } resNum 当前分辨率的路数
69
+ * @property { number } resolution 分辨率 【似乎没用】
70
+ */
71
+ export interface IVideoQuality {
72
+ Height: number;
73
+ Width: number;
74
+ framerate: number;
75
+ resNum: number;
76
+ resolution: number;
77
+ }