@realsee/live 0.6.14 → 0.7.0

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 (163) hide show
  1. package/README.md +50 -55
  2. package/dist/index.cjs.js +89 -24
  3. package/dist/index.d.cts +1336 -0
  4. package/dist/index.d.ts +1336 -4
  5. package/dist/index.esm.js +30 -0
  6. package/docs/README.md +435 -0
  7. package/docs/classes/BrowserRTC.md +436 -0
  8. package/docs/classes/BrowserRTC4Chime.md +558 -0
  9. package/docs/classes/CoreRTC.md +448 -0
  10. package/docs/classes/Live.md +797 -0
  11. package/docs/classes/Subscribe.md +211 -0
  12. package/docs/classes/VRWebViewRTC.md +436 -0
  13. package/docs/enumerations/BuiltInRTCType.md +27 -0
  14. package/docs/enumerations/BuiltinActionType.md +81 -0
  15. package/docs/enumerations/BuiltinEventType.md +33 -0
  16. package/docs/enumerations/Command.md +107 -0
  17. package/docs/enumerations/LiveState.md +53 -0
  18. package/docs/enumerations/MemUserStatus.md +67 -0
  19. package/docs/enumerations/MicroStatus.md +33 -0
  20. package/docs/enumerations/RTCJoinedInfoCodeEnum.md +69 -0
  21. package/docs/enumerations/RTCType.md +39 -0
  22. package/docs/enumerations/UserStatus.md +45 -0
  23. package/docs/enumerations/WebSocketCloseError.md +117 -0
  24. package/docs/enumerations/WebSocketErrorType.md +77 -0
  25. package/docs/enumerations/WebSocketState.md +69 -0
  26. package/docs/functions/GetVoiceSignFn.md +27 -0
  27. package/docs/functions/clearLiveInstanceIfNeed.md +17 -0
  28. package/docs/functions/createLive.md +27 -0
  29. package/docs/functions/createLiveReact.md +449 -0
  30. package/docs/functions/parseLiveMsg.md +27 -0
  31. package/docs/functions/parseWSClsErr.md +21 -0
  32. package/docs/globals.md +77 -0
  33. package/docs/interfaces/AttendeeResponse.md +37 -0
  34. package/docs/interfaces/LiveOptions.md +246 -0
  35. package/docs/interfaces/MeetingResponse.md +55 -0
  36. package/docs/interfaces/MeetingSessionConfigurationOptions.md +93 -0
  37. package/docs/interfaces/Permission.md +147 -0
  38. package/docs/interfaces/RTCJoinedInfo.md +67 -0
  39. package/docs/interfaces/RTCProtocol.md +404 -0
  40. package/docs/interfaces/VRWebViewRTCOptions.md +41 -0
  41. package/docs/namespaces/SubscribeMixinType/README.md +17 -0
  42. package/docs/namespaces/SubscribeMixinType/interfaces/emit.md +31 -0
  43. package/docs/namespaces/SubscribeMixinType/interfaces/hasListener.md +25 -0
  44. package/docs/namespaces/SubscribeMixinType/interfaces/off.md +31 -0
  45. package/docs/namespaces/SubscribeMixinType/interfaces/on.md +37 -0
  46. package/docs/namespaces/SubscribeMixinType/interfaces/once.md +35 -0
  47. package/docs/type-aliases/BuiltinMsg.md +41 -0
  48. package/docs/type-aliases/EventMap.md +17 -0
  49. package/docs/type-aliases/EventType.md +19 -0
  50. package/docs/type-aliases/GetVoiceSign.md +15 -0
  51. package/docs/type-aliases/GetVoiceSignParams.md +35 -0
  52. package/docs/type-aliases/GetVoiceSignReturnType.md +41 -0
  53. package/docs/type-aliases/KeyframeEventType.md +19 -0
  54. package/docs/type-aliases/LiveBuiltInData.md +47 -0
  55. package/docs/type-aliases/LiveConnectOptions.md +47 -0
  56. package/docs/type-aliases/LiveEventType.md +165 -0
  57. package/docs/type-aliases/LiveMsg.md +53 -0
  58. package/docs/type-aliases/LiveProviderPropTypes.md +27 -0
  59. package/docs/type-aliases/RTCActionReactCallback.md +13 -0
  60. package/docs/type-aliases/RTCEventType.md +65 -0
  61. package/docs/type-aliases/ReqLiveMsg.md +45 -0
  62. package/docs/type-aliases/RoomInfo.md +55 -0
  63. package/docs/type-aliases/UserInfo.md +77 -0
  64. package/docs/type-aliases/UserInfoExt.md +33 -0
  65. package/docs/type-aliases/UserVolume.md +25 -0
  66. package/docs/type-aliases/WebSocketError.md +31 -0
  67. package/package.json +41 -31
  68. package/dist/index.cjs.js.map +0 -1
  69. package/dist/index.es.js +0 -2179
  70. package/dist/index.es.js.map +0 -1
  71. package/dist/live/controller.d.ts +0 -90
  72. package/dist/live/createLive.d.ts +0 -8
  73. package/dist/live/createLiveReact.d.ts +0 -52
  74. package/dist/live/live.d.ts +0 -182
  75. package/dist/rtc/BrowserRTC.d.ts +0 -39
  76. package/dist/rtc/BrowserRTC4Chime.d.ts +0 -60
  77. package/dist/rtc/CoreRTC.d.ts +0 -23
  78. package/dist/rtc/VRWebViewRTC.d.ts +0 -22
  79. package/dist/rtc/index.d.ts +0 -5
  80. package/dist/typings/chime/AttendeeResponse.d.ts +0 -5
  81. package/dist/typings/chime/MeetingResponse.d.ts +0 -12
  82. package/dist/typings/chime/MeetingSessionConfigurationOptions.d.ts +0 -16
  83. package/dist/typings/chime/index.d.ts +0 -3
  84. package/dist/typings/index.d.ts +0 -4
  85. package/dist/typings/live/EventType.d.ts +0 -74
  86. package/dist/typings/live/GetVoiceSign.d.ts +0 -17
  87. package/dist/typings/live/LiveConnectOptions.d.ts +0 -7
  88. package/dist/typings/live/LiveMsg.d.ts +0 -119
  89. package/dist/typings/live/LiveOptions.d.ts +0 -79
  90. package/dist/typings/live/LiveState.d.ts +0 -15
  91. package/dist/typings/live/RoomInfo.d.ts +0 -13
  92. package/dist/typings/live/UserInfo.d.ts +0 -103
  93. package/dist/typings/live/UserVolume.d.ts +0 -7
  94. package/dist/typings/live/WebSocket.d.ts +0 -82
  95. package/dist/typings/live/index.d.ts +0 -10
  96. package/dist/typings/react/RTCActionReactCallback.d.ts +0 -2
  97. package/dist/typings/react/index.d.ts +0 -1
  98. package/dist/typings/rtc/VRWebViewRTCOptions.d.ts +0 -6
  99. package/dist/typings/rtc/eventType.d.ts +0 -29
  100. package/dist/typings/rtc/index.d.ts +0 -5
  101. package/dist/typings/rtc/joinedInfo.d.ts +0 -34
  102. package/dist/typings/rtc/protocol.d.ts +0 -58
  103. package/dist/typings/rtc/type.d.ts +0 -12
  104. package/dist/utils/RobustWebSocket.d.ts +0 -157
  105. package/dist/utils/appendUri.d.ts +0 -1
  106. package/dist/utils/clientDetector.d.ts +0 -4
  107. package/dist/utils/equal.d.ts +0 -10
  108. package/dist/utils/logger.d.ts +0 -16
  109. package/dist/utils/subscribe.d.ts +0 -75
  110. package/dist/utils/uuid.d.ts +0 -4
  111. package/docs/.nojekyll +0 -1
  112. package/docs/assets/highlight.css +0 -120
  113. package/docs/assets/main.js +0 -58
  114. package/docs/assets/search.js +0 -1
  115. package/docs/assets/style.css +0 -1280
  116. package/docs/classes/BrowserRTC.html +0 -561
  117. package/docs/classes/BrowserRTC4Chime.html +0 -602
  118. package/docs/classes/CoreRTC.html +0 -432
  119. package/docs/classes/VRWebViewRTC.html +0 -448
  120. package/docs/enums/BuiltInRTCType.html +0 -69
  121. package/docs/enums/BuiltinActionType.html +0 -112
  122. package/docs/enums/BuiltinEventType.html +0 -76
  123. package/docs/enums/Command.html +0 -118
  124. package/docs/enums/LiveState.html +0 -89
  125. package/docs/enums/MemUserStatus.html +0 -97
  126. package/docs/enums/MicroStatus.html +0 -72
  127. package/docs/enums/RTCJoinedInfoCodeEnum.html +0 -94
  128. package/docs/enums/RTCType.html +0 -79
  129. package/docs/enums/UserStatus.html +0 -85
  130. package/docs/enums/WebSocketCloseError.html +0 -139
  131. package/docs/enums/WebSocketErrorType.html +0 -104
  132. package/docs/enums/WebSocketState.html +0 -103
  133. package/docs/functions/createLive.html +0 -107
  134. package/docs/functions/createLiveReact.html +0 -575
  135. package/docs/functions/parseLiveMsg.html +0 -105
  136. package/docs/functions/parseWSClsErr.html +0 -99
  137. package/docs/index.html +0 -470
  138. package/docs/interfaces/AttendeeResponse.html +0 -80
  139. package/docs/interfaces/GetVoiceSignReturnType.html +0 -90
  140. package/docs/interfaces/LiveOptions.html +0 -272
  141. package/docs/interfaces/MeetingResponse.html +0 -90
  142. package/docs/interfaces/MeetingSessionConfigurationOptions.html +0 -119
  143. package/docs/interfaces/Permission.html +0 -157
  144. package/docs/interfaces/RTCJoinedInfo.html +0 -104
  145. package/docs/interfaces/RTCProtocol.html +0 -412
  146. package/docs/interfaces/VRWebViewRTCOptions.html +0 -73
  147. package/docs/modules.html +0 -148
  148. package/docs/types/BuiltinMsg.html +0 -108
  149. package/docs/types/EventType.html +0 -97
  150. package/docs/types/GetVoiceSign.html +0 -124
  151. package/docs/types/KeyframeTypes.html +0 -97
  152. package/docs/types/LiveConnectOptions.html +0 -107
  153. package/docs/types/LiveEventType.html +0 -272
  154. package/docs/types/LiveMsg.html +0 -113
  155. package/docs/types/LiveProviderPropTypes.html +0 -102
  156. package/docs/types/RTCActionReactCallback.html +0 -90
  157. package/docs/types/RTCEventType.html +0 -155
  158. package/docs/types/ReqLiveMsg.html +0 -114
  159. package/docs/types/RoomInfo.html +0 -114
  160. package/docs/types/UserInfo.html +0 -135
  161. package/docs/types/UserInfoExt.html +0 -105
  162. package/docs/types/UserVolume.html +0 -99
  163. package/docs/types/WebSocketError.html +0 -101
