larksr_websdk 3.2.16 → 3.2.30

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.
@@ -93,6 +93,7 @@ export default class API {
93
93
  };
94
94
  }>;
95
95
  static GetStartInfo(serverAddress: string, params: {
96
+ sdkId: string;
96
97
  appliId: string;
97
98
  playerMode?: number;
98
99
  userType?: number;
@@ -132,7 +132,7 @@ export interface IAppliParams {
132
132
  /**
133
133
  * 口令:8位唯一码,写入TaskInfo. 房间code,备用。
134
134
  */
135
- roomCode: number;
135
+ roomCode: string;
136
136
  /**
137
137
  * debug task. 跳过task检测
138
138
  */
@@ -231,7 +231,7 @@ export declare class AppliParams implements IAppliParams {
231
231
  playerMode: number;
232
232
  userType: number;
233
233
  nickname: string;
234
- roomCode: number;
234
+ roomCode: string;
235
235
  debugTask: boolean;
236
236
  debugWebServer: string;
237
237
  loadingTimeout: number;
@@ -1,10 +1,7 @@
1
1
  import 'core-js/stable/symbol';
2
- import { LarkSR, CreateLarkSRClientFromePXYHost, CreateLarkSRClientFromeAPI, CreateLarkSRClientFromeUrl, LarkEventType, LarkSRClientEvent, AppliParams, LoadAppliParamsFromUrl, AppliParamsUtils, LoadAppliParamsStartAppInfo, EventBase, API, Operation, Capabilities, ScaleMode, CloudLark, FullScreen, LockPointer, ILarkSRConfig, PlayerModeType, UserType, LarkSREvent } from "./larksr";
2
+ import { LarkSR, 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
- CreateLarkSRClientFromePXYHost: typeof CreateLarkSRClientFromePXYHost;
6
- CreateLarkSRClientFromeAPI: typeof CreateLarkSRClientFromeAPI;
7
- CreateLarkSRClientFromeUrl: typeof CreateLarkSRClientFromeUrl;
8
5
  API: typeof API;
9
6
  AppliParams: typeof AppliParams;
10
7
  LoadAppliParamsFromUrl: typeof LoadAppliParamsFromUrl;
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import { EventBase, LocalEvent } from './event/event_base';
6
6
  import Application, { APP_STATE } from './lark/application';
7
- import { AppliParams, AppliParamsUtils, IAppliParams, LoadAppliParamsFromUrl, LoadAppliParamsStartAppInfo } from './appli_params';
7
+ import { AppliParams, AppliParamsUtils, LoadAppliParamsFromUrl, LoadAppliParamsStartAppInfo } from './appli_params';
8
8
  import { LarkEventType } from './lark/lark_event_type';
9
9
  import API from './api';
10
10
  import ScreenState from './screen_state';
@@ -46,6 +46,14 @@ declare enum UserType {
46
46
  * LarkSR 实例会发出的事件
47
47
  */
48
48
  declare enum LarkSRClientEvent {
49
+ /**
50
+ * TASK 创建成功,返回 Task 相关信息
51
+ */
52
+ TASK_CREATE_SUCCESS = "taskcreatesuccess",
53
+ /**
54
+ * TASK 创建失败
55
+ */
56
+ TASK_CREATE_FAILED = "taskcreatefailed",
49
57
  /**
50
58
  * 连接渲染服务器成功 .
51
59
  */
@@ -192,6 +200,7 @@ interface ILarkSRConfig {
192
200
  authCode?: string;
193
201
  /**
194
202
  * 可选项,授权是否成功
203
+ * @deprecated 目前不会回调该参数。如果SDK验证失败将在 connect 返回失败
195
204
  */
196
205
  authCodeCallback?: (isSuccess: boolean, e: any) => void;
197
206
  /**
@@ -288,46 +297,6 @@ interface ILarkSRConfig {
288
297
  */
289
298
  publicPortMapping?: PublicPortMapping;
290
299
  }
291
- /**
292
- * 通过平行云托管平台创建客户端并启动应用
293
- * @param config 传入 config @see ILarkSRConfig
294
- * @param params 进入应用接口参数。appliId 为必填项
295
- * @returns Promise 创建 larksr client 是否成功
296
- */
297
- export declare function CreateLarkSRClientFromePXYHost(config: ILarkSRConfig, params: {
298
- appliId: string;
299
- playerMode?: number;
300
- userType?: number;
301
- roomCode?: string;
302
- taskId?: string;
303
- nickname?: string;
304
- }): Promise<LarkSR>;
305
- /**
306
- * 通过调用后台接口获取云端应用参数
307
- * @param config 传入 config @see ILarkSRConfig
308
- * @param params 进入应用接口参数。appliId 为必填项
309
- * @returns Promise 创建 larksr client 是否成功
310
- */
311
- export declare function CreateLarkSRClientFromeAPI(config: ILarkSRConfig, params: {
312
- appliId: string;
313
- playerMode?: number;
314
- userType?: number;
315
- roomCode?: string;
316
- taskId?: string;
317
- clientMac?: string;
318
- groupId?: string;
319
- regionId?: string;
320
- targetServerIp?: string;
321
- appKey?: string;
322
- timestamp?: string;
323
- signature?: string;
324
- }): Promise<LarkSR>;
325
- /**
326
- * 通过从url参数中获取云端应用相关参数
327
- * @param config 传入 config @see ILarkSRConfig
328
- * @returns Promise 创建 larksr client 是否成功
329
- */
330
- export declare function CreateLarkSRClientFromeUrl(config: ILarkSRConfig): Promise<LarkSR>;
331
300
  declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
332
301
  /**
333
302
  * 应用参数,构建时传入
@@ -434,7 +403,6 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
434
403
  get config(): ILarkSRConfig;
435
404
  private _config;
436
405
  private loadingTimeout;
437
- private sdkAuth;
438
406
  /**
439
407
  * 后台分配的用户id
440
408
  */
@@ -452,13 +420,11 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
452
420
  get initCursorMode(): boolean;
453
421
  /**
454
422
  * LarkSR 客户端。所有操作和事件通过该类传递
455
- * @see CreateLarkSRClientFromeAPI, @see CreateLarkSRClientFromeUrl @see CreateLarkSRClientFromePXYHost
456
- * @param config 本地配置,如果有 IAppliParams 相同的配置项,优先级最高
457
- * @param params [可选参数] 云端应用参数等,通过后台接口或者url参数获取。
423
+ * @param config 本地配置,优先级最高
458
424
  */
459
- constructor(config: ILarkSRConfig, params?: IAppliParams);
425
+ constructor(config: ILarkSRConfig);
460
426
  /**
461
- *
427
+ * 单独设置sdk授权码,目前总会返回成功 promise,具体验证失败将在 connectWithPxyHost 或 connect 返回
462
428
  * @param id sdk id 初始化sdkid
463
429
  * @returns
464
430
  */
@@ -497,13 +463,13 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
497
463
  * 手动重设进入应用参数
498
464
  * @param params
499
465
  */
500
- setAppliParams(params: IAppliParams): void;
466
+ private setAppliParams;
501
467
  /**
502
468
  * 开始云渲染流程
503
469
  * 启动时应用参数不能为空,包括 taskID,appServer,appPort
504
470
  * @returns 是否成功。主要校验授权码是否成功
505
471
  */
506
- start(): Promise<void>;
472
+ private start;
507
473
  /**
508
474
  * 重新开始云渲染流程
509
475
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "larksr_websdk",
3
- "version": "3.2.16",
3
+ "version": "3.2.30",
4
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",
package/types/api.d.ts CHANGED
@@ -93,6 +93,7 @@ export default class API {
93
93
  };
94
94
  }>;
95
95
  static GetStartInfo(serverAddress: string, params: {
96
+ sdkId: string;
96
97
  appliId: string;
97
98
  playerMode?: number;
98
99
  userType?: number;
@@ -132,7 +132,7 @@ export interface IAppliParams {
132
132
  /**
133
133
  * 口令:8位唯一码,写入TaskInfo. 房间code,备用。
134
134
  */
135
- roomCode: number;
135
+ roomCode: string;
136
136
  /**
137
137
  * debug task. 跳过task检测
138
138
  */
@@ -231,7 +231,7 @@ export declare class AppliParams implements IAppliParams {
231
231
  playerMode: number;
232
232
  userType: number;
233
233
  nickname: string;
234
- roomCode: number;
234
+ roomCode: string;
235
235
  debugTask: boolean;
236
236
  debugWebServer: string;
237
237
  loadingTimeout: number;
package/types/index.d.ts CHANGED
@@ -1,10 +1,7 @@
1
1
  import 'core-js/stable/symbol';
2
- import { LarkSR, CreateLarkSRClientFromePXYHost, CreateLarkSRClientFromeAPI, CreateLarkSRClientFromeUrl, LarkEventType, LarkSRClientEvent, AppliParams, LoadAppliParamsFromUrl, AppliParamsUtils, LoadAppliParamsStartAppInfo, EventBase, API, Operation, Capabilities, ScaleMode, CloudLark, FullScreen, LockPointer, ILarkSRConfig, PlayerModeType, UserType, LarkSREvent } from "./larksr";
2
+ import { LarkSR, 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
- CreateLarkSRClientFromePXYHost: typeof CreateLarkSRClientFromePXYHost;
6
- CreateLarkSRClientFromeAPI: typeof CreateLarkSRClientFromeAPI;
7
- CreateLarkSRClientFromeUrl: typeof CreateLarkSRClientFromeUrl;
8
5
  API: typeof API;
9
6
  AppliParams: typeof AppliParams;
10
7
  LoadAppliParamsFromUrl: typeof LoadAppliParamsFromUrl;
@@ -1,7 +1,7 @@
1
1
  export declare enum LarkEventType {
2
2
  LK_WEB_CLIENT_LOAD_SUCCESS = 1,
3
- LK_API_ENTERAPPLI_SUCCESS = 10,
4
- LK_API_ENTERAPPLI_FAILED = 11,
3
+ LK_TASK_CREATE_SUCCESS = 10,
4
+ LK_TASK_CREATE_FAILED = 11,
5
5
  LK_TASK_SYNC_APP = 20,
6
6
  LK_TASK_SYNC_APP_FAILED = 21,
7
7
  LK_RENDER_SERVER_CONNECTED = 100,
@@ -33,6 +33,7 @@ export declare enum LarkEventType {
33
33
  LK_VIDEO_LOADED = 700,
34
34
  LK_VIDEO_PLAY_FAILED = 701,
35
35
  LK_GOT_REMOTE_STREAM = 710,
36
+ LK_VIDEO_PLAY_SUCCSS = 711,
36
37
  LK_NOTIFY_CLIENT_LOGOUT_PLAYER_LOGOUT = 800,
37
38
  LK_NOTIFY_CLIENT_LOGOUT_TASKOWNER_LOGOUT = 801,
38
39
  LK_APP_PROCESS_NOTIFI_APP_QUIT = 900,
package/types/larksr.d.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import { EventBase, LocalEvent } from './event/event_base';
6
6
  import Application, { APP_STATE } from './lark/application';
7
- import { AppliParams, AppliParamsUtils, IAppliParams, LoadAppliParamsFromUrl, LoadAppliParamsStartAppInfo } from './appli_params';
7
+ import { AppliParams, AppliParamsUtils, LoadAppliParamsFromUrl, LoadAppliParamsStartAppInfo } from './appli_params';
8
8
  import { LarkEventType } from './lark/lark_event_type';
9
9
  import API from './api';
10
10
  import ScreenState from './screen_state';
@@ -46,6 +46,14 @@ declare enum UserType {
46
46
  * LarkSR 实例会发出的事件
47
47
  */
48
48
  declare enum LarkSRClientEvent {
49
+ /**
50
+ * TASK 创建成功,返回 Task 相关信息
51
+ */
52
+ TASK_CREATE_SUCCESS = "taskcreatesuccess",
53
+ /**
54
+ * TASK 创建失败
55
+ */
56
+ TASK_CREATE_FAILED = "taskcreatefailed",
49
57
  /**
50
58
  * 连接渲染服务器成功 .
51
59
  */
@@ -192,6 +200,7 @@ interface ILarkSRConfig {
192
200
  authCode?: string;
193
201
  /**
194
202
  * 可选项,授权是否成功
203
+ * @deprecated 目前不会回调该参数。如果SDK验证失败将在 connect 返回失败
195
204
  */
196
205
  authCodeCallback?: (isSuccess: boolean, e: any) => void;
197
206
  /**
@@ -288,46 +297,6 @@ interface ILarkSRConfig {
288
297
  */
289
298
  publicPortMapping?: PublicPortMapping;
290
299
  }
291
- /**
292
- * 通过平行云托管平台创建客户端并启动应用
293
- * @param config 传入 config @see ILarkSRConfig
294
- * @param params 进入应用接口参数。appliId 为必填项
295
- * @returns Promise 创建 larksr client 是否成功
296
- */
297
- export declare function CreateLarkSRClientFromePXYHost(config: ILarkSRConfig, params: {
298
- appliId: string;
299
- playerMode?: number;
300
- userType?: number;
301
- roomCode?: string;
302
- taskId?: string;
303
- nickname?: string;
304
- }): Promise<LarkSR>;
305
- /**
306
- * 通过调用后台接口获取云端应用参数
307
- * @param config 传入 config @see ILarkSRConfig
308
- * @param params 进入应用接口参数。appliId 为必填项
309
- * @returns Promise 创建 larksr client 是否成功
310
- */
311
- export declare function CreateLarkSRClientFromeAPI(config: ILarkSRConfig, params: {
312
- appliId: string;
313
- playerMode?: number;
314
- userType?: number;
315
- roomCode?: string;
316
- taskId?: string;
317
- clientMac?: string;
318
- groupId?: string;
319
- regionId?: string;
320
- targetServerIp?: string;
321
- appKey?: string;
322
- timestamp?: string;
323
- signature?: string;
324
- }): Promise<LarkSR>;
325
- /**
326
- * 通过从url参数中获取云端应用相关参数
327
- * @param config 传入 config @see ILarkSRConfig
328
- * @returns Promise 创建 larksr client 是否成功
329
- */
330
- export declare function CreateLarkSRClientFromeUrl(config: ILarkSRConfig): Promise<LarkSR>;
331
300
  declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
332
301
  /**
333
302
  * 应用参数,构建时传入
@@ -434,7 +403,6 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
434
403
  get config(): ILarkSRConfig;
435
404
  private _config;
436
405
  private loadingTimeout;
437
- private sdkAuth;
438
406
  /**
439
407
  * 后台分配的用户id
440
408
  */
@@ -452,13 +420,11 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
452
420
  get initCursorMode(): boolean;
453
421
  /**
454
422
  * LarkSR 客户端。所有操作和事件通过该类传递
455
- * @see CreateLarkSRClientFromeAPI, @see CreateLarkSRClientFromeUrl @see CreateLarkSRClientFromePXYHost
456
- * @param config 本地配置,如果有 IAppliParams 相同的配置项,优先级最高
457
- * @param params [可选参数] 云端应用参数等,通过后台接口或者url参数获取。
423
+ * @param config 本地配置,优先级最高
458
424
  */
459
- constructor(config: ILarkSRConfig, params?: IAppliParams);
425
+ constructor(config: ILarkSRConfig);
460
426
  /**
461
- *
427
+ * 单独设置sdk授权码,目前总会返回成功 promise,具体验证失败将在 connectWithPxyHost 或 connect 返回
462
428
  * @param id sdk id 初始化sdkid
463
429
  * @returns
464
430
  */
@@ -497,13 +463,13 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
497
463
  * 手动重设进入应用参数
498
464
  * @param params
499
465
  */
500
- setAppliParams(params: IAppliParams): void;
466
+ private setAppliParams;
501
467
  /**
502
468
  * 开始云渲染流程
503
469
  * 启动时应用参数不能为空,包括 taskID,appServer,appPort
504
470
  * @returns 是否成功。主要校验授权码是否成功
505
471
  */
506
- start(): Promise<void>;
472
+ private start;
507
473
  /**
508
474
  * 重新开始云渲染流程
509
475
  */
@@ -3,13 +3,16 @@ import HandlerBase from './handler_base';
3
3
  export default class KeyboardHandler extends HandlerBase {
4
4
  private needSyncKeyState;
5
5
  private fistSyncKeyState;
6
+ private pressedKeys;
6
7
  constructor(op: Operation);
7
8
  startListening(): void;
8
9
  stopListening(): void;
10
+ private onLockPointChange;
9
11
  private keyboardListenerSetup;
10
12
  private onKeyDown;
11
13
  private onKeyUp;
12
14
  private onWindowBlur;
13
15
  private onWindowFocus;
14
16
  private onWindowVisibilityChange;
17
+ private releaseKeys;
15
18
  }
@@ -8,6 +8,7 @@ export default class MouseHandler extends HandlerBase {
8
8
  private isFocus;
9
9
  private rootElement;
10
10
  private subscribeUpdatePlayerListFromProtoAction;
11
+ private pressedMouseButtons;
11
12
  constructor(rootElement: HTMLElement, op: Operation);
12
13
  resetLocalRendreMousePosition(p: Point): void;
13
14
  setRootElement(rootElement: HTMLElement): void;
@@ -36,5 +37,6 @@ export default class MouseHandler extends HandlerBase {
36
37
  private onWindowBlur;
37
38
  private onWindowFocus;
38
39
  private onWindowVisibilityChange;
40
+ private releaseMouseButtons;
39
41
  private toastMsg;
40
42
  }
@@ -27,6 +27,10 @@ declare class Capabilities {
27
27
  static get isMobile(): boolean;
28
28
  static $isWeChat: boolean;
29
29
  static get isWeChat(): boolean;
30
+ static $isQQ: boolean;
31
+ static get isQQ(): boolean;
32
+ static $isHuawei: boolean;
33
+ static get isHuawei(): boolean;
30
34
  /**
31
35
  * @private
32
36
  */
@@ -3,7 +3,7 @@ export declare class Level {
3
3
  static WARN: string;
4
4
  static ERR: string;
5
5
  static TRACE: string;
6
- static getLevelIndex(level: string): 2 | 0 | 1 | 3 | 4;
6
+ static getLevelIndex(level: string): 0 | 2 | 1 | 3 | 4;
7
7
  }
8
8
  export interface LogObserver {
9
9
  onLog(msg: string): void;
@@ -1,11 +0,0 @@
1
- export declare class SDKAuth {
2
- get isSuccess(): boolean;
3
- private _isSuccess;
4
- get error(): any;
5
- private _error;
6
- constructor();
7
- auth(id: string): Promise<void>;
8
- signature(key: string, secret: string, timestamp: string): string;
9
- check(id: string): boolean;
10
- save(id: string, expire: string): void;
11
- }
@@ -1,11 +0,0 @@
1
- export declare class SDKAuth {
2
- get isSuccess(): boolean;
3
- private _isSuccess;
4
- get error(): any;
5
- private _error;
6
- constructor();
7
- auth(id: string): Promise<void>;
8
- signature(key: string, secret: string, timestamp: string): string;
9
- check(id: string): boolean;
10
- save(id: string, expire: string): void;
11
- }