@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,118 +0,0 @@
1
- import { LiveMsg } from '../typings';
2
- import { LiveState } from '../typings/live/LiveState';
3
- import { RobustWebSocketEventDetail } from '../utils/RobustWebSocket';
4
- import { Subscribe } from '../utils/subscribe';
5
- /**
6
- * 带看控制器事件映射
7
- */
8
- export type LiveControllerEventMap = {
9
- /**
10
- * 带看状态变更
11
- * @param state
12
- * @param prevState
13
- * @returns
14
- */
15
- stateChange: (state: LiveState, prevState: LiveState) => void;
16
- /**
17
- * 接收到带看消息
18
- * @param message
19
- * @returns
20
- */
21
- message: (message: LiveMsg) => void;
22
- /**
23
- * 带看重连中
24
- * @param detail
25
- * @returns
26
- */
27
- reconnecting: (detail: RobustWebSocketEventDetail) => void;
28
- /**
29
- * 带看重连成功
30
- * @param detail
31
- * @returns
32
- */
33
- reconnected: (detail: RobustWebSocketEventDetail) => void;
34
- };
35
- /**
36
- * 带看控制器
37
- */
38
- export declare class LiveController extends Subscribe<LiveControllerEventMap> {
39
- /**
40
- * ws代理器
41
- */
42
- private _ws;
43
- /**
44
- * 带看连接状态
45
- */
46
- private _state;
47
- set state(state: LiveState);
48
- get state(): LiveState;
49
- constructor();
50
- /**
51
- * 添加事件监听
52
- */
53
- private _addWebSocketEventListeners;
54
- /**
55
- * 移除事件监听
56
- */
57
- private _removeWebSocketEventListeners;
58
- /**
59
- * 处理房间关闭事件
60
- * @param event
61
- */
62
- private _handleCloseEvent;
63
- /**
64
- * 处理房间正在关闭事件(这个时候可能是断网了)
65
- */
66
- private _handleClosingEvent;
67
- /**
68
- * 连接中
69
- * @param event
70
- */
71
- private _handleConnectingEvent;
72
- /**
73
- * 连接发送异常
74
- * @param event
75
- */
76
- private _handleErrorEvent;
77
- /**
78
- * 接收到消息
79
- * @param event
80
- */
81
- private _handleMessageEvent;
82
- /**
83
- * 连接建立成功
84
- * @param event
85
- */
86
- private _handleOpenEvent;
87
- /**
88
- * 处理超时
89
- * @param event
90
- */
91
- private _handleTimeoutEvent;
92
- /**
93
- * 释放资源,释放之后需要重新实例化
94
- * @returns
95
- */
96
- dispose: () => Promise<boolean>;
97
- /**
98
- * 开启房间链接
99
- * @param url 房间链接
100
- * @returns
101
- */
102
- open: (url: string) => void;
103
- /**
104
- * 关闭房间
105
- * @param code
106
- * @param reason
107
- */
108
- close: (code?: string | number | undefined, reason?: string | undefined) => Promise<boolean>;
109
- /**
110
- * 发送数据
111
- * @param data
112
- */
113
- sendMessage(data?: any): void | undefined;
114
- /**
115
- * 准备关闭带看
116
- */
117
- readyClose(): void;
118
- }
@@ -1,8 +0,0 @@
1
- import { LiveOptions } from '../typings/live/LiveOptions';
2
- import { Live } from './live';
3
- /**
4
- * 创建`Live`实例
5
- * @param opts
6
- * @returns
7
- */
8
- export declare const createLive: <KeyframesSnapshot extends Record<string, any>>(opts: LiveOptions) => Live<KeyframesSnapshot>;
@@ -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,97 +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
- /**
10
- * 保留加入房间参数,用于重连
11
- */
12
- private _joinOptions;
13
- private options;
14
- get jsBridge(): import("@realsee/jsbridge-x").JSBridgeProtocol;
15
- constructor({ jsBridge, getVoiceSign }: VRWebViewRTCOptions);
16
- /**
17
- * 处理用户音量
18
- * @param userVolumes
19
- */
20
- private handleUserVolumes;
21
- /**
22
- * 处理弱网络情况
23
- * @param weakNetwork
24
- */
25
- private handleWeakNetwork;
26
- /**
27
- * 加入语音房间
28
- * @param options
29
- * @returns
30
- */
31
- join: (options: {
32
- voiceId: string;
33
- userId: string;
34
- roomId: string;
35
- type: RTCType;
36
- }) => Promise<boolean>;
37
- /**
38
- * 重连
39
- * @returns
40
- */
41
- reJoin: () => Promise<boolean>;
42
- /**
43
- * 获取 rtc 签名
44
- * @param params
45
- * @returns
46
- */
47
- private getVoiceSignOrEmitError;
48
- /**
49
- * 处理小程序的加入房间
50
- * @param options
51
- * @returns
52
- */
53
- private handleWxMiniProgramWebViewJoin;
54
- /**
55
- * 处理App WebView的加入房间
56
- * @param options
57
- * @returns
58
- */
59
- private handleAppWebViewJoin;
60
- /**
61
- * 加入语音房间,给小程序使用
62
- * @param param0
63
- * @returns
64
- */
65
- private joinRoomOrEmitError;
66
- /**
67
- * 处理加入语音房间结果
68
- * @param res
69
- * @returns
70
- */
71
- private handleJoinResult;
72
- /**
73
- * 将错误信息发送出去,并将 joined 置为 false
74
- * @param message
75
- */
76
- private emitErrorAndSetJoinedFalse;
77
- /**
78
- * 退出房间
79
- * @returns
80
- */
81
- quit: () => Promise<boolean>;
82
- /**
83
- * 监测麦克风权限
84
- * @returns
85
- */
86
- detectMicro: () => Promise<boolean>;
87
- /**
88
- * 修改麦克风状态
89
- * @param flag
90
- * @returns
91
- */
92
- toggleMicro: (flag?: boolean) => Promise<boolean>;
93
- /**
94
- * 震动
95
- */
96
- shock: () => void;
97
- }
@@ -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';