larksr_websdk 3.2.3 → 3.2.7

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 (65) hide show
  1. package/README.md +32 -24
  2. package/dist/doc/functions.md +2 -2
  3. package/dist/doc/index.md +43 -3
  4. package/dist/doc/member_variables.md +148 -0
  5. package/dist/larksr-web-sdk.min.js +3 -3
  6. package/dist/types/api.d.ts +3 -0
  7. package/dist/types/appli_params.d.ts +21 -2
  8. package/dist/types/index.d.ts +5 -2
  9. package/dist/types/larksr.d.ts +59 -8
  10. package/dist/types/screen_state.d.ts +1 -0
  11. package/package.json +11 -7
  12. package/types/api.d.ts +88 -0
  13. package/types/appli_params.d.ts +263 -0
  14. package/{dist/types → types}/common/cmd.d.ts +0 -0
  15. package/{dist/types → types}/common/constant.d.ts +0 -0
  16. package/{dist/types → types}/common/interface.d.ts +0 -0
  17. package/types/config.d.ts +59 -0
  18. package/{dist/types → types}/event/bus.d.ts +0 -0
  19. package/{dist/types → types}/event/event_base.d.ts +0 -0
  20. package/{dist/types → types}/event/events.d.ts +0 -0
  21. package/{dist/types → types}/event/iframe_poster.d.ts +0 -0
  22. package/{dist/types → types}/event/message.d.ts +0 -0
  23. package/types/index.d.ts +24 -0
  24. package/{dist/types → types}/lark/Worker.d.ts +0 -0
  25. package/{dist/types → types}/lark/application.d.ts +5 -2
  26. package/{dist/types → types}/lark/custom.d.ts +0 -0
  27. package/{dist/types → types}/lark/lark_event_type.d.ts +1 -1
  28. package/{dist/types → types}/lark/message.d.ts +5 -4
  29. package/{dist/types → types}/lark/peer_connection.d.ts +0 -0
  30. package/{dist/types → types}/lark/sdp_util.d.ts +0 -0
  31. package/types/lark/test_pixel_streaming.d.ts +54 -0
  32. package/{dist/types → types}/lark/websocket_channel.d.ts +0 -0
  33. package/{dist/types → types}/lark/websocket_proxy.d.ts +0 -0
  34. package/types/larksr.d.ts +509 -0
  35. package/{dist/types → types}/localization/base.d.ts +0 -0
  36. package/{dist/types → types}/localization/gesture_ins.d.ts +0 -0
  37. package/{dist/types → types}/localization/language.d.ts +0 -0
  38. package/{dist/types → types}/localization/loader.d.ts +0 -0
  39. package/{dist/types → types}/localization/message.d.ts +0 -0
  40. package/{dist/types → types}/localization/ui.d.ts +0 -0
  41. package/{dist/types → types}/operation/gamepad_handler.d.ts +0 -0
  42. package/{dist/types → types}/operation/gesture.d.ts +0 -0
  43. package/{dist/types → types}/operation/gesture_handler.d.ts +0 -0
  44. package/{dist/types → types}/operation/handler_base.d.ts +0 -0
  45. package/{dist/types → types}/operation/keyboard_handler.d.ts +0 -0
  46. package/types/operation/keymap.d.ts +24 -0
  47. package/{dist/types → types}/operation/letter_keymap.d.ts +0 -0
  48. package/{dist/types → types}/operation/mouse_handler.d.ts +0 -0
  49. package/{dist/types → types}/operation/num_keymap.d.ts +0 -0
  50. package/{dist/types → types}/operation/operation.d.ts +0 -0
  51. package/types/operation/pixel_streaming_input.d.ts +82 -0
  52. package/{dist/types → types}/operation/touch_handler.d.ts +0 -0
  53. package/{dist/types → types}/operation/utils.d.ts +0 -0
  54. package/{dist/types → types}/protobuf/cloudlark.d.ts +0 -0
  55. package/{dist/types → types}/protobuf/message.d.ts +0 -0
  56. package/types/screen_state.d.ts +109 -0
  57. package/types/sdk_auth.d.ts +11 -0
  58. package/{dist/types → types}/utils/browser_type.d.ts +0 -0
  59. package/{dist/types → types}/utils/capabilities.d.ts +0 -0
  60. package/{dist/types → types}/utils/full_screen.d.ts +0 -0
  61. package/{dist/types → types}/utils/lock_pointer.d.ts +0 -0
  62. package/{dist/types → types}/utils/log.d.ts +0 -0
  63. package/{dist/types → types}/utils/scale_mode.d.ts +0 -0
  64. package/{dist/types → types}/utils/unit.d.ts +0 -0
  65. package/dist/types/operation/keymap.d.ts +0 -20
