@xylink/xy-rtc-sdk 2.1.2-beta.7 → 3.8.0-beta.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.
Files changed (49) hide show
  1. package/README.MD +2 -37
  2. package/lib/{src/action → action}/index.d.ts +237 -230
  3. package/lib/{src/enum → enum}/contraints.d.ts +116 -115
  4. package/lib/{src/enum → enum}/errorCode.d.ts +880 -880
  5. package/lib/{src/enum → enum}/index.d.ts +137 -133
  6. package/lib/{src/index.d.ts → index.d.ts} +34 -34
  7. package/lib/{src/main → main}/client.d.ts +878 -797
  8. package/lib/{src/main → main}/deviceManager.d.ts +164 -165
  9. package/lib/{src/main → main}/helper.d.ts +51 -51
  10. package/lib/{src/main → main}/iauth.d.ts +33 -33
  11. package/lib/{src/main → main}/layoutManager.d.ts +214 -214
  12. package/lib/{src/main → main}/peer.d.ts +311 -295
  13. package/lib/{src/main → main}/qualityManager.d.ts +39 -39
  14. package/lib/{src/main → main}/stream.d.ts +263 -243
  15. package/lib/{src/main → main}/videoManager.d.ts +65 -65
  16. package/lib/{src/tools → tools}/audioLevel.d.ts +23 -23
  17. package/lib/{src/tools → tools}/browser.d.ts +55 -55
  18. package/lib/{src/tools → tools}/config.d.ts +12 -12
  19. package/lib/{src/tools → tools}/db.d.ts +85 -84
  20. package/lib/tools/detect.d.ts +44 -0
  21. package/lib/{src/tools → tools}/emmitter.d.ts +15 -15
  22. package/lib/{src/tools → tools}/enum.d.ts +6 -6
  23. package/lib/{src/tools → tools}/httpClient.d.ts +64 -61
  24. package/lib/{src/tools → tools}/i18n.d.ts +8 -8
  25. package/lib/{src/tools → tools}/index.d.ts +8 -3
  26. package/lib/{src/tools → tools}/logger.d.ts +151 -151
  27. package/lib/{src/tools → tools}/socket.d.ts +53 -50
  28. package/lib/{src/tools → tools}/store.d.ts +15 -15
  29. package/lib/{src/tools → tools}/template.d.ts +14 -14
  30. package/lib/{src/tools → tools}/utils.d.ts +73 -67
  31. package/lib/{src/tools → tools}/verify.d.ts +7 -7
  32. package/lib/{src/type → type}/base.d.ts +71 -67
  33. package/lib/{src/type → type}/client.d.ts +1121 -1106
  34. package/lib/{src/type → type}/device.d.ts +77 -77
  35. package/lib/{src/type → type}/index.d.ts +11 -11
  36. package/lib/{src/type → type}/quality.d.ts +77 -77
  37. package/lib/{src/type → type}/stream.d.ts +426 -422
  38. package/lib/xyrtc.cjs.js +1 -0
  39. package/lib/xyrtc.umd.js +1 -0
  40. package/package.json +43 -54
  41. package/scripts/build_lib.js +16 -0
  42. package/scripts/utils.js +27 -0
  43. package/scripts/webpack.common.js +139 -0
  44. package/scripts/webpack.dev.js +27 -0
  45. package/scripts/webpack.sdk.js +68 -0
  46. package/tsconfig.lib.json +37 -0
  47. package/lib/index.es.js +0 -3
  48. package/lib/index.js +0 -3
  49. package/lib/src/tools/detect.d.ts +0 -19
