@realsee/live 0.6.15 → 0.7.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 (167) hide show
  1. package/README.md +50 -55
  2. package/dist/index.cjs.js +38 -24
  3. package/dist/index.d.cts +1336 -0
  4. package/dist/index.d.ts +1336 -5
  5. package/dist/index.esm.js +10 -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 +39 -32
  68. package/dist/index.cjs.js.map +0 -1
  69. package/dist/index.es.js +0 -2328
  70. package/dist/index.es.js.map +0 -1
  71. package/dist/live/controller.d.ts +0 -118
  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 -97
  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 -45
  87. package/dist/typings/live/LiveConnectOptions.d.ts +0 -24
  88. package/dist/typings/live/LiveMsg.d.ts +0 -133
  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 -44
  100. package/dist/typings/rtc/index.d.ts +0 -5
  101. package/dist/typings/rtc/joinedInfo.d.ts +0 -38
  102. package/dist/typings/rtc/protocol.d.ts +0 -62
  103. package/dist/typings/rtc/type.d.ts +0 -12
  104. package/dist/utils/RobustWebSocket.d.ts +0 -160
  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/Live.html +0 -812
  120. package/docs/classes/VRWebViewRTC.html +0 -639
  121. package/docs/enums/BuiltInRTCType.html +0 -69
  122. package/docs/enums/BuiltinActionType.html +0 -112
  123. package/docs/enums/BuiltinEventType.html +0 -76
  124. package/docs/enums/Command.html +0 -134
  125. package/docs/enums/LiveState.html +0 -89
  126. package/docs/enums/MemUserStatus.html +0 -97
  127. package/docs/enums/MicroStatus.html +0 -76
  128. package/docs/enums/RTCJoinedInfoCodeEnum.html +0 -103
  129. package/docs/enums/RTCType.html +0 -79
  130. package/docs/enums/UserStatus.html +0 -85
  131. package/docs/enums/WebSocketCloseError.html +0 -139
  132. package/docs/enums/WebSocketErrorType.html +0 -104
  133. package/docs/enums/WebSocketState.html +0 -103
  134. package/docs/functions/_clearLiveInstanceIfNeed.html +0 -98
  135. package/docs/functions/createLive.html +0 -111
  136. package/docs/functions/createLiveReact.html +0 -579
  137. package/docs/functions/parseLiveMsg.html +0 -109
  138. package/docs/functions/parseWSClsErr.html +0 -103
  139. package/docs/index.html +0 -474
  140. package/docs/interfaces/AttendeeResponse.html +0 -80
  141. package/docs/interfaces/LiveOptions.html +0 -272
  142. package/docs/interfaces/MeetingResponse.html +0 -90
  143. package/docs/interfaces/MeetingSessionConfigurationOptions.html +0 -119
  144. package/docs/interfaces/Permission.html +0 -157
  145. package/docs/interfaces/RTCJoinedInfo.html +0 -104
  146. package/docs/interfaces/RTCProtocol.html +0 -424
  147. package/docs/interfaces/VRWebViewRTCOptions.html +0 -73
  148. package/docs/modules.html +0 -156
  149. package/docs/types/BuiltinMsg.html +0 -112
  150. package/docs/types/EventType.html +0 -101
  151. package/docs/types/GetVoiceSign.html +0 -109
  152. package/docs/types/GetVoiceSignParams.html +0 -111
  153. package/docs/types/GetVoiceSignReturnType.html +0 -115
  154. package/docs/types/KeyframeTypes.html +0 -101
  155. package/docs/types/LiveBuiltInData.html +0 -117
  156. package/docs/types/LiveConnectOptions.html +0 -123
  157. package/docs/types/LiveEventType.html +0 -276
  158. package/docs/types/LiveMsg.html +0 -117
  159. package/docs/types/LiveProviderPropTypes.html +0 -106
  160. package/docs/types/RTCActionReactCallback.html +0 -94
  161. package/docs/types/RTCEventType.html +0 -210
  162. package/docs/types/ReqLiveMsg.html +0 -118
  163. package/docs/types/RoomInfo.html +0 -118
  164. package/docs/types/UserInfo.html +0 -139
  165. package/docs/types/UserInfoExt.html +0 -109
  166. package/docs/types/UserVolume.html +0 -103
  167. package/docs/types/WebSocketError.html +0 -105
