larksr_websdk 3.2.0 → 3.2.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.
- package/README.md +77 -31
- package/dist/larksr-web-sdk.min.js +3 -3
- package/dist/types/event/event_base.d.ts +0 -3
- package/dist/types/index.d.ts +21 -1
- package/dist/types/lark/Worker.d.ts +0 -3
- package/dist/types/lark/application.d.ts +21 -11
- package/dist/types/lark/custom.d.ts +6 -6
- package/dist/types/lark/peer_connection.d.ts +7 -7
- package/dist/types/lark/websocket_channel.d.ts +0 -1
- package/dist/types/lark/websocket_proxy.d.ts +0 -1
- package/dist/types/larksr.d.ts +326 -12
- package/dist/types/operation/operation.d.ts +4 -0
- package/dist/types/screen_state.d.ts +1 -1
- package/package.json +5 -7
- package/dist/larksr-web-sdk.min.worker.js +0 -1
package/dist/types/index.d.ts
CHANGED
|
@@ -1 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
import 'core-js/stable/symbol';
|
|
2
|
+
import { LarkSR, CreateLarkSRClientFromeAPI, CreateLarkSRClientFromeUrl, LarkEventType, LarkSRClientEvent, AppliParams, LoadAppliParamsFromUrl, AppliParamsUtils, LoadAppliParamsStartAppInfo, EventBase, API, Operation, Capabilities, ScaleMode, CloudLark, FullScreen, LockPointer, KEYMAP, ILarkSRConfig, PlayerModeType, UserType, LarkSREvent } from "./larksr";
|
|
3
|
+
declare const _default: {
|
|
4
|
+
LarkSR: typeof LarkSR;
|
|
5
|
+
CreateLarkSRClientFromeAPI: typeof CreateLarkSRClientFromeAPI;
|
|
6
|
+
CreateLarkSRClientFromeUrl: typeof CreateLarkSRClientFromeUrl;
|
|
7
|
+
API: typeof API;
|
|
8
|
+
AppliParams: typeof AppliParams;
|
|
9
|
+
LoadAppliParamsFromUrl: typeof LoadAppliParamsFromUrl;
|
|
10
|
+
AppliParamsUtils: typeof AppliParamsUtils;
|
|
11
|
+
LoadAppliParamsStartAppInfo: typeof LoadAppliParamsStartAppInfo;
|
|
12
|
+
EventBase: typeof EventBase;
|
|
13
|
+
ScaleMode: typeof ScaleMode;
|
|
14
|
+
Capabilities: typeof Capabilities;
|
|
15
|
+
CloudLark: typeof CloudLark;
|
|
16
|
+
FullScreen: typeof FullScreen;
|
|
17
|
+
LockPointer: typeof LockPointer;
|
|
18
|
+
Operation: typeof Operation;
|
|
19
|
+
};
|
|
20
|
+
export default _default;
|
|
21
|
+
export { LarkEventType, LarkSRClientEvent, KEYMAP, ILarkSRConfig, PlayerModeType, UserType, LarkSREvent, };
|
|
@@ -19,17 +19,23 @@ export declare enum APP_STATE {
|
|
|
19
19
|
DESTROYED = 12
|
|
20
20
|
}
|
|
21
21
|
export declare enum APP_EVENT_TYPE {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
22
|
+
CONNECT = 0,
|
|
23
|
+
LOGIN = 1,
|
|
24
|
+
ERROR = 2,
|
|
25
|
+
INFO = 3,
|
|
26
|
+
APP_CLOSE = 4,
|
|
27
|
+
REMOTE_STREAM = 5,
|
|
28
|
+
SYNC_CURSORSTYLE = 6,
|
|
29
|
+
APP_STATE_CHANGE = 7,
|
|
30
|
+
NET_STATE = 8,
|
|
31
|
+
LK_APP_RESIZE = 9,
|
|
32
|
+
LK_APP_MOUSE_MODE = 10,
|
|
33
|
+
LK_APP_PLAER_LIST = 11,
|
|
34
|
+
LK_APP_REQUEST_TEXT = 12,
|
|
35
|
+
LK_DATA_CHANNEL_RENDERSERVER_TEXT_MESSAGE = 13,
|
|
36
|
+
LK_DATA_CHANNEL_RENDERSERVER_BINARY_MESSAGE = 14,
|
|
37
|
+
LK_DATA_CHANNEL_RENDERSERVER_OPEN = 15,
|
|
38
|
+
LK_DATA_CHANNEL_RENDERSERVER_CLOSE = 16
|
|
33
39
|
}
|
|
34
40
|
export interface AppEvent extends LocalEvent<APP_EVENT_TYPE> {
|
|
35
41
|
data?: any;
|
|
@@ -96,7 +102,11 @@ export default class Application extends EventBase<APP_EVENT_TYPE, AppEvent> {
|
|
|
96
102
|
private onDataChannelBinary;
|
|
97
103
|
private onDataChannelOpen;
|
|
98
104
|
private onDataChannelClose;
|
|
105
|
+
private onPeerConnectionState;
|
|
99
106
|
appStateChange(state: APP_STATE): void;
|
|
107
|
+
private infoMsg;
|
|
108
|
+
private errorMsg;
|
|
109
|
+
private toastMsg;
|
|
100
110
|
private $emit;
|
|
101
111
|
private createAppEvent;
|
|
102
112
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
declare module "worker-loader!*" {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
// declare module "worker-loader!*" {
|
|
2
|
+
// class WebpackWorker extends Worker {
|
|
3
|
+
// constructor();
|
|
4
|
+
// }
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
}
|
|
6
|
+
// export = WebpackWorker;
|
|
7
|
+
// }
|
|
@@ -18,12 +18,13 @@ export declare enum WEBRTC_EVENT_TYPE {
|
|
|
18
18
|
LK_DATA_CHANNEL_RENDERSERVER_BINARY_MESSAGE = 7,
|
|
19
19
|
LK_DATA_CHANNEL_RENDERSERVER_OPEN = 8,
|
|
20
20
|
LK_DATA_CHANNEL_RENDERSERVER_CLOSE = 9,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
LK_RTC_EVENT_PEERCONNECTION_STATE = 10,
|
|
22
|
+
NET_STATE = 11,
|
|
23
|
+
SYNC_CURSORSTYLE = 12,
|
|
24
|
+
BAD_NETWORK = 13,
|
|
25
|
+
ERROR = 14,
|
|
26
|
+
RTC_SDP = 15,
|
|
27
|
+
RTC_ICECANDIDATE = 16
|
|
27
28
|
}
|
|
28
29
|
export interface GoogleBitRate {
|
|
29
30
|
start: number;
|
|
@@ -110,4 +111,3 @@ export default class PeerConnection extends EventBase<WEBRTC_EVENT_TYPE, WebRTCE
|
|
|
110
111
|
private $emit;
|
|
111
112
|
private createEvent;
|
|
112
113
|
}
|
|
113
|
-
export declare const K1 = "A829D283593455015A21E3509347AFD8";
|
package/dist/types/larksr.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EventBase, LocalEvent } from './event/event_base';
|
|
2
2
|
import Application, { APP_STATE } from './lark/application';
|
|
3
|
-
import { AppliParams, AppliParamsUtils, IAppliParams, LoadAppliParamsStartAppInfo } from './appli_params';
|
|
3
|
+
import { AppliParams, AppliParamsUtils, IAppliParams, LoadAppliParamsFromUrl, LoadAppliParamsStartAppInfo } from './appli_params';
|
|
4
4
|
import { LarkEventType } from './lark/lark_event_type';
|
|
5
5
|
import API from './api';
|
|
6
6
|
import ScreenState from './screen_state';
|
|
@@ -12,31 +12,233 @@ import LockPointer from './utils/lock_pointer';
|
|
|
12
12
|
import ScaleMode from './utils/scale_mode';
|
|
13
13
|
import Capabilities from './utils/capabilities';
|
|
14
14
|
declare const enum PlayerModeType {
|
|
15
|
+
/**
|
|
16
|
+
* 普通模式
|
|
17
|
+
*/
|
|
15
18
|
Normal = 0,
|
|
19
|
+
/**
|
|
20
|
+
* 交互模式(可以一人操作多人看)
|
|
21
|
+
*/
|
|
16
22
|
Interactive = 1,
|
|
23
|
+
/**
|
|
24
|
+
* 多人互动模式 (多人可操作)
|
|
25
|
+
*/
|
|
17
26
|
MutiPlayer = 2
|
|
18
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* 当前用户的身份
|
|
30
|
+
*/
|
|
19
31
|
declare const enum UserType {
|
|
32
|
+
/**
|
|
33
|
+
* 观看者
|
|
34
|
+
*/
|
|
20
35
|
Observer = 0,
|
|
36
|
+
/**
|
|
37
|
+
* 操作者
|
|
38
|
+
*/
|
|
21
39
|
Player = 1
|
|
22
40
|
}
|
|
23
|
-
|
|
41
|
+
/**
|
|
42
|
+
* LarkSR 实例会发出的事件
|
|
43
|
+
*/
|
|
44
|
+
declare const enum LarkSRClientEvent {
|
|
45
|
+
/**
|
|
46
|
+
* 连接渲染服务器成功 .
|
|
47
|
+
*/
|
|
48
|
+
CONNECT = "connect",
|
|
49
|
+
/**
|
|
50
|
+
* 登录成功时触发,会返回当前用户id .
|
|
51
|
+
*/
|
|
52
|
+
LOGIN_SUCCESS = "loginsuccess",
|
|
53
|
+
/**
|
|
54
|
+
* 无操作超时时触发 .
|
|
55
|
+
*/
|
|
56
|
+
NO_OPERATION_TIMEOUT = "operatetimeout",
|
|
57
|
+
/**
|
|
58
|
+
* 连接关闭.
|
|
59
|
+
*/
|
|
60
|
+
CLOSE = "close",
|
|
61
|
+
/**
|
|
62
|
+
* 云端应用关闭,但连接未关闭
|
|
63
|
+
*/
|
|
64
|
+
APP_CLOSE = "appclose",
|
|
65
|
+
/**
|
|
66
|
+
* 获取到远端视频流 .
|
|
67
|
+
*/
|
|
68
|
+
GOT_REMOTE_STREAM = "gotremotesteam",
|
|
69
|
+
/**
|
|
70
|
+
* 视频加载成功,等待播放 .
|
|
71
|
+
*/
|
|
72
|
+
MEDIA_LOADED = "meidaloaded",
|
|
73
|
+
/**
|
|
74
|
+
* 视频自动播放成功 .
|
|
75
|
+
*/
|
|
76
|
+
MEDIA_PLAY_SUCCESS = "mediaplaysuccess",
|
|
77
|
+
/**
|
|
78
|
+
* 视频自动播放失败 .
|
|
79
|
+
*/
|
|
80
|
+
MEDIA_PLAY_FAILED = "mediaplayfailed",
|
|
81
|
+
/**
|
|
82
|
+
* 自动播放声音失败,以静音模式播放 .
|
|
83
|
+
*/
|
|
84
|
+
MEDIA_PLAY_MUTE = "meidaplaymute",
|
|
85
|
+
/**
|
|
86
|
+
* 云渲染连接状态改变 .
|
|
87
|
+
*/
|
|
88
|
+
APPSTATE_CHANGE = "appstatechange",
|
|
89
|
+
/**
|
|
90
|
+
* 云端应用大小变化 .
|
|
91
|
+
*/
|
|
92
|
+
APP_RESIZE = "appresize",
|
|
93
|
+
/**
|
|
94
|
+
* 云端应用鼠标模式变化时触发 .
|
|
95
|
+
*/
|
|
96
|
+
APP_MOUSE_MODE = "appmousemode",
|
|
97
|
+
/**
|
|
98
|
+
* 云端应用鼠标状态变化 .
|
|
99
|
+
*/
|
|
100
|
+
APP_CURSOR_MODE = "appcursormode",
|
|
101
|
+
/**
|
|
102
|
+
* 玩家列表 .
|
|
103
|
+
*/
|
|
104
|
+
PLAYER_LIST = "playerlist",
|
|
105
|
+
/**
|
|
106
|
+
* 视频连接状态
|
|
107
|
+
*/
|
|
108
|
+
PEERSTATUS_REPORT = "peerstatusreport",
|
|
109
|
+
/**
|
|
110
|
+
* 云端应用请求输入文字 .
|
|
111
|
+
*/
|
|
112
|
+
APP_REQUEST_INPUT = "apprequestinput",
|
|
113
|
+
/**
|
|
114
|
+
* 云端应用请求手柄震动
|
|
115
|
+
*/
|
|
116
|
+
APP_REQUEST_GAMEPAD_OUPUT = "apprequestgamepadoutput",
|
|
117
|
+
/**
|
|
118
|
+
* 截图成功.
|
|
119
|
+
*/
|
|
120
|
+
CAPTURE_FRAME = "captureframe",
|
|
121
|
+
/**
|
|
122
|
+
* 数据通道打开 .
|
|
123
|
+
*/
|
|
124
|
+
DATACHANNEL_OPEN = "datachannelopen",
|
|
125
|
+
/**
|
|
126
|
+
* 数据通道关闭 .
|
|
127
|
+
*/
|
|
128
|
+
DATACHANNEL_CLOSE = "datachannelclose",
|
|
129
|
+
/**
|
|
130
|
+
* 数据通达收到文字消息 .
|
|
131
|
+
*/
|
|
132
|
+
DATACHANNEL_TEXT = "datachanneltext",
|
|
133
|
+
/**
|
|
134
|
+
* 数据通道收到字节消息 .
|
|
135
|
+
*/
|
|
136
|
+
DATACHANNEL_BINARY = "datachannelbinary",
|
|
137
|
+
/**
|
|
138
|
+
* 更详细的事件状态,主要用于向iframe外部抛出 .
|
|
139
|
+
*/
|
|
140
|
+
LarkEvent = "larkevent",
|
|
141
|
+
/**
|
|
142
|
+
* 发生错误时抛出
|
|
143
|
+
*/
|
|
144
|
+
ERROR = "error",
|
|
145
|
+
/**
|
|
146
|
+
* 一般信息提示
|
|
147
|
+
*/
|
|
148
|
+
INFO = "info"
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* LarkSR 发出的事件
|
|
152
|
+
*/
|
|
153
|
+
interface LarkSREvent extends LocalEvent<LarkSRClientEvent> {
|
|
24
154
|
data?: any;
|
|
25
|
-
message
|
|
155
|
+
message?: string;
|
|
156
|
+
code?: number;
|
|
157
|
+
larkevent?: LarkEventType;
|
|
26
158
|
}
|
|
159
|
+
/**
|
|
160
|
+
* 构造 LarkSR 参数
|
|
161
|
+
*/
|
|
27
162
|
interface ILarkSRConfig {
|
|
163
|
+
/**
|
|
164
|
+
* 必选项 根元素。组件会挂载到跟元素下面
|
|
165
|
+
* @see handelRootElementSize
|
|
166
|
+
* @see scaleMode
|
|
167
|
+
*/
|
|
28
168
|
rootElement: HTMLElement;
|
|
169
|
+
/**
|
|
170
|
+
* 必选项 服务器地址. LarkServer 前台访问的地址
|
|
171
|
+
* 如: http://192.168.0.55:8181/
|
|
172
|
+
*/
|
|
29
173
|
serverAddress: string;
|
|
174
|
+
/**
|
|
175
|
+
* 可选项。 sdk 授权码。如果不在此处填,则必须在后续的实例里调用 initSDKAuthCode 初始化。
|
|
176
|
+
*/
|
|
30
177
|
authCode?: string;
|
|
178
|
+
/**
|
|
179
|
+
* 可选项,授权是否成功
|
|
180
|
+
*/
|
|
31
181
|
authCodeCallback?: (isSuccess: boolean, e: any) => void;
|
|
182
|
+
/**
|
|
183
|
+
* 可选项,载入时的背景图片 url
|
|
184
|
+
*/
|
|
185
|
+
loadingBgUrl?: string;
|
|
186
|
+
/**
|
|
187
|
+
* 可选项,是否同步传入根的组件的大小样式。
|
|
188
|
+
* 默认开启,将跟组件大小设置为浏览器视口大小
|
|
189
|
+
* 如果关闭,内部组件将按照传入的根元素大小去显示
|
|
190
|
+
* 注意,当关闭时不会自动填充根元素,如果根元素高度为 0 将显示不出来。
|
|
191
|
+
* 注意,当关闭时 mobileForceLandscape 将失去作用。
|
|
192
|
+
*/
|
|
193
|
+
handelRootElementSize?: boolean;
|
|
194
|
+
/**
|
|
195
|
+
* 是否在sdk内部监听鼠标键盘等输入事件
|
|
196
|
+
* 如果关闭需要手动发送输入事件
|
|
197
|
+
* 注意关闭时全屏模式和锁定模式将失效,需要在sdk外部触发
|
|
198
|
+
* @see fullScreenMode
|
|
199
|
+
*/
|
|
200
|
+
handlInput?: boolean;
|
|
201
|
+
/**
|
|
202
|
+
* 当视频播自动放失败时是否尝试静音播放,静音播放时将抛出事件
|
|
203
|
+
* 静音播放当用户操作屏幕时将尝试播放声音
|
|
204
|
+
*/
|
|
205
|
+
mutePlayWhenFiled?: boolean;
|
|
206
|
+
/**
|
|
207
|
+
* 可选项,是否是 vr 监控类型。
|
|
208
|
+
*/
|
|
32
209
|
isMonitor?: boolean;
|
|
210
|
+
/**
|
|
211
|
+
* 可选项,码率
|
|
212
|
+
*/
|
|
33
213
|
codeRate?: number;
|
|
214
|
+
/**
|
|
215
|
+
* 可选项,帧率
|
|
216
|
+
*/
|
|
34
217
|
frameRate?: number;
|
|
218
|
+
/**
|
|
219
|
+
* 可选项,音频帧率
|
|
220
|
+
*/
|
|
35
221
|
audioCodeRate?: number;
|
|
222
|
+
/**
|
|
223
|
+
* 可选项,日志级别。默认为 warn
|
|
224
|
+
*/
|
|
36
225
|
logLevel?: 'info' | 'warn' | 'error';
|
|
226
|
+
/**
|
|
227
|
+
* 可选项,载入超时时间. 默认为 60s。超过该事件停止载入
|
|
228
|
+
*/
|
|
37
229
|
loadingTimeout?: number;
|
|
230
|
+
/**
|
|
231
|
+
* 可选项,是否自动同步剪贴板数据
|
|
232
|
+
*/
|
|
38
233
|
syncLocalToCloudClipboard?: boolean;
|
|
234
|
+
/**
|
|
235
|
+
* 可选项,优选选择的视频编码格式
|
|
236
|
+
*/
|
|
39
237
|
perferDecoder?: 'auto' | 'vp8' | 'vp9' | 'h264' | 'av1x';
|
|
238
|
+
/**
|
|
239
|
+
* 可选项,视频在容器中的缩放模式
|
|
240
|
+
*
|
|
241
|
+
*/
|
|
40
242
|
scaleMode?: ScaleMode;
|
|
41
243
|
/**
|
|
42
244
|
* 全屏模式
|
|
@@ -45,31 +247,79 @@ interface ILarkSRConfig {
|
|
|
45
247
|
* 2 -》 每次点击触发
|
|
46
248
|
*/
|
|
47
249
|
fullScreenMode?: number;
|
|
250
|
+
/**
|
|
251
|
+
* 可选项,手机端的全屏模式,值同 fullScreenMode
|
|
252
|
+
*/
|
|
48
253
|
mobileFullScreenMode?: number;
|
|
254
|
+
/**
|
|
255
|
+
* 可选项,手机端是否强制横屏
|
|
256
|
+
*/
|
|
49
257
|
mobileForceLandscape?: boolean;
|
|
50
258
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
259
|
+
/**
|
|
260
|
+
* 通过调用后台接口获取云端应用参数
|
|
261
|
+
* @param config 传入 config @see ILarkSRConfig
|
|
262
|
+
* @param params 进入应用接口参数。appliId 为必填项
|
|
263
|
+
* @returns Promise 创建 larksr client 是否成功
|
|
264
|
+
*/
|
|
265
|
+
export declare function CreateLarkSRClientFromeAPI(config: ILarkSRConfig, params: {
|
|
266
|
+
appliId: string;
|
|
267
|
+
playerMode?: number;
|
|
268
|
+
userType?: number;
|
|
269
|
+
roomCode?: string;
|
|
270
|
+
taskId?: string;
|
|
271
|
+
}): Promise<LarkSR>;
|
|
272
|
+
/**
|
|
273
|
+
* 通过从url参数中获取云端应用相关参数
|
|
274
|
+
* @param config 传入 config @see ILarkSRConfig
|
|
275
|
+
* @returns Promise 创建 larksr client 是否成功
|
|
276
|
+
*/
|
|
277
|
+
export declare function CreateLarkSRClientFromeUrl(config: ILarkSRConfig): Promise<unknown>;
|
|
278
|
+
declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
|
|
279
|
+
/**
|
|
280
|
+
* 应用参数,构建时传入
|
|
281
|
+
*/
|
|
59
282
|
get params(): IAppliParams;
|
|
60
283
|
private _params;
|
|
284
|
+
/**
|
|
285
|
+
* 当前的玩家模式,
|
|
286
|
+
*/
|
|
61
287
|
get playerModeType(): PlayerModeType;
|
|
288
|
+
/**
|
|
289
|
+
* 用户类型
|
|
290
|
+
* @see UserType
|
|
291
|
+
*/
|
|
62
292
|
get userType(): UserType;
|
|
293
|
+
/**
|
|
294
|
+
* 是否是观看者模式
|
|
295
|
+
*/
|
|
63
296
|
get isObMode(): boolean;
|
|
297
|
+
/**
|
|
298
|
+
* 当前是否是交互模式,交互默认即可以操作的模式
|
|
299
|
+
*/
|
|
64
300
|
get isInteractiveMode(): boolean;
|
|
301
|
+
/**
|
|
302
|
+
* 当前 app 的状态
|
|
303
|
+
*/
|
|
65
304
|
get appState(): APP_STATE;
|
|
66
305
|
get app(): Application;
|
|
67
306
|
private _app;
|
|
307
|
+
/**
|
|
308
|
+
* 云端画面是否准备好,准备好后才可以发送输入事件
|
|
309
|
+
*/
|
|
68
310
|
get remoteScreenReady(): boolean;
|
|
69
311
|
set remoteScreenReady(ready: boolean);
|
|
70
312
|
private _remoteScreenReady;
|
|
313
|
+
/**
|
|
314
|
+
* 当前的屏幕状态
|
|
315
|
+
* @see ScreenState
|
|
316
|
+
*/
|
|
71
317
|
get screenState(): ScreenState;
|
|
72
318
|
private _screenState;
|
|
319
|
+
/**
|
|
320
|
+
* 当前的输入控制
|
|
321
|
+
* @see Operation
|
|
322
|
+
*/
|
|
73
323
|
get op(): Operation;
|
|
74
324
|
private _op;
|
|
75
325
|
private iframeHandler;
|
|
@@ -78,6 +328,14 @@ declare class LarkSR extends EventBase<LarkEventType, LarkSREvent> {
|
|
|
78
328
|
get lockPointer(): LockPointer;
|
|
79
329
|
private _lockPointer;
|
|
80
330
|
private view;
|
|
331
|
+
/**
|
|
332
|
+
* 视频元素
|
|
333
|
+
*/
|
|
334
|
+
get videoElement(): any;
|
|
335
|
+
/**
|
|
336
|
+
* 视频显示组件
|
|
337
|
+
*/
|
|
338
|
+
get videoComponent(): any;
|
|
81
339
|
get rootElement(): HTMLElement;
|
|
82
340
|
private _rootElement;
|
|
83
341
|
get serverAddress(): string;
|
|
@@ -87,20 +345,74 @@ declare class LarkSR extends EventBase<LarkEventType, LarkSREvent> {
|
|
|
87
345
|
private _config;
|
|
88
346
|
private loadingTimeout;
|
|
89
347
|
private sdkAuth;
|
|
348
|
+
/**
|
|
349
|
+
* LarkSR 客户端。所有操作和事件通过该类传递
|
|
350
|
+
* 注意,如果手动创建该类,要清楚参数的意义,一般只有调试等特殊情况才手动创建该类
|
|
351
|
+
* @see CreateLarkSRClientFromeAPI, CreateLarkSRClientFromeUrl
|
|
352
|
+
* @param config 本地配置,如果有 IAppliParams 相同的配置项,优先级最高
|
|
353
|
+
* @param params 云端应用参数等,通过后台接口或者url参数获取。
|
|
354
|
+
*/
|
|
90
355
|
constructor(config: ILarkSRConfig, params: IAppliParams);
|
|
356
|
+
/**
|
|
357
|
+
*
|
|
358
|
+
* @param id sdk id 初始化sdkid
|
|
359
|
+
* @returns
|
|
360
|
+
*/
|
|
91
361
|
initSDKAuthCode(id: string): Promise<void>;
|
|
362
|
+
/**
|
|
363
|
+
* 开始云渲染流程
|
|
364
|
+
* @returns 是否成功。主要校验授权码是否成功
|
|
365
|
+
*/
|
|
92
366
|
start(): Promise<void>;
|
|
367
|
+
/**
|
|
368
|
+
* 重新开始云渲染流程
|
|
369
|
+
*/
|
|
93
370
|
restart(): void;
|
|
371
|
+
/**
|
|
372
|
+
* 重新启动云端应用
|
|
373
|
+
*/
|
|
94
374
|
restartApp(): void;
|
|
375
|
+
/**
|
|
376
|
+
* 切换当前操作者
|
|
377
|
+
* @param uid 用户id
|
|
378
|
+
*/
|
|
95
379
|
changeOperater(uid: number): void;
|
|
380
|
+
/**
|
|
381
|
+
* 向云端应用发送文字。当云端应用出现输入框时,可以将本地文本填写进去.
|
|
382
|
+
* @param text 文字
|
|
383
|
+
*/
|
|
96
384
|
inputText(text: string): void;
|
|
385
|
+
/**
|
|
386
|
+
* 发送文字消息给数据通道
|
|
387
|
+
* 注意 云端应用要继承数据通道功能
|
|
388
|
+
* @param text 文字
|
|
389
|
+
*/
|
|
97
390
|
sendTextToDataChannel(text: string): void;
|
|
391
|
+
/**
|
|
392
|
+
* 发送字节消息给数据通道
|
|
393
|
+
* 注意 云端应用要继承数据通道功能
|
|
394
|
+
* @param binary 字节消息
|
|
395
|
+
*/
|
|
98
396
|
sendBinaryToDataChannel(binary: Uint8Array): void;
|
|
397
|
+
/**
|
|
398
|
+
* 手动向iframe外抛出事件
|
|
399
|
+
* 注意一般只在用 iframe 二次集成时才用到
|
|
400
|
+
* @param type
|
|
401
|
+
* @param data
|
|
402
|
+
* @param msg
|
|
403
|
+
*/
|
|
99
404
|
postMsg(type: LarkEventType, data?: any, msg?: string): void;
|
|
100
405
|
/**
|
|
101
406
|
* 退出当前页面
|
|
407
|
+
* 注意如果是微信内会调用 WeixinJSBridge 的 close window 方法
|
|
408
|
+
* 可以不使用该方法退出页面
|
|
102
409
|
*/
|
|
103
410
|
quit(): void;
|
|
411
|
+
/**
|
|
412
|
+
* 操作相关事件
|
|
413
|
+
* 所有事件坐标相对于云端应用,不相对于网页
|
|
414
|
+
* @param input 操作指令
|
|
415
|
+
*/
|
|
104
416
|
sendInput(input: CloudLark.IClientInput): void;
|
|
105
417
|
moseMove(PosX: number, PosY: number, DeltaX: number, DeltaY: number): void;
|
|
106
418
|
mouseTap(PosX: number, PosY: number, key: CloudLark.MouseKey): void;
|
|
@@ -118,6 +430,8 @@ declare class LarkSR extends EventBase<LarkEventType, LarkSREvent> {
|
|
|
118
430
|
touchUp(id: number, x: number, y: number): void;
|
|
119
431
|
getMouseButtonType(button: 'left' | 'mid' | 'right'): CloudLark.MouseKey;
|
|
120
432
|
$emit(type: LarkEventType, data?: any, message?: string): void;
|
|
433
|
+
$emitError(message?: string, code?: number): void;
|
|
434
|
+
$emitInfo(message?: string, code?: number): void;
|
|
121
435
|
private createEvent;
|
|
122
436
|
private taskProcess;
|
|
123
437
|
private startProcess;
|
|
@@ -135,4 +449,4 @@ declare class LarkSR extends EventBase<LarkEventType, LarkSREvent> {
|
|
|
135
449
|
private onOperationTimeout;
|
|
136
450
|
private onOperationInput;
|
|
137
451
|
}
|
|
138
|
-
export { LarkSR, ILarkSRConfig, PlayerModeType, UserType, LarkSREvent, AppliParams, AppliParamsUtils, LoadAppliParamsStartAppInfo, EventBase,
|
|
452
|
+
export { LarkSR, ILarkSRConfig, PlayerModeType, UserType, LarkSREvent, LarkEventType, LarkSRClientEvent, AppliParams, AppliParamsUtils, LoadAppliParamsFromUrl, LoadAppliParamsStartAppInfo, EventBase, API, Operation, Capabilities, ScaleMode, KEYMAP, CloudLark, FullScreen, LockPointer, };
|
|
@@ -31,6 +31,10 @@ export default class Operation extends EventBase<OPREATION_EVENT_TYPE, Operation
|
|
|
31
31
|
get fullScreen(): import("../larksr").FullScreen;
|
|
32
32
|
get lockPointer(): import("../larksr").LockPointer;
|
|
33
33
|
constructor(rootElement: HTMLElement, larksr: LarkSR);
|
|
34
|
+
setMouseEnable(enable: boolean): void;
|
|
35
|
+
setKeyboardEnable(enable: boolean): void;
|
|
36
|
+
setGamepadEnable(enable: boolean): void;
|
|
37
|
+
setTouchEnable(enable: boolean): void;
|
|
34
38
|
resetLocalRendreMousePosition(): void;
|
|
35
39
|
setAppMouseMode(mode: CloudLark.IAppMouseMode): void;
|
|
36
40
|
startListening(): void;
|
|
@@ -103,6 +103,6 @@ export default class ScreenState extends EventBase<SCREEN_EVENT_TYPE, ScreenEven
|
|
|
103
103
|
private mobileForceLandScape;
|
|
104
104
|
private bgColor;
|
|
105
105
|
private handelRootElementSize;
|
|
106
|
-
constructor(rootElement: HTMLElement, params: IAppliParams);
|
|
106
|
+
constructor(rootElement: HTMLElement, params: IAppliParams, handelRootElementSize?: boolean);
|
|
107
107
|
resize(): void;
|
|
108
108
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "larksr_websdk",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.1",
|
|
4
4
|
"description": "larksr websdk. http://www.pingxingyun.com",
|
|
5
|
+
"keywords": ["pingxingyun", "larksr", "cloudrendeing", "webrtc", "cloudxr"],
|
|
5
6
|
"main": "./dist/larksr-web-sdk.min.js",
|
|
6
7
|
"types": "./dist/types/index.d.ts",
|
|
7
8
|
"files": [
|
|
@@ -18,19 +19,16 @@
|
|
|
18
19
|
"author": "fcx@pingxingyun.com",
|
|
19
20
|
"license": "ISC",
|
|
20
21
|
"dependencies": {
|
|
21
|
-
"@types/crypto-js": "^4.0.2",
|
|
22
|
-
"@types/text-encoding": "^0.0.36",
|
|
23
|
-
"@types/webrtc": "^0.0.30",
|
|
24
22
|
"axios": "^0.24.0",
|
|
25
23
|
"bowser": "^2.11.0",
|
|
26
24
|
"core-js": "^3.18.1",
|
|
27
25
|
"crypto-js": "^4.1.1",
|
|
28
26
|
"protobufjs": "^6.11.2",
|
|
29
|
-
"
|
|
30
|
-
"webrtc-adapter": "^8.1.0",
|
|
31
|
-
"worker-loader": "^3.0.8"
|
|
27
|
+
"webrtc-adapter": "^8.1.0"
|
|
32
28
|
},
|
|
33
29
|
"devDependencies": {
|
|
30
|
+
"@types/crypto-js": "^4.0.2",
|
|
31
|
+
"@types/webrtc": "^0.0.30",
|
|
34
32
|
"@babel/core": "^7.15.5",
|
|
35
33
|
"@tsconfig/svelte": "^2.0.1",
|
|
36
34
|
"babel-loader": "^8.2.2",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
!function(){"use strict";const e=self;var s=!1,t=0;e.addEventListener("message",(a=>{switch(a.data){case"start":s||(s=!0,t=setInterval((()=>{e.postMessage("tick")}),1e4));break;case"stop":clearInterval(t),s=!1}}),!1)}();
|