@@ -1,65 +1,65 @@
1
- /**
2
- * XYLink WebRTC Video Manager Lib
3
- *
4
- * @summary render video stream
5
- * @author jinghui-Luo
6
- *
7
- * Created at : 2020-12-18 16:54:15
8
- * Last modified : 2022-06-09 17:42:49
9
- */
10
- import Logger from '../tools/logger';
11
- declare class VideoManager {
12
- videoEle: HTMLVideoElement | null;
13
- state: '' | 'CANPLAY' | 'ENDED' | 'REQUEST';
14
- private key;
15
- private wrapEleId;
16
- private cb;
17
- private stream;
18
- private streamId;
19
- private loadStatus;
20
- private streamStatus;
21
- private streamStatusTimmer;
22
- private streamTimmerCountDown;
23
- private logger;
24
- private isContent;
25
- constructor(logger?: Logger, isContent?: boolean);
26
- /**
27
- * client set video stream data
28
- *
29
- * @param key endpointId + mediagroupId => pid
30
- * @param stream MediaStream or null
31
- */
32
- initVideoStreamById(key: string, stream: MediaStream | null): void;
33
- getVideoTracks(): MediaStreamTrack[];
34
- updateLocalTrack(): void;
35
- private initVideoSource;
36
- private setSrcObject;
37
- private initEventListener;
38
- private removeEventListener;
39
- private initStreamTrackEventListener;
40
- private removeStreamTrackEventListener;
41
- isHaveSrcObject(): MediaProvider | null;
42
- setSource(key: string, wrapEleId: string): void;
43
- destroy(): void;
44
- setVideoStatusChange(cb: any): void;
45
- private onEnded;
46
- /**
47
- * mute到unmute的变换可能会很迅速,所以1s以内的变换可以使用freeze替代
48
- */
49
- private onMute;
50
- private onUnmute;
51
- private onSuspend;
52
- private onWaiting;
53
- private onStalled;
54
- private onLoadeddata;
55
- private onVideoEnded;
56
- private onEmptied;
57
- private onAbort;
58
- private onCanPlay;
59
- private onLoadStart;
60
- private onError;
61
- private clearTrackStatusTimmer;
62
- private sendVideoStatus;
63
- private emmit;
64
- }
65
- export default VideoManager;
1
+ /**
2
+ * XYLink WebRTC Video Manager Lib
3
+ *
4
+ * @summary render video stream
5
+ * @author jinghui-Luo
6
+ *
7
+ * Created at : 2020-12-18 16:54:15
8
+ * Last modified : 2022-08-31 20:10:23
9
+ */
10
+ import Logger from '../tools/logger';
11
+ declare class VideoManager {
12
+ videoEle: HTMLVideoElement | null;
13
+ state: '' | 'CANPLAY' | 'ENDED' | 'REQUEST';
14
+ private key;
15
+ private wrapEleId;
16
+ private cb;
17
+ private stream;
18
+ private streamId;
19
+ private loadStatus;
20
+ private streamStatus;
21
+ private streamStatusTimmer;
22
+ private streamTimmerCountDown;
23
+ private logger;
24
+ private isContent;
25
+ constructor(logger?: Logger, isContent?: boolean);
26
+ /**
27
+ * client set video stream data
28
+ *
29
+ * @param key endpointId + mediagroupId => pid
30
+ * @param stream MediaStream or null
31
+ */
32
+ initVideoStreamById(key: string, stream: MediaStream | null): void;
33
+ getVideoTracks(): MediaStreamTrack[];
34
+ updateLocalTrack(): void;
35
+ private initVideoSource;
36
+ private setSrcObject;
37
+ private initEventListener;
38
+ private removeEventListener;
39
+ private initStreamTrackEventListener;
40
+ private removeStreamTrackEventListener;
41
+ isHaveSrcObject(): MediaProvider | null;
42
+ setSource(key: string, wrapEleId: string): void;
43
+ destroy(): void;
44
+ setVideoStatusChange(cb: any): void;
45
+ private onEnded;
46
+ /**
47
+ * mute到unmute的变换可能会很迅速,所以1s以内的变换可以使用freeze替代
48
+ */
49
+ private onMute;
50
+ private onUnmute;
51
+ private onSuspend;
52
+ private onWaiting;
53
+ private onStalled;
54
+ private onLoadeddata;
55
+ private onVideoEnded;
56
+ private onEmptied;
57
+ private onAbort;
58
+ private onCanPlay;
59
+ private onLoadStart;
60
+ private onError;
61
+ private clearTrackStatusTimmer;
62
+ private sendVideoStatus;
63
+ private emmit;
64
+ }
65
+ export default VideoManager;
@@ -1,23 +1,23 @@
1
- /**
2
- * Audio Level class
3
- *
4
- * get audio level
5
- *
6
- * @authors Luo-jinghui (luojinghui424@gmail.com)
7
- * @date 2019-11-08 16:03:15
8
- */
9
- export declare class AudioLevel {
10
- level: number;
11
- private stream;
12
- private audioContext;
13
- private analyser;
14
- private sourceNode;
15
- private timeDomainData;
16
- constructor(stream: MediaStream);
17
- /**
18
- * 获取声音level数据。
19
- * rang: 0-100
20
- */
21
- getAudioLevel(): number;
22
- init(): void;
23
- }
1
+ /**
2
+ * Audio Level class
3
+ *
4
+ * get audio level
5
+ *
6
+ * @authors Luo-jinghui (luojinghui424@gmail.com)
7
+ * @date 2019-11-08 16:03:15
8
+ */
9
+ export declare class AudioLevel {
10
+ level: number;
11
+ private stream;
12
+ private audioContext;
13
+ private analyser;
14
+ private sourceNode;
15
+ private timeDomainData;
16
+ constructor(stream: MediaStream);
17
+ /**
18
+ * 获取声音level数据。
19
+ * rang: 0-100
20
+ */
21
+ getAudioLevel(): number;
22
+ init(): void;
23
+ }
@@ -1,55 +1,55 @@
1
- /**
2
- * Browser version tools
3
- *
4
- * @authors Luo-jinghui (luojinghui424@gmail.com)
5
- * @date 2020-02-21 16:29:12
6
- */
7
- export declare const platform: () => {
8
- isTablet: boolean;
9
- isPhone: boolean;
10
- isAndroid: boolean;
11
- isPc: boolean;
12
- isMac: boolean;
13
- isWindows: boolean;
14
- isIPad: boolean;
15
- isChrome: boolean;
16
- isLinux: boolean;
17
- isFirefox: boolean;
18
- isBaidu: boolean;
19
- isQQ: boolean;
20
- isOpera: boolean;
21
- isZhazha: boolean;
22
- isEdge: boolean;
23
- isSafari: boolean;
24
- isHuaweiBrowser: boolean;
25
- };
26
- export declare const getChromeVersion: () => {
27
- major: any;
28
- minor: any;
29
- build: any;
30
- patch: any;
31
- } | undefined;
32
- export declare const getEdgeVersion: () => {
33
- major: any;
34
- minor: any;
35
- build: any;
36
- } | undefined;
37
- export declare const getSafariVersion: () => {
38
- major: any;
39
- minor: any;
40
- } | undefined;
41
- export declare const getFirefoxVersion: () => {
42
- major: any;
43
- minor: any;
44
- } | undefined;
45
- export declare const getAndroidVersion: () => {
46
- major: any;
47
- minor: any;
48
- } | undefined;
49
- export declare const getIOSVersion: () => {
50
- major: any;
51
- minor: any;
52
- } | undefined;
53
- export declare const getVersion: () => number;
54
- export declare const isPC: boolean;
55
- export declare const isMobile: boolean;
1
+ /**
2
+ * Browser version tools
3
+ *
4
+ * @authors Luo-jinghui (luojinghui424@gmail.com)
5
+ * @date 2020-02-21 16:29:12
6
+ */
7
+ export declare const platform: () => {
8
+ isTablet: boolean;
9
+ isPhone: boolean;
10
+ isAndroid: boolean;
11
+ isPc: boolean;
12
+ isMac: boolean;
13
+ isWindows: boolean;
14
+ isIPad: boolean;
15
+ isChrome: boolean;
16
+ isLinux: boolean;
17
+ isFirefox: boolean;
18
+ isBaidu: boolean;
19
+ isQQ: boolean;
20
+ isOpera: boolean;
21
+ isZhazha: boolean;
22
+ isEdge: boolean;
23
+ isSafari: boolean;
24
+ isHuaweiBrowser: boolean;
25
+ };
26
+ export declare const getChromeVersion: () => {
27
+ major: any;
28
+ minor: any;
29
+ build: any;
30
+ patch: any;
31
+ } | undefined;
32
+ export declare const getEdgeVersion: () => {
33
+ major: any;
34
+ minor: any;
35
+ build: any;
36
+ } | undefined;
37
+ export declare const getSafariVersion: () => {
38
+ major: any;
39
+ minor: any;
40
+ } | undefined;
41
+ export declare const getFirefoxVersion: () => {
42
+ major: any;
43
+ minor: any;
44
+ } | undefined;
45
+ export declare const getAndroidVersion: () => {
46
+ major: any;
47
+ minor: any;
48
+ } | undefined;
49
+ export declare const getIOSVersion: () => {
50
+ major: any;
51
+ minor: any;
52
+ } | undefined;
53
+ export declare const getVersion: () => number;
54
+ export declare const isPC: boolean;
55
+ export declare const isMobile: boolean;
@@ -1,12 +1,12 @@
1
- /**
2
- * XyRTC config list
3
- *
4
- * @authors Luo-jinghui (luojinghui424@gmail.com)
5
- * @date 2019-10-24 14:06:05
6
- */
7
- export declare const version = "2.1.2-beta.7 - build on 2022-08-01 17:25";
8
- export declare const proxy: {
9
- wssHost: string;
10
- restHost: string;
11
- logHost: string;
12
- };
1
+ /**
2
+ * XyRTC config list
3
+ *
4
+ * @authors Luo-jinghui (luojinghui424@gmail.com)
5
+ * @date 2019-10-24 14:06:05
6
+ */
7
+ export declare const version: any;
8
+ export declare const proxy: {
9
+ wssHost: string;
10
+ restHost: string;
11
+ logHost: string;
12
+ };
@@ -1,84 +1,85 @@
1
- /**
2
- * webrtc log db 数据库
3
- *
4
- * @authors Luo-jinghui (luojinghui424@gmail.com)
5
- * @date 2020-02-27 18:17:49
6
- */
7
- declare class DB {
8
- db: any;
9
- num: number;
10
- dbName: string;
11
- tableCount: number;
12
- tableName: string;
13
- constructor(tableCount?: number, tableName?: string, dbName?: string);
14
- /**
15
- * 表 添加数据
16
- *
17
- * @param data
18
- */
19
- add(data: any): Promise<void>;
20
- deleteDB(): Promise<void>;
21
- close(): void;
22
- stop(): void;
23
- isOpen(): any;
24
- /**
25
- * 本地下载日志
26
- *
27
- * @returns { boolean } 日志下载是否成功
28
- */
29
- export(): Promise<boolean>;
30
- /**
31
- * 日志上传
32
- *
33
- * @param { string } displayName 上传文件名
34
- * @returns
35
- */
36
- upload(displayName: string): Promise<Blob | null>;
37
- progressCallback({ totalRows, completedRows }: any): boolean;
38
- open(): void;
39
- /**
40
- * 初始化db
41
- */
42
- init(): Promise<void>;
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;
75
- /**
76
- * Generate zip blob use json's blob async
77
- *
78
- * @param blob origin json blob data
79
- * @param time current time
80
- * @param displayName file's name
81
- */
82
- private generateZipBlobAsync;
83
- }
84
- export default DB;
1
+ /**
2
+ * webrtc log db 数据库
3
+ *
4
+ * @authors Luo-jinghui (luojinghui424@gmail.com)
5
+ * @date 2020-02-27 18:17:49
6
+ */
7
+ declare class DB {
8
+ db: any;
9
+ num: number;
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
+ */
20
+ add(data: any): Promise<void>;
21
+ deleteDB(): Promise<void>;
22
+ close(): void;
23
+ stop(): void;
24
+ isOpen(): any;
25
+ /**
26
+ * 本地下载日志
27
+ *
28
+ * @returns { boolean } 日志下载是否成功
29
+ */
30
+ export(): Promise<boolean>;
31
+ /**
32
+ * 日志上传
33
+ *
34
+ * @param { string } displayName 上传文件名
35
+ * @returns
36
+ */
37
+ upload(displayName: string): Promise<Blob | null>;
38
+ progressCallback({ totalRows, completedRows }: any): boolean;
39
+ open(): void;
40
+ /**
41
+ * 初始化db
42
+ */
43
+ init(): Promise<void>;
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;
76
+ /**
77
+ * Generate zip blob use json's blob async
78
+ *
79
+ * @param blob origin json blob data
80
+ * @param time current time
81
+ * @param displayName file's name
82
+ */
83
+ private generateZipBlobAsync;
84
+ }
85
+ export default DB;
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Detect 检测浏览器支持情况
3
+ * @authors Luo-jinghui (luojinghui424@gmail.com)
4
+ * @date 2019-10-22 11:11:55
5
+ */
6
+ interface ISupportFeature {
7
+ isSupportRTC: boolean;
8
+ isSupportAddtrack: boolean;
9
+ isSupportAddTransceiver: boolean;
10
+ isSupportReplaceTrack: boolean;
11
+ isApplyConstraints: boolean;
12
+ isSupportSetStreams: boolean;
13
+ }
14
+ interface ISupportTest {
15
+ isSupportPeer: boolean;
16
+ isSupportAddtrack: boolean;
17
+ isSupportAddTransceiver: boolean;
18
+ isSupportReplaceTrack: boolean;
19
+ isApplyConstraints: boolean;
20
+ isSupportSetStreams: boolean;
21
+ }
22
+ export declare const detect: {
23
+ isMinBrowser: () => boolean;
24
+ isMobile: () => boolean;
25
+ isFirefox: () => boolean;
26
+ isSupportReauthorize: () => boolean;
27
+ isSupportAppendTrack: () => boolean;
28
+ isSupportUserMedia: () => boolean;
29
+ isSupportRTC: (videoCapture?: MediaStream) => Promise<ISupportFeature>;
30
+ isSupportPeerCB: (videoCapture?: MediaStream) => Promise<ISupportTest>;
31
+ isSupportWebsocket: () => boolean;
32
+ isSupportMedia: () => boolean;
33
+ isSupportH264: () => Promise<boolean>;
34
+ osVersion: () => string;
35
+ /**
36
+ * 获取浏览器当前网络信息
37
+ * 兼容:Chrome、Edge,不兼容:Safari、Firefox
38
+ *
39
+ * @returns { undefined | NetworkInformation } 网络信息
40
+ */
41
+ getNetWork: () => any;
42
+ };
43
+ export declare const isFirefox: boolean;
44
+ export {};
@@ -1,15 +1,15 @@
1
- /**
2
- * Event Emmitter
3
- *
4
- * @authors Luo-jinghui (luojinghui424@gmail.com)
5
- * @date 2019-10-17 19:14:39
6
- */
7
- export default class Emmitter {
8
- private events;
9
- constructor();
10
- on(key: string, listener: Function, total?: number): void;
11
- once(key: string, listener: Function, total?: number): void;
12
- removeListener(key: string): void;
13
- removeAllListener(): void;
14
- emmit<T>(key: string, ...args: T[]): void;
15
- }
1
+ /**
2
+ * Event Emmitter
3
+ *
4
+ * @authors Luo-jinghui (luojinghui424@gmail.com)
5
+ * @date 2019-10-17 19:14:39
6
+ */
7
+ export default class Emmitter {
8
+ private events;
9
+ constructor();
10
+ on(key: string, listener: Function, total?: number): void;
11
+ once(key: string, listener: Function, total?: number): void;
12
+ removeListener(key: string): void;
13
+ removeAllListener(): void;
14
+ emmit<T>(key: string, ...args: T[]): void;
15
+ }
@@ -1,6 +1,6 @@
1
- import { TLocale } from 'src/type';
2
- export declare const FailEnumMap: {
3
- [key in TLocale]: {
4
- [key: string]: string;
5
- };
6
- };
1
+ import { TLocale } from 'src/type';
2
+ export declare const FailEnumMap: {
3
+ [key in TLocale]: {
4
+ [key: string]: string;
5
+ };
6
+ };