@@ -1,52 +0,0 @@
1
- import React from 'react';
2
- import { BuiltinActionType, BuiltinEventType, KeyframeTypes, LiveConnectOptions, LiveEventType, LiveOptions, MicroStatus, RTCEventType, RTCType, UserInfo } from '../typings';
3
- import { LiveState } from '../typings/live/LiveState';
4
- import { Live } from './live';
5
- export type LiveProviderPropTypes<KeyframesSnapshot extends Record<string, any>> = {
6
- children?: React.ReactNode;
7
- live?: Live<KeyframesSnapshot>;
8
- };
9
- /**
10
- * 创建 {@link LiveReact} 实例,并提供 `React` 技术栈相关工具链。
11
- */
12
- export declare function createLiveReact<KeyframesSnapshot extends Record<string, any>>(options: LiveOptions): {
13
- live: Live<KeyframesSnapshot>;
14
- jsBridge: import("@realsee/jsbridge-x").JSBridgeProtocol;
15
- LiveProvider: (props: LiveProviderPropTypes<KeyframesSnapshot>) => JSX.Element;
16
- unsafe__useLiveInstance: () => Live<KeyframesSnapshot>;
17
- unsafe__useRTCInstance: () => import("../typings").RTCProtocol;
18
- useConnect: () => (options: LiveConnectOptions) => Promise<boolean | Error>;
19
- useKeyframe: <K extends keyof KeyframesSnapshot>(key: K) => [frame: KeyframesSnapshot[K] | undefined, setFrame: (frame: KeyframesSnapshot[K]) => boolean | Error];
20
- useKeyframeUpdateCallback: <KeyOfKeyframe extends keyof KeyframeTypes<KeyframesSnapshot>>(key: KeyOfKeyframe, callback: (...args: Parameters<KeyframeTypes<KeyframesSnapshot>[KeyOfKeyframe]>) => ReturnType<KeyframeTypes<KeyframesSnapshot>[KeyOfKeyframe]>, deps?: React.DependencyList) => () => void;
21
- useLiveAction: () => {
22
- connect: (options: LiveConnectOptions) => Promise<boolean | Error>;
23
- broadcast: (data: Record<string, any>, toUserIds: string | string[], timeout?: number) => Promise<unknown>;
24
- exit: () => Promise<void>;
25
- kick: (toUserIds: string | string[]) => Promise<boolean>;
26
- toggleMicro: (microStatus: boolean) => Promise<boolean>;
27
- forbidMicro: (micro: MicroStatus, toUserIds?: string | string[]) => Promise<boolean>;
28
- forbidSync: (sync: boolean, toUserIds?: string | string[]) => Promise<boolean>;
29
- sendKeyframe: (key: keyof KeyframesSnapshot, frame: KeyframesSnapshot[keyof KeyframesSnapshot]) => boolean | Error;
30
- getFramesByKey: (key: keyof KeyframesSnapshot) => Partial<KeyframesSnapshot>[keyof KeyframesSnapshot] | undefined;
31
- setSelfInfo: (userInfo: Partial<UserInfo>) => Promise<boolean>;
32
- updateStatus: (evtType: BuiltinEventType, atnType: BuiltinActionType, status: Record<string, any>, toUserIds?: string | string[]) => Promise<boolean>;
33
- };
34
- useLiveEventCallback: <K_1 extends keyof LiveEventType<KeyframesSnapshot>>(name: K_1, callback: (...args: Parameters<LiveEventType<KeyframesSnapshot>[K_1]>) => ReturnType<LiveEventType<KeyframesSnapshot>[K_1]>, deps?: React.DependencyList) => () => void;
35
- useLiveState: () => LiveState;
36
- useRTCAction: () => {
37
- join: (options: {
38
- voiceId: string;
39
- userId: string;
40
- roomId: string;
41
- type: RTCType;
42
- }) => Promise<boolean>;
43
- quit: () => Promise<boolean>;
44
- shock: () => void | undefined;
45
- toggleMicro: (flag?: boolean | undefined) => Promise<boolean>;
46
- detectMicro: () => Promise<boolean>;
47
- };
48
- useRTCEventCallback: <K_2 extends keyof RTCEventType>(name: K_2, callback: (...args: Parameters<RTCEventType[K_2]>) => ReturnType<RTCEventType[K_2]>, deps?: React.DependencyList) => () => void;
49
- useSelfInfo: () => [Partial<UserInfo>, (userInfo: Partial<UserInfo>) => Promise<boolean | Error>];
50
- useKeyframesSnapshot: () => Partial<KeyframesSnapshot>;
51
- useUserList: () => UserInfo[];
52
- };
@@ -1,182 +0,0 @@
1
- import { JSBridgeProtocol } from '@realsee/jsbridge-x';
2
- import { RTCProtocol } from '../rtc';
3
- import { EventType, KeyframeTypes, LiveOptions, RoomInfo, RTCType, UserInfo, BuiltinEventType, BuiltinActionType, MicroStatus, LiveConnectOptions } from '../typings';
4
- import { LiveState } from '../typings/live/LiveState';
5
- import { Subscribe } from '../utils/subscribe';
6
- export type LiveBuiltInData<KeyframesSnapshot> = {
7
- selfInfo?: UserInfo;
8
- userList?: UserInfo[];
9
- roomInfo?: RoomInfo;
10
- rtcInfo?: {
11
- voiceId: string;
12
- type: RTCType;
13
- };
14
- keyframes: Partial<KeyframesSnapshot>;
15
- };
16
- export declare const _clearLiveInstanceIfNeed: () => void;
17
- export declare class Live<KeyframesSnapshot extends Record<string, any>> extends Subscribe<EventType<KeyframesSnapshot>> {
18
- /**
19
- * 带看的配置
20
- */
21
- private _options;
22
- get options(): LiveOptions;
23
- /**
24
- * 带看状态
25
- */
26
- get state(): LiveState;
27
- /**
28
- * 兼容老逻辑
29
- * @deprecated 请直接读取 state 属性字段,未来将移除该属性
30
- */
31
- get readyState(): LiveState;
32
- /**
33
- * 获取当前WebSocket连接的URL。(注意:这个是WebSocket连接的完整连接,附带一些query参数)。
34
- * @deprecated 带看不需要关注底层ws的相关信息,未来将移除
35
- */
36
- get url(): string | undefined;
37
- /**
38
- * 获取当前live使用的RTC实例
39
- */
40
- get $RTC(): RTCProtocol;
41
- /**
42
- * 获取当前live使用的jsBridge实例
43
- */
44
- get jsBridge(): JSBridgeProtocol;
45
- /**
46
- * 帧数据监听
47
- */
48
- keyframes: Subscribe<KeyframeTypes<KeyframesSnapshot>>;
49
- /**
50
- * 内置的一些数据
51
- */
52
- private _buildInData;
53
- /**
54
- * 当前帧数据快照
55
- */
56
- get snapshot(): Partial<KeyframesSnapshot>;
57
- /**
58
- * 根据键值取帧数据
59
- * @param key 帧数据的键值
60
- * @returns
61
- */
62
- getFramesByKey: <Key extends keyof KeyframesSnapshot>(key: Key) => Partial<KeyframesSnapshot>[Key] | undefined;
63
- /**
64
- * 发送帧数据(需要能够被序列化)
65
- * @param key 帧数据键值
66
- * @param frame 帧数据本体
67
- * @returns
68
- */
69
- sendKeyframe: <Key extends keyof KeyframesSnapshot>(key: Key, frame: KeyframesSnapshot[Key]) => boolean | Error;
70
- /**
71
- * 当前用户信息
72
- */
73
- get selfInfo(): UserInfo | undefined;
74
- /**
75
- * 当前用户列表
76
- */
77
- get userList(): UserInfo[];
78
- /**
79
- * 当前带看房间信息
80
- */
81
- get roomInfo(): RoomInfo | undefined;
82
- /**
83
- * 带看控制器
84
- */
85
- private _controller;
86
- constructor(opts: LiveOptions);
87
- /**
88
- * 添加带看控制的事件监听
89
- */
90
- private _addLiveControllerEventListeners;
91
- /**
92
- * 移除带看控制的事件监听
93
- */
94
- private _removeLiveControllerEventListeners;
95
- /**
96
- * 带看状态变化
97
- * @param state
98
- * @returns
99
- */
100
- private _handleStateChange;
101
- /**
102
- * 消息接收
103
- * @param liveMsg
104
- */
105
- private _handleMessage;
106
- /**
107
- * 清理带看缓存的数据
108
- */
109
- private _clearLiveData;
110
- /**
111
- * 连接带看
112
- * @param options
113
- * @returns
114
- */
115
- connect: (options?: LiveConnectOptions) => Promise<boolean | Error>;
116
- /**
117
- * 退出带看
118
- * @returns
119
- */
120
- _exit: () => Promise<boolean>;
121
- /**
122
- * 退出带看
123
- * @returns
124
- */
125
- exit: () => Promise<void>;
126
- /**
127
- * 关闭带看房间
128
- * @param code
129
- * @param reason
130
- * @returns
131
- */
132
- close: () => Promise<void>;
133
- /**
134
- * 销毁带看
135
- * @returns
136
- */
137
- dispose: () => Promise<boolean>;
138
- /**
139
- * 修改状态
140
- * @param evtType
141
- * @param atnType
142
- * @param status
143
- * @param toUserIds
144
- * @returns
145
- */
146
- updateStatus(evtType: BuiltinEventType, atnType: BuiltinActionType, status: Record<string, any>, toUserIds?: string | string[]): Promise<boolean>;
147
- /**
148
- * 设置自己的用户信息
149
- * @param userInfo
150
- * @returns
151
- */
152
- setSelfInfo: (userInfo: Partial<UserInfo>) => Promise<boolean>;
153
- /**
154
- * 自定义广播
155
- * @param request 广播请求的数据
156
- * @param toUserIds
157
- * @param timeout
158
- * @returns
159
- */
160
- broadcast<Request extends Record<string, any>, Response>(request: Request, toUserIds: string | string[], timeout: number): Promise<Response> | Error | false;
161
- toggleMicro: (microStatus: boolean) => Promise<boolean>;
162
- /**
163
- * 控制别人的麦
164
- * @param microStatus
165
- * @param toUserIds
166
- * @returns
167
- */
168
- forbidMicro: (microStatus: MicroStatus, toUserIds: string | string[]) => Promise<boolean>;
169
- /**
170
- * 控制别人的同步全量帧数据权限
171
- * @param sync
172
- * @param toUserIds
173
- * @returns
174
- */
175
- forbidSync: (sync: boolean, toUserIds: string | string[]) => Promise<boolean>;
176
- /**
177
- * 把用户踢出带看
178
- * @param toUserIds
179
- * @returns
180
- */
181
- kick: (toUserIds: string | string[]) => Promise<boolean>;
182
- }
@@ -1,39 +0,0 @@
1
- import { Client, LocalStream } from 'trtc-js-sdk';
2
- import { GetVoiceSign } from '../typings/live/GetVoiceSign';
3
- import { RTCType } from '../typings/rtc/type';
4
- import { CoreRTC } from './CoreRTC';
5
- export interface ITrtcInstance {
6
- client: Client | null;
7
- stream: LocalStream | null;
8
- }
9
- export declare class BrowserRTC extends CoreRTC {
10
- type: RTCType;
11
- joined: boolean;
12
- micro: boolean;
13
- voiceId: string;
14
- private _getVoiceSign;
15
- private _autoPlayConfirm;
16
- checkRequirement: () => Promise<import("trtc-js-sdk").CheckResult>;
17
- private $dom;
18
- private _trtc;
19
- constructor(options: {
20
- getVoiceSign: GetVoiceSign;
21
- autoPlayConfirm?: (opts: {
22
- onConfirm: () => void;
23
- }) => void;
24
- });
25
- private _initParentDom;
26
- join: (options: {
27
- voiceId: string;
28
- userId: string;
29
- roomId: string;
30
- type: RTCType;
31
- }) => Promise<boolean>;
32
- quit(): Promise<boolean>;
33
- detectMicro(): Promise<boolean>;
34
- toggleMicro(flag?: boolean): Promise<boolean>;
35
- shock(): void;
36
- private _registerRtcEvent;
37
- private _handleStreamAdded;
38
- private _handleStreamSubscribed;
39
- }
@@ -1,60 +0,0 @@
1
- import { AudioMixObserver, AudioVideoObserver, ConsoleLogger, DefaultDeviceController, DefaultMeetingSession, DeviceChangeObserver, LogLevel } from 'amazon-chime-sdk-js';
2
- import { GetVoiceSign } from '../typings/live/GetVoiceSign';
3
- import { RTCType } from '../typings/rtc/type';
4
- import { CoreRTC } from './CoreRTC';
5
- /**
6
- * amazon-chime-sdk-js 适配的rtc实现
7
- */
8
- export declare class BrowserRTC4Chime extends CoreRTC {
9
- type: RTCType;
10
- joined: boolean;
11
- micro: boolean;
12
- voiceId: string;
13
- userId: string;
14
- logger: ConsoleLogger;
15
- deviceController: DefaultDeviceController;
16
- meetingSession: DefaultMeetingSession | undefined;
17
- audioInput: MediaDeviceInfo | undefined;
18
- audioOutput: MediaDeviceInfo | undefined;
19
- deviceChangeObserver: DeviceChangeObserver;
20
- audioVideoObserver: AudioVideoObserver;
21
- audioMixObserver?: AudioMixObserver;
22
- private _getVoiceSign;
23
- private _autoPlayConfirm;
24
- private $dom;
25
- private $audio;
26
- constructor(options: {
27
- getVoiceSign: GetVoiceSign;
28
- autoPlayConfirm?: (opts: {
29
- onConfirm: () => void;
30
- }) => void;
31
- logLevel?: LogLevel;
32
- });
33
- /**
34
- * 对audio标签初始化
35
- */
36
- _initDom: () => void;
37
- /**
38
- * 初始化事件监听器
39
- */
40
- initObservers: () => void;
41
- /**
42
- * 加入语音会议
43
- * @param options
44
- * @returns
45
- */
46
- join(options: {
47
- voiceId: string;
48
- userId: string;
49
- roomId: string | number | undefined;
50
- type: RTCType;
51
- }): Promise<boolean>;
52
- /**
53
- * 注册rtc事件
54
- */
55
- _registerRtcEvent: () => void;
56
- quit(): Promise<boolean>;
57
- detectMicro(): Promise<boolean>;
58
- toggleMicro(flag?: boolean): Promise<boolean>;
59
- shock(): void;
60
- }
@@ -1,23 +0,0 @@
1
- import { RTCEventType } from '../typings/rtc/eventType';
2
- import { RTCProtocol } from '../typings/rtc/protocol';
3
- import { RTCType } from '../typings/rtc/type';
4
- import { Subscribe } from '../utils/subscribe';
5
- /**
6
- * rtc 基础抽象类
7
- */
8
- export declare abstract class CoreRTC extends Subscribe<RTCEventType> implements RTCProtocol {
9
- abstract joined: boolean;
10
- abstract micro: boolean;
11
- abstract voiceId: string;
12
- abstract type: RTCType;
13
- abstract join(options: {
14
- voiceId: string;
15
- userId: string;
16
- roomId: string | number | undefined;
17
- type: RTCType;
18
- }): Promise<boolean>;
19
- abstract quit(): Promise<boolean>;
20
- abstract detectMicro(): Promise<boolean>;
21
- abstract toggleMicro(flag?: boolean): Promise<boolean>;
22
- abstract shock(): void;
23
- }
@@ -1,22 +0,0 @@
1
- import { RTCType } from '../typings/rtc/type';
2
- import { VRWebViewRTCOptions } from '../typings/rtc/VRWebViewRTCOptions';
3
- import { CoreRTC } from './CoreRTC';
4
- export declare class VRWebViewRTC extends CoreRTC {
5
- type: RTCType;
6
- joined: boolean;
7
- micro: boolean;
8
- voiceId: string;
9
- private options;
10
- get jsBridge(): import("@realsee/jsbridge-x").JSBridgeProtocol;
11
- constructor({ jsBridge, getVoiceSign }: VRWebViewRTCOptions);
12
- join(options: {
13
- voiceId: string;
14
- userId: string;
15
- roomId: string;
16
- type: RTCType;
17
- }): Promise<boolean>;
18
- quit(): Promise<boolean>;
19
- detectMicro(): Promise<boolean>;
20
- toggleMicro(flag?: boolean): Promise<boolean>;
21
- shock(): void;
22
- }
@@ -1,5 +0,0 @@
1
- export { CoreRTC } from './CoreRTC';
2
- export { BrowserRTC } from './BrowserRTC';
3
- export { BrowserRTC4Chime } from './BrowserRTC4Chime';
4
- export { VRWebViewRTC } from './VRWebViewRTC';
5
- export type { RTCProtocol } from '../typings/rtc/protocol';
@@ -1,5 +0,0 @@
1
- export interface AttendeeResponse {
2
- attendee_id: string;
3
- external_user_id: string;
4
- join_token: string;
5
- }
@@ -1,12 +0,0 @@
1
- export interface MeetingResponse {
2
- MediaPlacement: {
3
- AudioFallbackUrl: string;
4
- AudioHostUrl: string;
5
- ScreenDataUrl: string;
6
- ScreenSharingUrl: string;
7
- ScreenViewingUrl: string;
8
- SignalingUrl: string;
9
- TurnControlUrl: string;
10
- };
11
- MeetingId: string;
12
- }
@@ -1,16 +0,0 @@
1
- import { AttendeeResponse } from "./AttendeeResponse";
2
- import { MeetingResponse } from "./MeetingResponse";
3
- export interface MeetingSessionConfigurationOptions {
4
- attendence: AttendeeResponse;
5
- config: {
6
- passport: string;
7
- vendor: string;
8
- app_id: string;
9
- bypass: any;
10
- };
11
- expire_time: number;
12
- identifier: string;
13
- user_id: string;
14
- user_sig: string;
15
- vendor_wrapper: MeetingResponse;
16
- }
@@ -1,3 +0,0 @@
1
- export * from './AttendeeResponse';
2
- export * from './MeetingResponse';
3
- export * from './MeetingSessionConfigurationOptions';
@@ -1,4 +0,0 @@
1
- export * from './chime';
2
- export * from './live';
3
- export * from './react';
4
- export * from './rtc';
@@ -1,74 +0,0 @@
1
- import { BuiltinMsg, LiveMsg } from './LiveMsg';
2
- import { LiveState } from './LiveState';
3
- import { UserInfo } from './UserInfo';
4
- /**
5
- * 带看事件列表
6
- */
7
- export type LiveEventType<KeyframesSnapshot> = {
8
- /**
9
- * 带看状态变化
10
- * @param state
11
- * @param prevState
12
- */
13
- 'stateChange'(state: LiveState, prevState?: LiveState): void;
14
- /**
15
- * 内置消息事件
16
- * @param builtinMsg
17
- */
18
- 'builtinEvent'(builtinMsg: BuiltinMsg): void;
19
- /**
20
- * 内置消息事件: 用户信息改变
21
- * @param builtinMsg
22
- */
23
- 'userChange'(builtinMsg: BuiltinMsg): void;
24
- /**
25
- * 内置消息事件:房间信息改变
26
- * @param builtinMsg
27
- */
28
- 'roomChange'(builtinMsg: BuiltinMsg): void;
29
- /**
30
- * 收到其他用户的广播消息。
31
- * @param evtMsg
32
- */
33
- 'broadcast'(evtMsg: Record<string, any>, frontRequestId: string): void;
34
- /**
35
- * 带看已经就绪,可以发送帧数据。
36
- * @param lastKeyframe 带看最后一帧数据(链接切换、断网等重连恢复上次会话帧状态),你可以通过此数据拉齐当前UI状态。
37
- */
38
- 'readyKeyframeSync'(lastKeyframe: Partial<KeyframesSnapshot>): void;
39
- /**
40
- * 获取其他用户输送的帧数据:根据此帧数据更新UI状态。
41
- * @param keyframes
42
- */
43
- 'keyframes'(keyframes: Partial<KeyframesSnapshot>, frontRequestId: string): void;
44
- /**
45
- * 个人信息发生更新。
46
- * @param userInfo
47
- */
48
- 'selfInfoUpdate'(userInfo: UserInfo, frontRequestId: string): void;
49
- /**
50
- * 用户列表更新。
51
- * @param userList
52
- */
53
- 'userListUpdate'(userList: UserInfo[], frontRequestId: string): void;
54
- /**
55
- * 被踢出房间
56
- * @param
57
- * */
58
- 'kickOut'(): void;
59
- /**
60
- * 异常消息:不符合规范。
61
- * @param liveMsg
62
- */
63
- 'error'(liveMsg: LiveMsg): void;
64
- };
65
- /**
66
- * 帧数据类型
67
- */
68
- export type KeyframeTypes<Type> = {
69
- [Property in keyof Type as Property]: (nextKeyframes: Type[Property], prevKeyframes: Type[Property], frontRequestId: string) => void;
70
- };
71
- /**
72
- * 事件解析
73
- */
74
- export type EventType<KeyframesSnapshot> = LiveEventType<KeyframesSnapshot>;
@@ -1,17 +0,0 @@
1
- /**
2
- * 语音签名的返回值
3
- */
4
- export interface GetVoiceSignReturnType {
5
- sdkAppId: number;
6
- userId: string;
7
- roomId: string | number;
8
- userSig: string;
9
- }
10
- /**
11
- * 获取用户语音签名
12
- */
13
- export type GetVoiceSign = ({ voiceId, userId, roomId, }: {
14
- voiceId: string;
15
- userId: string;
16
- roomId: string | number;
17
- }) => Promise<GetVoiceSignReturnType>;
@@ -1,7 +0,0 @@
1
- import { MicroStatus } from "./LiveMsg";
2
- export type LiveConnectOptions = {
3
- url?: string;
4
- force?: boolean;
5
- getTicket?: () => Promise<string>;
6
- rtcMicStatus?: MicroStatus;
7
- };
@@ -1,119 +0,0 @@
1
- /**
2
- * WebSocket 通信指令
3
- * - 下行:服务端推送数据
4
- * - 上行:客户端上报数据
5
- */
6
- export declare enum Command {
7
- SelfUserInfo = "SELF_USER_INFO",
8
- RoomInfo = "ROOM_INFO",
9
- RTCInfo = "RTC_INFO",
10
- UserList = "USER_LIST",
11
- BuiltinMsg = "BUILTIN_MSG",
12
- CustomEvent = "CUSTOM_EVENT",
13
- KeyframeSync = "KEYFRAME_SYNC",
14
- UserKickOut = "USER_KICK_OUT"
15
- }
16
- /**
17
- * 向服务端请求数据时的数据格式。
18
- */
19
- export type ReqLiveMsg = {
20
- /**
21
- * 请求指令。
22
- */
23
- command: Command;
24
- /**
25
- * 前端请求时生成的uuid()。
26
- */
27
- front_request_id: string;
28
- /**
29
- * 数据内容
30
- */
31
- data: {
32
- /**
33
- * 如果此数据仅发送给某些用户,请提供这些用户的ucid。
34
- */
35
- to_user_ids?: string[];
36
- [key: string]: any;
37
- };
38
- };
39
- /**
40
- * 内置事件类型。
41
- */
42
- export declare enum BuiltinEventType {
43
- /**
44
- * 变更用户状态。
45
- */
46
- UserChange = "user_change",
47
- /**
48
- * 变更房间状态。
49
- */
50
- RoomChange = "room_change"
51
- }
52
- /**
53
- * 内置事件行为类型。
54
- */
55
- export declare enum BuiltinActionType {
56
- /**
57
- * 修改麦克风状态。
58
- */
59
- UserMicroStatus = "change_micro_status",
60
- /**
61
- * 同步当前用户状态:客户端麦克风状态已经修改成功,通知服务端
62
- */
63
- UserMicroStatusSync = "sync_micro_status",
64
- /**
65
- * 调整某些用户的权限。
66
- */
67
- UserPermission = "change_permission",
68
- /**
69
- * 用户状态发生改变。
70
- */
71
- UserStatus = "change_status",
72
- /**
73
- * 更新用户信息。
74
- */
75
- UserInfo = "change_info",
76
- /**
77
- * 关闭房间。
78
- */
79
- RoomClose = "close"
80
- }
81
- /**
82
- * 内置事件数据结构体。
83
- */
84
- export type BuiltinMsg = {
85
- event_type: BuiltinEventType;
86
- action: BuiltinActionType;
87
- to_user_ids: string[];
88
- data: {
89
- extension?: Record<string, any>;
90
- [key: string]: any;
91
- };
92
- };
93
- /**
94
- * 麦克风状态。
95
- */
96
- export declare enum MicroStatus {
97
- OPEN = "OPEN",
98
- CLOSE = "CLOSE"
99
- }
100
- /**
101
- * 响应的信息结构体。
102
- */
103
- export type LiveMsg = {
104
- code: string;
105
- message: string;
106
- command: Command;
107
- roomCode: string;
108
- appId: string;
109
- requestId: string;
110
- frontRequestId: string;
111
- triggerUserId: string;
112
- data: Record<string, any> | Record<string, any>[];
113
- };
114
- /**
115
- * 解析下后端数据格式。
116
- * @param jsonTxt - JSON序列化后的文本。
117
- * @returns false 标识解析失败;解析成功返回 {@link LiveMsg} 实例。
118
- */
119
- export declare function parseLiveMsg(jsonTxt: string): LiveMsg | boolean;