@@ -36,6 +36,8 @@ export interface GetTaskResult {
36
36
  }
37
37
  export interface StartAppInfo {
38
38
  appliId: string;
39
+ appliType: number;
40
+ appliName: string;
39
41
  taskId: string;
40
42
  renderServerIp: string;
41
43
  wsProxy: string;
@@ -63,6 +65,7 @@ export interface StartAppInfo {
63
65
  playerMode?: number;
64
66
  userType?: number;
65
67
  roomCode?: string;
68
+ nickName?: string;
66
69
  nickname?: string;
67
70
  }
68
71
  export default class API {
@@ -1,5 +1,6 @@
1
1
  import ScaleMode from './utils/scale_mode';
2
2
  import { StartAppInfo } from './api';
3
+ import { ILarkSRConfig } from './larksr';
3
4
  export interface IAppliParams {
4
5
  /**
5
6
  * appserver 的ip地址
@@ -9,6 +10,10 @@ export interface IAppliParams {
9
10
  * appserver 的端口号
10
11
  */
11
12
  appPort: string;
13
+ /**
14
+ * appli type
15
+ */
16
+ appliType: number;
12
17
  /**
13
18
  * 是否使用 websocket 代理
14
19
  */
@@ -24,7 +29,7 @@ export interface IAppliParams {
24
29
  /**
25
30
  * 当前应用名称
26
31
  */
27
- courseName: string;
32
+ appliName: string;
28
33
  /**
29
34
  * @deprecated
30
35
  * 应用的宽高。现在云端自动获取宽高
@@ -184,13 +189,25 @@ export interface IAppliParams {
184
189
  enableSoundRequire: boolean;
185
190
  toastLevel: number;
186
191
  }
192
+ export declare enum AppliType {
193
+ DESKTOP = 1,
194
+ SHARED = 2,
195
+ PIXEL_STREAMING = 13,
196
+ VR = 3,
197
+ VR_STEAM = 5,
198
+ NV_VR = 6,
199
+ XR = 7,
200
+ PXY_AR = 9,
201
+ NV_AR = 11
202
+ }
187
203
  export declare class AppliParams implements IAppliParams {
188
204
  appServer: string;
189
205
  appPort: string;
206
+ appliType: AppliType;
190
207
  wsProxy: boolean;
191
208
  preferPubOutIp: string;
192
209
  taskid: string;
193
- courseName: string;
210
+ appliName: string;
194
211
  width: number;
195
212
  height: number;
196
213
  scaleMode: ScaleMode;
@@ -228,6 +245,8 @@ export declare class AppliParams implements IAppliParams {
228
245
  enableRttIcon: boolean;
229
246
  enableSoundRequire: boolean;
230
247
  toastLevel: number;
248
+ static copyAndCreate(params?: IAppliParams): AppliParams;
249
+ static setUpWithSDKConfig(params: IAppliParams, config: ILarkSRConfig): AppliParams;
231
250
  }
232
251
  export declare function CreateAppliParams(): IAppliParams;
233
252
  export declare class AppliParamsUtils {
@@ -1,5 +1,5 @@
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";
2
+ import { LarkSR, CreateLarkSRClientFromeAPI, CreateLarkSRClientFromeUrl, LarkEventType, LarkSRClientEvent, AppliParams, LoadAppliParamsFromUrl, AppliParamsUtils, LoadAppliParamsStartAppInfo, EventBase, API, Operation, Capabilities, ScaleMode, CloudLark, FullScreen, LockPointer, ILarkSRConfig, PlayerModeType, UserType, LarkSREvent } from "./larksr";
3
3
  declare const _default: {
4
4
  LarkSR: typeof LarkSR;
5
5
  CreateLarkSRClientFromeAPI: typeof CreateLarkSRClientFromeAPI;
@@ -16,6 +16,9 @@ declare const _default: {
16
16
  FullScreen: typeof FullScreen;
17
17
  LockPointer: typeof LockPointer;
18
18
  Operation: typeof Operation;
19
+ LarkSRClientEvent: typeof LarkSRClientEvent;
20
+ LarkEventType: typeof LarkEventType;
21
+ KEYMAP: import("./operation/keymap").VritualKeyMapOptions;
19
22
  };
20
23
  export default _default;
21
- export { LarkEventType, LarkSRClientEvent, KEYMAP, ILarkSRConfig, PlayerModeType, UserType, LarkSREvent, };
24
+ export { ILarkSRConfig, PlayerModeType, UserType, LarkSREvent, };
@@ -10,7 +10,7 @@ import API from './api';
10
10
  import ScreenState from './screen_state';
11
11
  import Operation from './operation/operation';
12
12
  import { CloudLark } from './protobuf/cloudlark';
13
- import { KEYMAP } from './operation/keymap';
13
+ import { KEYMAP, VirtualKey } from './operation/keymap';
14
14
  import FullScreen from './utils/full_screen';
15
15
  import LockPointer from './utils/lock_pointer';
16
16
  import ScaleMode from './utils/scale_mode';
@@ -45,7 +45,7 @@ declare const enum UserType {
45
45
  /**
46
46
  * LarkSR 实例会发出的事件
47
47
  */
48
- declare const enum LarkSRClientEvent {
48
+ declare enum LarkSRClientEvent {
49
49
  /**
50
50
  * 连接渲染服务器成功 .
51
51
  */
@@ -261,6 +261,10 @@ interface ILarkSRConfig {
261
261
  * 可选项,手机端是否强制横屏
262
262
  */
263
263
  mobileForceLandscape?: boolean;
264
+ /**
265
+ * 初始化鼠标模式, true 锁定,false 非锁定
266
+ */
267
+ initCursorMode?: boolean;
264
268
  }
265
269
  /**
266
270
  * 通过调用后台接口获取云端应用参数
@@ -274,6 +278,7 @@ export declare function CreateLarkSRClientFromeAPI(config: ILarkSRConfig, params
274
278
  userType?: number;
275
279
  roomCode?: string;
276
280
  taskId?: string;
281
+ nickname?: string;
277
282
  }): Promise<LarkSR>;
278
283
  /**
279
284
  * 通过从url参数中获取云端应用相关参数
@@ -285,7 +290,7 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
285
290
  /**
286
291
  * 应用参数,构建时传入
287
292
  */
288
- get params(): IAppliParams;
293
+ get params(): AppliParams;
289
294
  private _params;
290
295
  /**
291
296
  * 当前的玩家模式,
@@ -304,6 +309,7 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
304
309
  * 当前是否是交互模式,交互默认即可以操作的模式
305
310
  */
306
311
  get isInteractiveMode(): boolean;
312
+ get isPixelStreaming(): boolean;
307
313
  /**
308
314
  * 当前 app 的状态
309
315
  */
@@ -328,20 +334,32 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
328
334
  */
329
335
  get op(): Operation;
330
336
  private _op;
337
+ /**
338
+ * 像素流送输入控制
339
+ */
340
+ private pixelInput;
331
341
  private iframeHandler;
332
342
  get fullScreen(): FullScreen;
333
343
  private _fullScreen;
334
344
  get lockPointer(): LockPointer;
335
345
  private _lockPointer;
336
- private view;
346
+ private _view;
337
347
  /**
338
348
  * 视频元素
339
349
  */
340
- get videoElement(): any;
350
+ get videoElement(): HTMLVideoElement;
341
351
  /**
342
352
  * 视频显示组件
343
353
  */
344
354
  get videoComponent(): any;
355
+ /**
356
+ * 视频显示组件的父容器
357
+ */
358
+ get containerElement(): any;
359
+ /**
360
+ *
361
+ */
362
+ get viewportElement(): any;
345
363
  get rootElement(): HTMLElement;
346
364
  private _rootElement;
347
365
  get serverAddress(): string;
@@ -351,22 +369,51 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
351
369
  private _config;
352
370
  private loadingTimeout;
353
371
  private sdkAuth;
372
+ /**
373
+ * 后台分配的用户id
374
+ */
375
+ get uid(): number;
376
+ private _uid;
377
+ /**
378
+ * @returns 是否是 Task的拥有者
379
+ */
380
+ isTaskOwner(): boolean;
381
+ _isTaskOwner: boolean;
354
382
  /**
355
383
  * LarkSR 客户端。所有操作和事件通过该类传递
356
384
  * 注意,如果手动创建该类,要清楚参数的意义,一般只有调试等特殊情况才手动创建该类
357
385
  * @see CreateLarkSRClientFromeAPI, CreateLarkSRClientFromeUrl
358
386
  * @param config 本地配置,如果有 IAppliParams 相同的配置项,优先级最高
359
- * @param params 云端应用参数等,通过后台接口或者url参数获取。
387
+ * @param params [可选参数] 云端应用参数等,通过后台接口或者url参数获取。
360
388
  */
361
- constructor(config: ILarkSRConfig, params: IAppliParams);
389
+ constructor(config: ILarkSRConfig, params?: IAppliParams);
362
390
  /**
363
391
  *
364
392
  * @param id sdk id 初始化sdkid
365
393
  * @returns
366
394
  */
367
395
  initSDKAuthCode(id: string): Promise<void>;
396
+ /**
397
+ * 连接云端渲染资源
398
+ * @params appID 云端资源的 ID
399
+ * @returns Promise 调用接口并校验授权通过返回成功并自动开始连接
400
+ */
401
+ connect(params: {
402
+ appliId: string;
403
+ playerMode?: number;
404
+ userType?: number;
405
+ roomCode?: string;
406
+ taskId?: string;
407
+ nickname?: string;
408
+ }): Promise<void>;
409
+ /**
410
+ * 手动重设进入应用参数
411
+ * @param params
412
+ */
413
+ setAppliParams(params: IAppliParams): void;
368
414
  /**
369
415
  * 开始云渲染流程
416
+ * 启动时应用参数不能为空,包括 taskID,appServer,appPort
370
417
  * @returns 是否成功。主要校验授权码是否成功
371
418
  */
372
419
  start(): Promise<void>;
@@ -378,6 +425,10 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
378
425
  * 重新启动云端应用
379
426
  */
380
427
  restartApp(): void;
428
+ /**
429
+ * 主动关闭连接
430
+ */
431
+ close(): void;
381
432
  /**
382
433
  * 切换当前操作者
383
434
  * @param uid 用户id
@@ -455,4 +506,4 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
455
506
  private onOperationTimeout;
456
507
  private onOperationInput;
457
508
  }
458
- export { LarkSR, ILarkSRConfig, PlayerModeType, UserType, LarkSREvent, LarkEventType, LarkSRClientEvent, AppliParams, AppliParamsUtils, LoadAppliParamsFromUrl, LoadAppliParamsStartAppInfo, EventBase, API, Operation, Capabilities, ScaleMode, KEYMAP, CloudLark, FullScreen, LockPointer, };
509
+ export { LarkSR, ILarkSRConfig, PlayerModeType, UserType, LarkSREvent, LarkEventType, LarkSRClientEvent, AppliParams, AppliParamsUtils, LoadAppliParamsFromUrl, LoadAppliParamsStartAppInfo, EventBase, API, Operation, Capabilities, ScaleMode, VirtualKey, KEYMAP, CloudLark, FullScreen, LockPointer, };
@@ -104,5 +104,6 @@ export default class ScreenState extends EventBase<SCREEN_EVENT_TYPE, ScreenEven
104
104
  private bgColor;
105
105
  private handelRootElementSize;
106
106
  constructor(rootElement: HTMLElement, params: IAppliParams, handelRootElementSize?: boolean);
107
+ reset(params: IAppliParams): void;
107
108
  resize(): void;
108
109
  }
package/package.json CHANGED
@@ -1,18 +1,21 @@
1
1
  {
2
2
  "name": "larksr_websdk",
3
- "version": "3.2.3",
4
- "description": "larksr websdk. http://www.pingxingyun.com",
3
+ "version": "3.2.7",
4
+ "description": "Larksr websdk. Easy to build a cloud render client for larksr system or ue4 pixelstreaming.docs: https://pingxingyun.github.io/webclient_sdk/",
5
5
  "keywords": [
6
6
  "pingxingyun",
7
7
  "larksr",
8
8
  "cloudrendeing",
9
9
  "webrtc",
10
- "cloudxr"
10
+ "cloudxr",
11
+ "pixelstreaming"
11
12
  ],
12
13
  "main": "./dist/larksr-web-sdk.min.js",
13
- "types": "./dist/types/index.d.ts",
14
+ "types": "./types/index.d.ts",
14
15
  "files": [
15
- "dist"
16
+ "dist",
17
+ "types",
18
+ "doc,"
16
19
  ],
17
20
  "scripts": {
18
21
  "test": "echo \"Error: no test specified\" && exit 1",
@@ -20,7 +23,7 @@
20
23
  "build": "webpack --config webpack.config.js",
21
24
  "build:typings": "tsc --build tsconfig.type.json",
22
25
  "copy-dts": "copyfiles -u 1 \"src/**/*.d.ts\" dist/types/",
23
- "dist": "webpack --config webpack.config.js && copyfiles -u 1 \"src/**/*.d.ts\" dist/types/ && copyfiles -u 1 \"doc/*\" dist/doc/"
26
+ "dist": "webpack --config webpack.config.js && copyfiles -u 1 \"src/**/*.d.ts\" ./types/ && copyfiles -u 1 \"doc/*\" dist/doc/ && copyfiles -u 1 \"types/*\" ./dist/types/"
24
27
  },
25
28
  "author": "fcx@pingxingyun.com",
26
29
  "license": "ISC",
@@ -30,7 +33,8 @@
30
33
  "core-js": "^3.18.1",
31
34
  "crypto-js": "^4.1.1",
32
35
  "protobufjs": "^6.11.2",
33
- "webrtc-adapter": "^8.1.0"
36
+ "webrtc-adapter": "^8.1.0",
37
+ "weixin-js-sdk": "^1.6.0"
34
38
  },
35
39
  "devDependencies": {
36
40
  "@babel/core": "^7.15.5",
package/types/api.d.ts ADDED
@@ -0,0 +1,88 @@
1
+ import { ILarkSRConfig } from './larksr';
2
+ import { AppliParams } from './appli_params';
3
+ export interface UTLockInfo {
4
+ checkUtLockMessage: string;
5
+ checkUtLockResult: boolean;
6
+ remainMinutes: number;
7
+ }
8
+ export interface GetTaskResult {
9
+ adminViewer: number;
10
+ appKey: string;
11
+ appliId: string;
12
+ appliType: number;
13
+ city: string;
14
+ clientIp: string;
15
+ country: string;
16
+ createDate: string;
17
+ dcs: number;
18
+ limitMaxFps: number;
19
+ offScreen: number;
20
+ playerListToggle: number;
21
+ playerMode: number;
22
+ province: string;
23
+ publicIp: string;
24
+ reserveFlag: number;
25
+ serverId: string;
26
+ serverIp: string;
27
+ shareUrl: string;
28
+ startAt: string;
29
+ startParam: string;
30
+ startProcType: number;
31
+ status: number;
32
+ taskId: string;
33
+ updateDate: string;
34
+ useGamepad: number;
35
+ wm: number;
36
+ }
37
+ export interface StartAppInfo {
38
+ appliId: string;
39
+ appliType: number;
40
+ appliName: string;
41
+ taskId: string;
42
+ renderServerIp: string;
43
+ wsProxy: string;
44
+ preferPublicIp: string;
45
+ renderServerPort: number;
46
+ initCursorMode: number;
47
+ rttLimit: string;
48
+ touchOperateMode: string;
49
+ fullScreenMode: number;
50
+ mobileForceLandscape: number;
51
+ mobileFullScreenMode: number;
52
+ language: string;
53
+ noOperationTimeout: string;
54
+ serverId: string;
55
+ network: string;
56
+ playerListToggle: number;
57
+ bgColor: string;
58
+ logLevel: string;
59
+ mobileVirtualJoystick: number;
60
+ initWinSize: number;
61
+ taskStatus: number;
62
+ mouseZoomDirection: number;
63
+ useGamepad: number;
64
+ rttLimitInterval: string;
65
+ playerMode?: number;
66
+ userType?: number;
67
+ roomCode?: string;
68
+ nickName?: string;
69
+ nickname?: string;
70
+ }
71
+ export default class API {
72
+ static CheckUTLockInfoPath: string;
73
+ static GetTaskPATH: string;
74
+ static ClientLogErrorPath: string;
75
+ static GetStartInfoPath: string;
76
+ static GetStartInfo(serverAddress: string, params: {
77
+ appliId: string;
78
+ playerMode?: number;
79
+ userType?: number;
80
+ roomCode?: string;
81
+ taskId?: string;
82
+ }): Promise<StartAppInfo>;
83
+ static CheckUTLockInfo(config: ILarkSRConfig): Promise<UTLockInfo>;
84
+ static GetTask(config: ILarkSRConfig, taskid: string): Promise<GetTaskResult>;
85
+ static LogError(errorCode: number, errorMsg: string, params: string, config: ILarkSRConfig): void;
86
+ static ClientInfo(config: ILarkSRConfig, params: AppliParams): void;
87
+ static joinParam(params: any): string;
88
+ }
@@ -0,0 +1,263 @@
1
+ import ScaleMode from './utils/scale_mode';
2
+ import { StartAppInfo } from './api';
3
+ import { ILarkSRConfig } from './larksr';
4
+ export interface IAppliParams {
5
+ /**
6
+ * appserver 的ip地址
7
+ */
8
+ appServer: string;
9
+ /**
10
+ * appserver 的端口号
11
+ */
12
+ appPort: string;
13
+ /**
14
+ * appli type
15
+ */
16
+ appliType: number;
17
+ /**
18
+ * 是否使用 websocket 代理
19
+ */
20
+ wsProxy: boolean;
21
+ /**
22
+ * 优先使用的外网ip. 用在webrtc ice处替换为高优先级的ip
23
+ */
24
+ preferPubOutIp: string;
25
+ /**
26
+ * taskid
27
+ */
28
+ taskid: string;
29
+ /**
30
+ * 当前应用名称
31
+ */
32
+ appliName: string;
33
+ /**
34
+ * @deprecated
35
+ * 应用的宽高。现在云端自动获取宽高
36
+ */
37
+ width: number;
38
+ /**
39
+ * @deprecated
40
+ * 应用的宽高。现在云端自动获取宽高
41
+ */
42
+ height: number;
43
+ /**
44
+ * 缩放模式
45
+ */
46
+ scaleMode: ScaleMode;
47
+ /**
48
+ * 日志级别
49
+ * @default 'warn'
50
+ */
51
+ logLevel: 'info' | 'warn' | 'error';
52
+ /**
53
+ * 无操作时间。超时断开连接.
54
+ */
55
+ noOperationTimeout: number;
56
+ /**
57
+ * 是否显示右下角的水印。
58
+ */
59
+ waterMark: boolean;
60
+ /**
61
+ * 检测的rtt值,rtt超过该值将提示用户网络环境差
62
+ */
63
+ rttLimit: number;
64
+ /**
65
+ * 检测的丢包率。丢包率超过该值提示用户网络环境差
66
+ */
67
+ packetLostLimit: number;
68
+ /**
69
+ * 丢包率和rtt提示的时间间隔。
70
+ */
71
+ rttLimitInterval: number;
72
+ /**
73
+ * 码率. 用在在创建 webrtc sdp时替换为此码率。
74
+ */
75
+ codeRate: number;
76
+ /**
77
+ * audio code rate
78
+ * https://stackoverflow.com/questions/33649283/how-to-set-up-sdp-for-high-quality-opus-audio
79
+ * a=fmtp:111 minptime=10;useinbandfec=1; stereo=1; maxaveragebitrate=510000
80
+ */
81
+ audioCodeRate: number;
82
+ /**
83
+ * 帧率,在登录task时传给后端。
84
+ */
85
+ frameRate: number;
86
+ /**
87
+ * 网络状态,影响 webrtc offer 创建时最低码率。
88
+ */
89
+ network: 'local' | 'public';
90
+ /**
91
+ * 使用的语言,目前只支持英语和中文。
92
+ */
93
+ language: string;
94
+ /**
95
+ * 初始的鼠标锁定模式
96
+ * false:非锁定模式
97
+ * true:锁定模式
98
+ */
99
+ initCursorMode: boolean;
100
+ /**
101
+ * 背景颜色
102
+ */
103
+ bgColor: string;
104
+ /**
105
+ * 全屏模式
106
+ * 0 -》 用户手动触发
107
+ * 1 -》 首次点击进入触发
108
+ * 2 -》 每次点击触发
109
+ */
110
+ fullScreenMode: number;
111
+ /**
112
+ * 手机端全屏模式
113
+ * 0 -》 用户手动触发
114
+ * 1 -》 首次点击进入触发
115
+ * 2 -》 每次点击触发
116
+ */
117
+ mobileFullScreenMode: number;
118
+ /**
119
+ * 一人操作多人看 0 普通模式 1 交互模式(可以一人操作多人看)
120
+ * 2 多人互动模式,鼠标键盘都放开
121
+ */
122
+ playerMode: number;
123
+ /**
124
+ * 用户类型 number
125
+ * 所有者:1 观察者:0;
126
+ */
127
+ userType: number;
128
+ /**
129
+ * 用户昵称
130
+ */
131
+ nickname: string;
132
+ /**
133
+ * 口令:8位唯一码,写入TaskInfo. 房间code,备用。
134
+ */
135
+ roomCode: number;
136
+ /**
137
+ * debug task. 跳过task检测
138
+ */
139
+ debugTask: boolean;
140
+ /**
141
+ * debug webserver
142
+ */
143
+ debugWebServer: string;
144
+ /**
145
+ * laoding timeout
146
+ * 5 * 60
147
+ */
148
+ loadingTimeout: number;
149
+ /**
150
+ * share url
151
+ */
152
+ shareUrl: boolean;
153
+ /**
154
+ * 是否强制横屏
155
+ */
156
+ mobileForceLandscape: boolean;
157
+ /**
158
+ * 移动端初始化初始化是否显示手柄
159
+ */
160
+ mobileVirtualJoystick: boolean;
161
+ /**
162
+ * mouseZoomDirection
163
+ * 用于移动端捏合缩放操作与应用鼠标缩放的对应关系
164
+ * 1:鼠标滚轮向上为放大,
165
+ * 0:鼠标滚轮向下为放大(default)
166
+ */
167
+ mouseZoomDirection: number;
168
+ /**
169
+ * 初始是否显示玩家列表
170
+ */
171
+ showPlayerList: boolean;
172
+ /**
173
+ * 优先使用的解码器
174
+ */
175
+ perferDecoder: 'auto' | 'vp8' | 'vp9' | 'h264' | 'av1x';
176
+ /**
177
+ * 触摸操作对应的操作方式,触摸屏还是鼠标
178
+ */
179
+ touchOperateMode: 'touchScreen' | 'mouse';
180
+ /**
181
+ * appid
182
+ */
183
+ appliId: string;
184
+ /**
185
+ *
186
+ */
187
+ syncLocalToCloudClipboard: boolean;
188
+ enableRttIcon: boolean;
189
+ enableSoundRequire: boolean;
190
+ toastLevel: number;
191
+ }
192
+ export declare enum AppliType {
193
+ DESKTOP = 1,
194
+ SHARED = 2,
195
+ PIXEL_STREAMING = 13,
196
+ VR = 3,
197
+ VR_STEAM = 5,
198
+ NV_VR = 6,
199
+ XR = 7,
200
+ PXY_AR = 9,
201
+ NV_AR = 11
202
+ }
203
+ export declare class AppliParams implements IAppliParams {
204
+ appServer: string;
205
+ appPort: string;
206
+ appliType: AppliType;
207
+ wsProxy: boolean;
208
+ preferPubOutIp: string;
209
+ taskid: string;
210
+ appliName: string;
211
+ width: number;
212
+ height: number;
213
+ scaleMode: ScaleMode;
214
+ logLevel: 'info' | 'warn' | 'error';
215
+ noOperationTimeout: number;
216
+ waterMark: boolean;
217
+ rttLimit: number;
218
+ packetLostLimit: number;
219
+ rttLimitInterval: number;
220
+ codeRate: number;
221
+ audioCodeRate: number;
222
+ frameRate: number;
223
+ network: 'local' | 'public';
224
+ language: string;
225
+ initCursorMode: boolean;
226
+ bgColor: string;
227
+ fullScreenMode: number;
228
+ mobileFullScreenMode: number;
229
+ playerMode: number;
230
+ userType: number;
231
+ nickname: string;
232
+ roomCode: number;
233
+ debugTask: boolean;
234
+ debugWebServer: string;
235
+ loadingTimeout: number;
236
+ shareUrl: boolean;
237
+ mobileForceLandscape: boolean;
238
+ mobileVirtualJoystick: boolean;
239
+ mouseZoomDirection: number;
240
+ showPlayerList: boolean;
241
+ perferDecoder: 'auto' | 'vp8' | 'vp9' | 'h264' | 'av1x';
242
+ touchOperateMode: 'touchScreen' | 'mouse';
243
+ appliId: string;
244
+ syncLocalToCloudClipboard: boolean;
245
+ enableRttIcon: boolean;
246
+ enableSoundRequire: boolean;
247
+ toastLevel: number;
248
+ static copyAndCreate(params?: IAppliParams): AppliParams;
249
+ static setUpWithSDKConfig(params: IAppliParams, config: ILarkSRConfig): AppliParams;
250
+ }
251
+ export declare function CreateAppliParams(): IAppliParams;
252
+ export declare class AppliParamsUtils {
253
+ static getScaleMode(init: number | null | undefined): string;
254
+ static getNetwork(init: number | null | undefined): 'local' | 'public';
255
+ static getLogLevel(level: string | null | undefined): 'info' | 'warn';
256
+ static getBoolOption(option: string | null | undefined | boolean, emptyValue?: boolean): boolean;
257
+ static getNumberBoolOption(option: string | null | undefined | number, emptyValue?: boolean): boolean;
258
+ static getStringOption(option: string | null | undefined, emptyValue?: string): string;
259
+ static getIntOption(option: string | null | undefined, emptyValue?: number): number;
260
+ static getBgColor(option: string | null | undefined): string;
261
+ }
262
+ export declare function LoadAppliParamsFromUrl(): IAppliParams;
263
+ export declare function LoadAppliParamsStartAppInfo(startAppInfo: StartAppInfo): IAppliParams;
File without changes
File without changes
File without changes