@@ -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,45 +0,0 @@
1
- /**
2
- * 语音签名的返回值
3
- */
4
- export type GetVoiceSignReturnType = {
5
- /**
6
- * rtc 的 sdkAppId
7
- */
8
- sdkAppId: number;
9
- /**
10
- * rtc 的 用户 id
11
- */
12
- userId: string;
13
- /**
14
- * rtc 的 语音房间号
15
- */
16
- roomId: string | number;
17
- /**
18
- * rtc 的 用户签名
19
- */
20
- userSig: string;
21
- };
22
- /**
23
- * 获取用户语音签名的参数
24
- */
25
- export type GetVoiceSignParams = {
26
- /**
27
- * 语音房间号
28
- */
29
- voiceId: string;
30
- /**
31
- * 用户 id
32
- */
33
- userId: string;
34
- /**
35
- * 房间 id
36
- */
37
- roomId: string | number;
38
- };
39
- /**
40
- * 获取用户语音签名的方法
41
- * @param voiceId 语音房间号
42
- * @param userId 用户 id
43
- * @param roomId 房间 id
44
- */
45
- export type GetVoiceSign = (params: GetVoiceSignParams) => Promise<GetVoiceSignReturnType>;
@@ -1,24 +0,0 @@
1
- import { MicroStatus } from "./LiveMsg";
2
- /**
3
- * 带看连接配置项
4
- */
5
- export type LiveConnectOptions = {
6
- /**
7
- * 这个是带看房间的 ws 地址
8
- */
9
- url?: string;
10
- /**
11
- * 是否强制加入
12
- * 如果为 true,会强制加入房间,不管之前是否已经加入,会把之前的连接断开
13
- * 如果为 false,会检查是否已经加入房间,如果已经加入,不会再次加入
14
- */
15
- force?: boolean;
16
- /**
17
- * 获取带看房间 ticket 的方法
18
- */
19
- getTicket?: () => Promise<string>;
20
- /**
21
- * 初始的麦克风状态
22
- */
23
- rtcMicStatus?: MicroStatus;
24
- };
@@ -1,133 +0,0 @@
1
- /**
2
- * WebSocket 通信指令
3
- * - 下行:服务端推送数据
4
- * - 上行:客户端上报数据
5
- */
6
- export declare enum Command {
7
- /** 当前用户信息:下行 */
8
- SelfUserInfo = "SELF_USER_INFO",
9
- /** 房间信息:下行 */
10
- RoomInfo = "ROOM_INFO",
11
- /** RTC信息:下行 */
12
- RTCInfo = "RTC_INFO",
13
- /** 用户列表:下行 */
14
- UserList = "USER_LIST",
15
- /** 内置消息:下行、上行 */
16
- BuiltinMsg = "BUILTIN_MSG",
17
- /** 自定义广播事件消息:下行、上行 */
18
- CustomEvent = "CUSTOM_EVENT",
19
- /** 帧数据同步:下行、上行 */
20
- KeyframeSync = "KEYFRAME_SYNC",
21
- /** 被踢出房间:下行 */
22
- UserKickOut = "USER_KICK_OUT"
23
- }
24
- /**
25
- * 向服务端请求数据时的数据格式。
26
- */
27
- export type ReqLiveMsg = {
28
- /**
29
- * 请求指令。
30
- */
31
- command: Command;
32
- /**
33
- * 前端请求时生成的uuid()。
34
- */
35
- front_request_id: string;
36
- /**
37
- * 数据内容
38
- */
39
- data: {
40
- /**
41
- * 如果此数据仅发送给某些用户,请提供这些用户的ucid。
42
- */
43
- to_user_ids?: string[];
44
- [key: string]: any;
45
- };
46
- };
47
- /**
48
- * 内置事件类型。
49
- */
50
- export declare enum BuiltinEventType {
51
- /**
52
- * 变更用户状态。
53
- */
54
- UserChange = "user_change",
55
- /**
56
- * 变更房间状态。
57
- */
58
- RoomChange = "room_change"
59
- }
60
- /**
61
- * 内置事件行为类型。
62
- */
63
- export declare enum BuiltinActionType {
64
- /**
65
- * 修改麦克风状态。
66
- */
67
- UserMicroStatus = "change_micro_status",
68
- /**
69
- * 同步当前用户状态:客户端麦克风状态已经修改成功,通知服务端
70
- */
71
- UserMicroStatusSync = "sync_micro_status",
72
- /**
73
- * 调整某些用户的权限。
74
- */
75
- UserPermission = "change_permission",
76
- /**
77
- * 用户状态发生改变。
78
- */
79
- UserStatus = "change_status",
80
- /**
81
- * 更新用户信息。
82
- */
83
- UserInfo = "change_info",
84
- /**
85
- * 关闭房间。
86
- */
87
- RoomClose = "close"
88
- }
89
- /**
90
- * 内置事件数据结构体。
91
- */
92
- export type BuiltinMsg = {
93
- event_type: BuiltinEventType;
94
- action: BuiltinActionType;
95
- to_user_ids: string[];
96
- data: {
97
- extension?: Record<string, any>;
98
- [key: string]: any;
99
- };
100
- };
101
- /**
102
- * 麦克风状态。
103
- */
104
- export declare enum MicroStatus {
105
- /**
106
- * 打开
107
- */
108
- OPEN = "OPEN",
109
- /**
110
- * 关闭
111
- */
112
- CLOSE = "CLOSE"
113
- }
114
- /**
115
- * 响应的信息结构体。
116
- */
117
- export type LiveMsg = {
118
- code: string;
119
- message: string;
120
- command: Command;
121
- roomCode: string;
122
- appId: string;
123
- requestId: string;
124
- frontRequestId: string;
125
- triggerUserId: string;
126
- data: Record<string, any> | Record<string, any>[];
127
- };
128
- /**
129
- * 解析下后端数据格式。
130
- * @param jsonTxt - JSON序列化后的文本。
131
- * @returns false 标识解析失败;解析成功返回 {@link LiveMsg} 实例。
132
- */
133
- export declare function parseLiveMsg(jsonTxt: string): LiveMsg | boolean;
@@ -1,79 +0,0 @@
1
- import { JSBridgeProtocol } from '@realsee/jsbridge-x';
2
- import { RTCProtocol } from '../rtc/protocol';
3
- import { BuiltInRTCType, RTCType } from '../rtc/type';
4
- import { GetVoiceSign } from './GetVoiceSign';
5
- import { MicroStatus } from './LiveMsg';
6
- /**
7
- * 依赖配置。
8
- */
9
- export interface LiveOptions {
10
- /**
11
- * 创建`WebSocket`所依赖的URL。
12
- */
13
- url?: string;
14
- /**
15
- * RTC实例。
16
- * 优先使用该实例。
17
- */
18
- rtc?: RTCProtocol;
19
- /**
20
- * RTC类型
21
- * rtc 为空时使用内置的rtc实例类型
22
- */
23
- rtcType?: RTCType;
24
- /**
25
- * 麦克风初始状态
26
- */
27
- initialMicroStatus?: MicroStatus;
28
- /**
29
- * 获取建立 WebSocket 连接的依赖Tick
30
- */
31
- getTicket?: () => Promise<string>;
32
- /**
33
- * jsBridge实例
34
- * 使用内置rtc时提供给rtc实例使用
35
- */
36
- jsBridge?: JSBridgeProtocol;
37
- /**
38
- * 获取语音签名的接口
39
- * 使用内置rtc时提供给rtc实例使用
40
- */
41
- getVoiceSign?: GetVoiceSign;
42
- /**
43
- * 使用webRTC时会有自动播放的安全策略限制,用户有交互
44
- * @param options
45
- * @returns
46
- */
47
- autoPlayConfirm?: (options: {
48
- onConfirm: () => void;
49
- }) => void;
50
- /**
51
- * 使用内置的rtc实例
52
- */
53
- useBuiltInRTC?: boolean;
54
- /**
55
- * 内置的rtc通道类型
56
- * trtc or chime , default trtc
57
- */
58
- builtInRTCType?: BuiltInRTCType;
59
- /**
60
- * 使用内置的jsBridge实例
61
- */
62
- useBuiltInJsBridge?: boolean;
63
- /**
64
- * 能否禁用某个/些用户的麦克风
65
- */
66
- canForbidUserMicro?: (users: string | string[]) => boolean;
67
- /**
68
- * 能否限制某个/些用户的帧数据同步
69
- */
70
- canForbidUserSync?: (users: string | string[]) => boolean;
71
- /**
72
- * 能否强制"踢掉"某个/些用户。
73
- */
74
- canForbidUserKick?: (users: string | string[]) => boolean;
75
- /**
76
- * 是否开启调试模式:此模式下会在终端打印日志方便调试。
77
- */
78
- __debug__?: boolean;
79
- }
@@ -1,15 +0,0 @@
1
- export declare enum LiveState {
2
- NOTINITIALIZED = -1,
3
- /**
4
- * 正在链接中
5
- */
6
- CONNECTING = 0,
7
- /**
8
- * 已经链接并且可以通讯
9
- */
10
- OPEN = 1,
11
- /**
12
- * 连接已关闭或者链接失败
13
- */
14
- CLOSED = 3
15
- }
@@ -1,13 +0,0 @@
1
- export type RoomInfo = {
2
- info: {
3
- id: string | number;
4
- status: string | number;
5
- create_user_id: string;
6
- app_id: string;
7
- extension: Record<string, any>;
8
- create_time: string;
9
- room_code: string;
10
- };
11
- init_timestamp: string;
12
- last_frame: Record<string, any>;
13
- };
@@ -1,103 +0,0 @@
1
- /**
2
- * 用户当前状态枚举。
3
- */
4
- export declare enum UserStatus {
5
- /**
6
- * 正常
7
- */
8
- Normal = 0,
9
- /**
10
- * 被移除
11
- */
12
- Removed = 1,
13
- /**
14
- * 被替换
15
- */
16
- Replaced = 2
17
- }
18
- export declare enum MemUserStatus {
19
- WAIT_ENTER = "WAIT_ENTER",
20
- ONLINE = "ONLINE",
21
- LEAVE = "LEAVE",
22
- KICK_OUT = "KICK_OUT",
23
- BE_REPLACE = "BE_REPLACE",
24
- EXCEPTION = "EXCEPTION"
25
- }
26
- /**
27
- * 用户信息扩展字段:比如提供用户画像相关的数据。
28
- */
29
- export type UserInfoExt = {
30
- /**
31
- * 用户昵称。
32
- */
33
- nickname?: string;
34
- /**
35
- * 用户头像。
36
- */
37
- avatar?: string;
38
- /**
39
- * 其他用户相关的字段,比如用户职称、住址、联系方式等信息。
40
- */
41
- [key: string]: any;
42
- };
43
- /**
44
- * 带看会话房间用户的信息格式。
45
- */
46
- export type UserInfo = {
47
- /**
48
- * 用户唯一标识ID。
49
- */
50
- id: string;
51
- /**
52
- * 用户当前的状态。
53
- */
54
- status?: UserStatus;
55
- /**
56
- * 内存中的用户状态。
57
- */
58
- mem_user_status?: MemUserStatus;
59
- /**
60
- * 用户当前是否开启麦克风。
61
- */
62
- micro_status: boolean;
63
- /**
64
- * 用户角色定义。(前端不关注此字段)。
65
- */
66
- user_role?: number | string;
67
- /**
68
- * 用户当前是否在线。
69
- */
70
- current_ws_online?: boolean;
71
- /**
72
- * 用户曾经是否在线过,即进入房间后又由于某种原因离开后重新进入。
73
- */
74
- once_ws_online?: boolean;
75
- /**
76
- * RTC 环境是否就绪,即当前语音是否联通。
77
- */
78
- rtc: boolean;
79
- /**
80
- * 当前用户的权限配置。(UI层面理解)。
81
- */
82
- permission?: Partial<Permission>;
83
- /**
84
- * 用户信息扩展字段。
85
- */
86
- extension?: UserInfoExt;
87
- };
88
- export interface Permission {
89
- more_vr_scene: boolean;
90
- invite_other: boolean;
91
- control_own_micro: boolean;
92
- control_other_micro: boolean;
93
- view_own_micro_status: boolean;
94
- view_other_micro_status: boolean;
95
- close_live_room: boolean;
96
- apply_other_phone: boolean;
97
- dynamic_enter: boolean;
98
- sync_frame: boolean;
99
- transfer_role: boolean;
100
- change_other_status: boolean;
101
- control_other_sync: boolean;
102
- extension: Record<string, boolean>;
103
- }
@@ -1,7 +0,0 @@
1
- /**
2
- * 用户的音量信息。
3
- */
4
- export type UserVolume = {
5
- userId: string;
6
- audioVolume: number;
7
- };
@@ -1,82 +0,0 @@
1
- /**
2
- * WebSocket 连接状态枚举
3
- */
4
- export declare enum WebSocketState {
5
- /**
6
- * 尚未初始化
7
- */
8
- NOTINITIALIZED = -1,
9
- /**
10
- * 正在链接中
11
- */
12
- CONNECTING = 0,
13
- /**
14
- * 已经链接并且可以通讯
15
- */
16
- OPEN = 1,
17
- /**
18
- * 连接正在关闭
19
- */
20
- CLOSING = 2,
21
- /**
22
- * 连接已关闭或者没有链接成功
23
- */
24
- CLOSED = 3
25
- }
26
- export type WebSocketError = {
27
- type: WebSocketErrorType;
28
- closeError?: WebSocketCloseError;
29
- target?: Event | CloseEvent;
30
- error?: any;
31
- };
32
- export declare enum WebSocketErrorType {
33
- Error = "Error",
34
- Close = "Close",
35
- MicroAuth = "MicroAuth",
36
- DuplicateConnect = "DuplicateConnect",
37
- IllegalURL = "IllegalURL",
38
- Unknown = "Unknown",
39
- IllegalArgs = "IllegalArgs"
40
- }
41
- /**
42
- * WebSocket 异常关闭枚举:https://developer.mozilla.org/zh-CN/docs/Web/API/CloseEvent。
43
- */
44
- export declare enum WebSocketCloseError {
45
- /**
46
- * 正常关闭; 无论为何目的而创建,该链接都已成功完成任务。
47
- */
48
- Err_1000 = "CLOSE_NORMAL",
49
- /**
50
- * 终端离开, 可能因为服务端错误, 也可能因为浏览器正从打开连接的页面跳转离开。
51
- */
52
- Err_1001 = "CLOSE_GOING_AWAY",
53
- /**
54
- * 由于协议错误而中断连接。
55
- */
56
- Err_1002 = "CLOSE_PROTOCOL_ERROR",
57
- /**
58
- * 由于接收到不允许的数据类型而断开连接 (如仅接收文本数据的终端接收到了二进制数据)。
59
- */
60
- Err_1003 = "CLOSE_UNSUPPORTED",
61
- /**
62
- * 安全因素或WebSocket连接次数达到上限。
63
- */
64
- Err_1006 = "CLOSE_ABNORMAL",
65
- /**
66
- * 由于收到了格式不符的数据而断开连接 (如文本消息中包含了非 UTF-8 数据)。
67
- */
68
- Err_1007 = "Unsupported Data",
69
- /**
70
- * 由于收到不符合约定的数据而断开连接。
71
- */
72
- Err_1008 = "Policy Violation",
73
- /**
74
- * 由于收到过大的数据帧而断开连接。
75
- */
76
- Err_1009 = "CLOSE_TOO_LARGE",
77
- /**
78
- * 未知错误。
79
- */
80
- Err_unknown = "unknown"
81
- }
82
- export declare function parseWSClsErr(code: number): WebSocketCloseError;
@@ -1,10 +0,0 @@
1
- export * from './EventType';
2
- export * from './GetVoiceSign';
3
- export * from './LiveMsg';
4
- export * from './LiveOptions';
5
- export * from './LiveState';
6
- export * from './LiveConnectOptions';
7
- export * from './RoomInfo';
8
- export * from './UserInfo';
9
- export * from './UserVolume';
10
- export * from './WebSocket';
@@ -1,2 +0,0 @@
1
- import { RTCProtocol } from '../rtc/protocol';
2
- export type RTCActionReactCallback = Pick<RTCProtocol, 'join' | 'quit' | 'shock' | 'toggleMicro' | 'detectMicro'>;
@@ -1 +0,0 @@
1
- export * from './RTCActionReactCallback';
@@ -1,6 +0,0 @@
1
- import { JSBridgeProtocol } from '@realsee/jsbridge-x';
2
- import { GetVoiceSign } from '../live/GetVoiceSign';
3
- export interface VRWebViewRTCOptions {
4
- jsBridge: JSBridgeProtocol;
5
- getVoiceSign: GetVoiceSign;
6
- }
@@ -1,44 +0,0 @@
1
- import { UserVolume } from "../live/UserVolume";
2
- import { RTCJoinedInfo } from "./joinedInfo";
3
- /**
4
- * RTC 异步事件类型。
5
- */
6
- export type RTCEventType = {
7
- /**
8
- * 错误\异常
9
- * @param error
10
- */
11
- "error"(error: Error | RTCJoinedInfo): void;
12
- /**
13
- * 即将加入房间。
14
- */
15
- "joinWillStart"(): void;
16
- /**
17
- * 成功加入语音房间。
18
- */
19
- "joined"(): void;
20
- /**
21
- * 弱网提醒事件。
22
- */
23
- "weakNetwork"(): void;
24
- /**
25
- * 每个用户的音量。
26
- * @param userVolumes
27
- */
28
- "userVolumes"(userVolumes: UserVolume[]): void;
29
- /**
30
- * rtc 成功
31
- * @inner 内置事件,行为会随版本变更,请勿通过外部注册监听
32
- */
33
- "inner.rtc.success"(result: RTCJoinedInfo | boolean): void;
34
- /**
35
- * rtc 失败
36
- * @inner 内置事件,行为会随版本变更,请勿通过外部注册监听
37
- */
38
- "inner.rtc.fail"(result: RTCJoinedInfo | boolean): void;
39
- /**
40
- * rtc 错误
41
- * @inner 内置事件,行为会随版本变更,请勿通过外部注册监听
42
- */
43
- "inner.rtc.error"(error: Error): void;
44
- };
@@ -1,5 +0,0 @@
1
- export * from './VRWebViewRTCOptions';
2
- export * from './eventType';
3
- export * from './joinedInfo';
4
- export * from './protocol';
5
- export * from './type';
@@ -1,38 +0,0 @@
1
- /**
2
- * rtc加入返回值code枚举
3
- */
4
- export declare enum RTCJoinedInfoCodeEnum {
5
- /**
6
- * 成功
7
- */
8
- Success = 0,
9
- /**
10
- * 失败
11
- */
12
- Failure = 1,
13
- /**
14
- * 重复加入
15
- */
16
- ReJoin = 2,
17
- /**
18
- * 无麦克风权限
19
- */
20
- NoMicroPermission = 3,
21
- /**
22
- * 未知异常
23
- */
24
- Unknown = 500
25
- }
26
- /**
27
- * 进入rtc房间的回调信息
28
- */
29
- export interface RTCJoinedInfo {
30
- code: RTCJoinedInfoCodeEnum;
31
- message: string;
32
- userId?: string;
33
- roomId?: number;
34
- errInfo?: {
35
- errCode: number;
36
- errMsg: string;
37
- };
38
- }