larksr_websdk 3.2.7 → 3.2.11
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 +3 -0
- package/dist/larksr-web-sdk.min.js +3 -3
- package/dist/types/api.d.ts +26 -0
- package/dist/types/appli_params.d.ts +4 -0
- package/dist/types/index.d.ts +2 -1
- package/dist/types/larksr.d.ts +77 -8
- package/dist/types/screen_state.d.ts +5 -1
- package/package.json +1 -1
- package/types/api.d.ts +26 -0
- package/types/appli_params.d.ts +4 -0
- package/types/index.d.ts +2 -1
- package/types/lark/application.d.ts +18 -11
- package/types/lark/ice_candiadate_parser.d.ts +24 -0
- package/types/lark/peer_connection.d.ts +21 -18
- package/types/larksr.d.ts +77 -8
- package/types/operation/operation.d.ts +8 -1
- package/types/protobuf/cloudlark.d.ts +6466 -5944
- package/types/screen_state.d.ts +5 -1
- package/types/utils/log.d.ts +1 -1
- package/types/utils/unit.d.ts +1 -0
package/dist/types/api.d.ts
CHANGED
|
@@ -67,18 +67,44 @@ export interface StartAppInfo {
|
|
|
67
67
|
roomCode?: string;
|
|
68
68
|
nickName?: string;
|
|
69
69
|
nickname?: string;
|
|
70
|
+
appKey?: string;
|
|
71
|
+
groupId?: string;
|
|
70
72
|
}
|
|
71
73
|
export default class API {
|
|
72
74
|
static CheckUTLockInfoPath: string;
|
|
73
75
|
static GetTaskPATH: string;
|
|
74
76
|
static ClientLogErrorPath: string;
|
|
75
77
|
static GetStartInfoPath: string;
|
|
78
|
+
private static PocHostApplGetUrl;
|
|
79
|
+
static HostAppliGetUrl(params: {
|
|
80
|
+
appliId: string;
|
|
81
|
+
playerMode?: number;
|
|
82
|
+
userType?: number;
|
|
83
|
+
roomCode?: string;
|
|
84
|
+
taskId?: string;
|
|
85
|
+
}): Promise<{
|
|
86
|
+
host: string;
|
|
87
|
+
origin: string;
|
|
88
|
+
params: {
|
|
89
|
+
appliId: string;
|
|
90
|
+
appKey: string;
|
|
91
|
+
timestamp: string;
|
|
92
|
+
signature: string;
|
|
93
|
+
};
|
|
94
|
+
}>;
|
|
76
95
|
static GetStartInfo(serverAddress: string, params: {
|
|
77
96
|
appliId: string;
|
|
78
97
|
playerMode?: number;
|
|
79
98
|
userType?: number;
|
|
80
99
|
roomCode?: string;
|
|
81
100
|
taskId?: string;
|
|
101
|
+
clientMac?: string;
|
|
102
|
+
groupId?: string;
|
|
103
|
+
regionId?: string;
|
|
104
|
+
targetServerIp?: string;
|
|
105
|
+
appKey?: string;
|
|
106
|
+
timestamp?: string;
|
|
107
|
+
signature?: string;
|
|
82
108
|
}): Promise<StartAppInfo>;
|
|
83
109
|
static CheckUTLockInfo(config: ILarkSRConfig): Promise<UTLockInfo>;
|
|
84
110
|
static GetTask(config: ILarkSRConfig, taskid: string): Promise<GetTaskResult>;
|
|
@@ -188,6 +188,8 @@ export interface IAppliParams {
|
|
|
188
188
|
enableRttIcon: boolean;
|
|
189
189
|
enableSoundRequire: boolean;
|
|
190
190
|
toastLevel: number;
|
|
191
|
+
appKey: string;
|
|
192
|
+
groupId: string;
|
|
191
193
|
}
|
|
192
194
|
export declare enum AppliType {
|
|
193
195
|
DESKTOP = 1,
|
|
@@ -245,6 +247,8 @@ export declare class AppliParams implements IAppliParams {
|
|
|
245
247
|
enableRttIcon: boolean;
|
|
246
248
|
enableSoundRequire: boolean;
|
|
247
249
|
toastLevel: number;
|
|
250
|
+
appKey: string;
|
|
251
|
+
groupId: string;
|
|
248
252
|
static copyAndCreate(params?: IAppliParams): AppliParams;
|
|
249
253
|
static setUpWithSDKConfig(params: IAppliParams, config: ILarkSRConfig): AppliParams;
|
|
250
254
|
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
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, ILarkSRConfig, PlayerModeType, UserType, LarkSREvent } from "./larksr";
|
|
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";
|
|
3
3
|
declare const _default: {
|
|
4
4
|
LarkSR: typeof LarkSR;
|
|
5
|
+
CreateLarkSRClientFromePXYHost: typeof CreateLarkSRClientFromePXYHost;
|
|
5
6
|
CreateLarkSRClientFromeAPI: typeof CreateLarkSRClientFromeAPI;
|
|
6
7
|
CreateLarkSRClientFromeUrl: typeof CreateLarkSRClientFromeUrl;
|
|
7
8
|
API: typeof API;
|
package/dist/types/larksr.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ import FullScreen from './utils/full_screen';
|
|
|
15
15
|
import LockPointer from './utils/lock_pointer';
|
|
16
16
|
import ScaleMode from './utils/scale_mode';
|
|
17
17
|
import Capabilities from './utils/capabilities';
|
|
18
|
-
declare
|
|
18
|
+
declare enum PlayerModeType {
|
|
19
19
|
/**
|
|
20
20
|
* 普通模式
|
|
21
21
|
*/
|
|
@@ -32,7 +32,7 @@ declare const enum PlayerModeType {
|
|
|
32
32
|
/**
|
|
33
33
|
* 当前用户的身份
|
|
34
34
|
*/
|
|
35
|
-
declare
|
|
35
|
+
declare enum UserType {
|
|
36
36
|
/**
|
|
37
37
|
* 观看者
|
|
38
38
|
*/
|
|
@@ -69,7 +69,11 @@ declare enum LarkSRClientEvent {
|
|
|
69
69
|
/**
|
|
70
70
|
* 获取到远端视频流 .
|
|
71
71
|
*/
|
|
72
|
-
GOT_REMOTE_STREAM = "
|
|
72
|
+
GOT_REMOTE_STREAM = "gotremotestream",
|
|
73
|
+
/**
|
|
74
|
+
* 获取到远端音频流 .
|
|
75
|
+
*/
|
|
76
|
+
GOT_REMOTE_AUDIO_STREAM = "gotremoteaudiostream",
|
|
73
77
|
/**
|
|
74
78
|
* 视频加载成功,等待播放 .
|
|
75
79
|
*/
|
|
@@ -160,6 +164,9 @@ interface LarkSREvent extends LocalEvent<LarkSRClientEvent> {
|
|
|
160
164
|
code?: number;
|
|
161
165
|
larkevent?: LarkEventType;
|
|
162
166
|
}
|
|
167
|
+
declare type PublicPortMapping = {
|
|
168
|
+
[key: string]: string;
|
|
169
|
+
};
|
|
163
170
|
/**
|
|
164
171
|
* 构造 LarkSR 参数
|
|
165
172
|
*/
|
|
@@ -173,10 +180,12 @@ interface ILarkSRConfig {
|
|
|
173
180
|
*/
|
|
174
181
|
rootElement: HTMLElement;
|
|
175
182
|
/**
|
|
176
|
-
*
|
|
183
|
+
* 可选项 服务器地址. LarkServer 前台访问的地址
|
|
177
184
|
* 如: http://192.168.0.55:8181/
|
|
185
|
+
* 当使用托管服务时服务器地址自动分配,可留空。
|
|
186
|
+
* 使用托管服务时@see CreateLarkSRClientFromePXYHost @see larksr.connectWithPxyHost
|
|
178
187
|
*/
|
|
179
|
-
serverAddress
|
|
188
|
+
serverAddress?: string;
|
|
180
189
|
/**
|
|
181
190
|
* 可选项。 sdk 授权码。如果不在此处填,则必须在后续的实例里调用 initSDKAuthCode 初始化。
|
|
182
191
|
*/
|
|
@@ -265,7 +274,34 @@ interface ILarkSRConfig {
|
|
|
265
274
|
* 初始化鼠标模式, true 锁定,false 非锁定
|
|
266
275
|
*/
|
|
267
276
|
initCursorMode?: boolean;
|
|
277
|
+
/**
|
|
278
|
+
* 渲染服务器外网端口映射
|
|
279
|
+
* 格式为 key=[渲染服务器IP:PORT] value=[外网IP:PORT]
|
|
280
|
+
* {
|
|
281
|
+
* "RENDER-A-IP:RENDER-A-PORT1": "PUBLIC-A-IP:PORT1",
|
|
282
|
+
* "RENDER-B-IP:RENDER-B-PORT1": "PUBLIC-A-IP:PORT2",
|
|
283
|
+
* "RENDER-C-IP:RENDER-C-PORT1": "PUBLIC-A-IP:PORT3",
|
|
284
|
+
* "RENDER-D-IP:RENDER-D-PORT1": "PUBLIC-B-IP:PORT1",
|
|
285
|
+
* "RENDER-E-IP:RENDER-E-PORT1": "PUBLIC-B-IP:PORT2",
|
|
286
|
+
* "RENDER-E-IP:RENDER-E-PORT2": "PUBLIC-C-IP:PORT1",
|
|
287
|
+
* }
|
|
288
|
+
*/
|
|
289
|
+
publicPortMapping?: PublicPortMapping;
|
|
268
290
|
}
|
|
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>;
|
|
269
305
|
/**
|
|
270
306
|
* 通过调用后台接口获取云端应用参数
|
|
271
307
|
* @param config 传入 config @see ILarkSRConfig
|
|
@@ -278,7 +314,13 @@ export declare function CreateLarkSRClientFromeAPI(config: ILarkSRConfig, params
|
|
|
278
314
|
userType?: number;
|
|
279
315
|
roomCode?: string;
|
|
280
316
|
taskId?: string;
|
|
281
|
-
|
|
317
|
+
clientMac?: string;
|
|
318
|
+
groupId?: string;
|
|
319
|
+
regionId?: string;
|
|
320
|
+
targetServerIp?: string;
|
|
321
|
+
appKey?: string;
|
|
322
|
+
timestamp?: string;
|
|
323
|
+
signature?: string;
|
|
282
324
|
}): Promise<LarkSR>;
|
|
283
325
|
/**
|
|
284
326
|
* 通过从url参数中获取云端应用相关参数
|
|
@@ -352,6 +394,14 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
|
|
|
352
394
|
* 视频显示组件
|
|
353
395
|
*/
|
|
354
396
|
get videoComponent(): any;
|
|
397
|
+
/**
|
|
398
|
+
* 音频元素
|
|
399
|
+
*/
|
|
400
|
+
get audioElement(): HTMLAudioElement;
|
|
401
|
+
/**
|
|
402
|
+
* 是否有单独的音频流
|
|
403
|
+
*/
|
|
404
|
+
get isSeprateAudioTrack(): any;
|
|
355
405
|
/**
|
|
356
406
|
* 视频显示组件的父容器
|
|
357
407
|
*/
|
|
@@ -363,7 +413,6 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
|
|
|
363
413
|
get rootElement(): HTMLElement;
|
|
364
414
|
private _rootElement;
|
|
365
415
|
get serverAddress(): string;
|
|
366
|
-
private _serverAddress;
|
|
367
416
|
get serverIp(): string;
|
|
368
417
|
get config(): ILarkSRConfig;
|
|
369
418
|
private _config;
|
|
@@ -393,6 +442,13 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
|
|
|
393
442
|
* @returns
|
|
394
443
|
*/
|
|
395
444
|
initSDKAuthCode(id: string): Promise<void>;
|
|
445
|
+
connectWithPxyHost(params: {
|
|
446
|
+
appliId: string;
|
|
447
|
+
playerMode?: number;
|
|
448
|
+
userType?: number;
|
|
449
|
+
roomCode?: string;
|
|
450
|
+
taskId?: string;
|
|
451
|
+
}): Promise<void>;
|
|
396
452
|
/**
|
|
397
453
|
* 连接云端渲染资源
|
|
398
454
|
* @params appID 云端资源的 ID
|
|
@@ -404,8 +460,18 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
|
|
|
404
460
|
userType?: number;
|
|
405
461
|
roomCode?: string;
|
|
406
462
|
taskId?: string;
|
|
407
|
-
|
|
463
|
+
clientMac?: string;
|
|
464
|
+
groupId?: string;
|
|
465
|
+
regionId?: string;
|
|
466
|
+
targetServerIp?: string;
|
|
467
|
+
appKey?: string;
|
|
468
|
+
timestamp?: string;
|
|
469
|
+
signature?: string;
|
|
408
470
|
}): Promise<void>;
|
|
471
|
+
/**
|
|
472
|
+
* 用户手动填昵称,需要在 start 或 connect 设置才能生效。
|
|
473
|
+
*/
|
|
474
|
+
setNickname(nickname: string): void;
|
|
409
475
|
/**
|
|
410
476
|
* 手动重设进入应用参数
|
|
411
477
|
* @param params
|
|
@@ -465,6 +531,7 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
|
|
|
465
531
|
* 可以不使用该方法退出页面
|
|
466
532
|
*/
|
|
467
533
|
quit(): void;
|
|
534
|
+
resetAppMouseLockState(): void;
|
|
468
535
|
/**
|
|
469
536
|
* 操作相关事件
|
|
470
537
|
* 所有事件坐标相对于云端应用,不相对于网页
|
|
@@ -490,10 +557,12 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
|
|
|
490
557
|
$emitError(message?: string, code?: number): void;
|
|
491
558
|
$emitInfo(message?: string, code?: number): void;
|
|
492
559
|
private createEvent;
|
|
560
|
+
private setupListener;
|
|
493
561
|
private taskProcess;
|
|
494
562
|
private startProcess;
|
|
495
563
|
private onAppStateChange;
|
|
496
564
|
private onGotRemoteStream;
|
|
565
|
+
private onGotRemoteAudioStream;
|
|
497
566
|
private onCursorStyle;
|
|
498
567
|
private onAppResize;
|
|
499
568
|
private onAppMouseMode;
|
|
@@ -3,6 +3,7 @@ import { IAppliParams } from "./appli_params";
|
|
|
3
3
|
import { CloudLark } from "./protobuf/cloudlark";
|
|
4
4
|
import ScaleMode from "./utils/scale_mode";
|
|
5
5
|
import { LocalEvent, EventBase } from './event/event_base';
|
|
6
|
+
import { LarkSR } from "./larksr";
|
|
6
7
|
export interface ContainerSize {
|
|
7
8
|
marginTop: number;
|
|
8
9
|
marginLeft: number;
|
|
@@ -83,7 +84,9 @@ export default class ScreenState extends EventBase<SCREEN_EVENT_TYPE, ScreenEven
|
|
|
83
84
|
get isLockMouse(): boolean;
|
|
84
85
|
private _isLockMouse;
|
|
85
86
|
get cursorStyle(): SyncCursorStyle;
|
|
87
|
+
set cursorStyle(style: SyncCursorStyle);
|
|
86
88
|
private _cursorStyle;
|
|
89
|
+
private get cursorCSSStyle();
|
|
87
90
|
get appMouseMode(): CloudLark.IAppMouseMode;
|
|
88
91
|
set appMouseMode(mode: CloudLark.IAppMouseMode);
|
|
89
92
|
private _appMouseMode;
|
|
@@ -103,7 +106,8 @@ export default class ScreenState extends EventBase<SCREEN_EVENT_TYPE, ScreenEven
|
|
|
103
106
|
private mobileForceLandScape;
|
|
104
107
|
private bgColor;
|
|
105
108
|
private handelRootElementSize;
|
|
106
|
-
|
|
109
|
+
private larksr;
|
|
110
|
+
constructor(rootElement: HTMLElement, params: IAppliParams, larksr: LarkSR, handelRootElementSize?: boolean);
|
|
107
111
|
reset(params: IAppliParams): void;
|
|
108
112
|
resize(): void;
|
|
109
113
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "larksr_websdk",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.11",
|
|
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
|
@@ -67,18 +67,44 @@ export interface StartAppInfo {
|
|
|
67
67
|
roomCode?: string;
|
|
68
68
|
nickName?: string;
|
|
69
69
|
nickname?: string;
|
|
70
|
+
appKey?: string;
|
|
71
|
+
groupId?: string;
|
|
70
72
|
}
|
|
71
73
|
export default class API {
|
|
72
74
|
static CheckUTLockInfoPath: string;
|
|
73
75
|
static GetTaskPATH: string;
|
|
74
76
|
static ClientLogErrorPath: string;
|
|
75
77
|
static GetStartInfoPath: string;
|
|
78
|
+
private static PocHostApplGetUrl;
|
|
79
|
+
static HostAppliGetUrl(params: {
|
|
80
|
+
appliId: string;
|
|
81
|
+
playerMode?: number;
|
|
82
|
+
userType?: number;
|
|
83
|
+
roomCode?: string;
|
|
84
|
+
taskId?: string;
|
|
85
|
+
}): Promise<{
|
|
86
|
+
host: string;
|
|
87
|
+
origin: string;
|
|
88
|
+
params: {
|
|
89
|
+
appliId: string;
|
|
90
|
+
appKey: string;
|
|
91
|
+
timestamp: string;
|
|
92
|
+
signature: string;
|
|
93
|
+
};
|
|
94
|
+
}>;
|
|
76
95
|
static GetStartInfo(serverAddress: string, params: {
|
|
77
96
|
appliId: string;
|
|
78
97
|
playerMode?: number;
|
|
79
98
|
userType?: number;
|
|
80
99
|
roomCode?: string;
|
|
81
100
|
taskId?: string;
|
|
101
|
+
clientMac?: string;
|
|
102
|
+
groupId?: string;
|
|
103
|
+
regionId?: string;
|
|
104
|
+
targetServerIp?: string;
|
|
105
|
+
appKey?: string;
|
|
106
|
+
timestamp?: string;
|
|
107
|
+
signature?: string;
|
|
82
108
|
}): Promise<StartAppInfo>;
|
|
83
109
|
static CheckUTLockInfo(config: ILarkSRConfig): Promise<UTLockInfo>;
|
|
84
110
|
static GetTask(config: ILarkSRConfig, taskid: string): Promise<GetTaskResult>;
|
package/types/appli_params.d.ts
CHANGED
|
@@ -188,6 +188,8 @@ export interface IAppliParams {
|
|
|
188
188
|
enableRttIcon: boolean;
|
|
189
189
|
enableSoundRequire: boolean;
|
|
190
190
|
toastLevel: number;
|
|
191
|
+
appKey: string;
|
|
192
|
+
groupId: string;
|
|
191
193
|
}
|
|
192
194
|
export declare enum AppliType {
|
|
193
195
|
DESKTOP = 1,
|
|
@@ -245,6 +247,8 @@ export declare class AppliParams implements IAppliParams {
|
|
|
245
247
|
enableRttIcon: boolean;
|
|
246
248
|
enableSoundRequire: boolean;
|
|
247
249
|
toastLevel: number;
|
|
250
|
+
appKey: string;
|
|
251
|
+
groupId: string;
|
|
248
252
|
static copyAndCreate(params?: IAppliParams): AppliParams;
|
|
249
253
|
static setUpWithSDKConfig(params: IAppliParams, config: ILarkSRConfig): AppliParams;
|
|
250
254
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
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, ILarkSRConfig, PlayerModeType, UserType, LarkSREvent } from "./larksr";
|
|
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";
|
|
3
3
|
declare const _default: {
|
|
4
4
|
LarkSR: typeof LarkSR;
|
|
5
|
+
CreateLarkSRClientFromePXYHost: typeof CreateLarkSRClientFromePXYHost;
|
|
5
6
|
CreateLarkSRClientFromeAPI: typeof CreateLarkSRClientFromeAPI;
|
|
6
7
|
CreateLarkSRClientFromeUrl: typeof CreateLarkSRClientFromeUrl;
|
|
7
8
|
API: typeof API;
|
|
@@ -26,17 +26,18 @@ export declare enum APP_EVENT_TYPE {
|
|
|
26
26
|
INFO = 3,
|
|
27
27
|
APP_CLOSE = 4,
|
|
28
28
|
REMOTE_STREAM = 5,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
29
|
+
REMOTE_AUDIO_STREAM = 6,
|
|
30
|
+
SYNC_CURSORSTYLE = 7,
|
|
31
|
+
APP_STATE_CHANGE = 8,
|
|
32
|
+
NET_STATE = 9,
|
|
33
|
+
LK_APP_RESIZE = 10,
|
|
34
|
+
LK_APP_MOUSE_MODE = 11,
|
|
35
|
+
LK_APP_PLAER_LIST = 12,
|
|
36
|
+
LK_APP_REQUEST_TEXT = 13,
|
|
37
|
+
LK_DATA_CHANNEL_RENDERSERVER_TEXT_MESSAGE = 14,
|
|
38
|
+
LK_DATA_CHANNEL_RENDERSERVER_BINARY_MESSAGE = 15,
|
|
39
|
+
LK_DATA_CHANNEL_RENDERSERVER_OPEN = 16,
|
|
40
|
+
LK_DATA_CHANNEL_RENDERSERVER_CLOSE = 17
|
|
40
41
|
}
|
|
41
42
|
export interface AppEvent extends LocalEvent<APP_EVENT_TYPE> {
|
|
42
43
|
data?: any;
|
|
@@ -76,6 +77,8 @@ export default class Application extends EventBase<APP_EVENT_TYPE, AppEvent> {
|
|
|
76
77
|
setIce(sdpMlineindex: number, sdpmid: string, candidate: string): void;
|
|
77
78
|
sendInput(input: Msg.CloudLark.ClientInput): void;
|
|
78
79
|
sendInputBuffer(buffer: ArrayBuffer): void;
|
|
80
|
+
private sendToWebsocektChannelBuffer;
|
|
81
|
+
private sendToWebsocektChannelMsg;
|
|
79
82
|
private onChannelOpen;
|
|
80
83
|
private onClose;
|
|
81
84
|
private onChannelMsg;
|
|
@@ -91,11 +94,15 @@ export default class Application extends EventBase<APP_EVENT_TYPE, AppEvent> {
|
|
|
91
94
|
private onLocalSdp;
|
|
92
95
|
private onLoacalIce;
|
|
93
96
|
private onRemoteStream;
|
|
97
|
+
private onAudioRemoteStream;
|
|
94
98
|
private onRtcError;
|
|
95
99
|
private onIceStateChange;
|
|
96
100
|
retryPeerconnection(): void;
|
|
97
101
|
private onPeerConnectionDisconnect;
|
|
98
102
|
private onBadNetwork;
|
|
103
|
+
private onPixelStreamingPlayerList;
|
|
104
|
+
private onPixelStreamingDataChannelState;
|
|
105
|
+
private onPixelStreamingDataChannelData;
|
|
99
106
|
private onCursorStyle;
|
|
100
107
|
private onAppResize;
|
|
101
108
|
private onAppMouseMode;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export default class IceCandidateParser {
|
|
2
|
+
sdpMLineIndex: number | null;
|
|
3
|
+
sdpMid: string | null;
|
|
4
|
+
usernameFragment: string | null;
|
|
5
|
+
header: string;
|
|
6
|
+
private props;
|
|
7
|
+
constructor(ice: RTCIceCandidateInit);
|
|
8
|
+
get foundation(): string;
|
|
9
|
+
set foundation(f: string);
|
|
10
|
+
get component(): string;
|
|
11
|
+
set component(f: string);
|
|
12
|
+
get protocol(): string;
|
|
13
|
+
set protocol(p: string);
|
|
14
|
+
get priority(): string;
|
|
15
|
+
set priority(p: string);
|
|
16
|
+
get ip(): string;
|
|
17
|
+
set ip(ip: string);
|
|
18
|
+
get port(): string;
|
|
19
|
+
set port(port: string);
|
|
20
|
+
get type(): string;
|
|
21
|
+
get candidate(): string;
|
|
22
|
+
genNewIceCandidateInit(): RTCIceCandidateInit;
|
|
23
|
+
genNewIceCandidate(): RTCIceCandidate;
|
|
24
|
+
}
|
|
@@ -9,22 +9,23 @@ export declare enum IceState {
|
|
|
9
9
|
}
|
|
10
10
|
export declare enum WEBRTC_EVENT_TYPE {
|
|
11
11
|
GOT_REMOTE_STREAM = 0,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
12
|
+
GOT_REMOTE_AUDIO_STREAM = 1,
|
|
13
|
+
ICE_STATE_CHANGE = 2,
|
|
14
|
+
LK_APP_RESIZE = 3,
|
|
15
|
+
LK_APP_MOUSE_MODE = 4,
|
|
16
|
+
LK_APP_PLAER_LIST = 5,
|
|
17
|
+
LK_APP_REQUEST_TEXT = 6,
|
|
18
|
+
LK_DATA_CHANNEL_RENDERSERVER_TEXT_MESSAGE = 7,
|
|
19
|
+
LK_DATA_CHANNEL_RENDERSERVER_BINARY_MESSAGE = 8,
|
|
20
|
+
LK_DATA_CHANNEL_RENDERSERVER_OPEN = 9,
|
|
21
|
+
LK_DATA_CHANNEL_RENDERSERVER_CLOSE = 10,
|
|
22
|
+
LK_RTC_EVENT_PEERCONNECTION_STATE = 11,
|
|
23
|
+
NET_STATE = 12,
|
|
24
|
+
SYNC_CURSORSTYLE = 13,
|
|
25
|
+
BAD_NETWORK = 14,
|
|
26
|
+
ERROR = 15,
|
|
27
|
+
RTC_SDP = 16,
|
|
28
|
+
RTC_ICECANDIDATE = 17
|
|
28
29
|
}
|
|
29
30
|
export interface GoogleBitRate {
|
|
30
31
|
start: number;
|
|
@@ -84,12 +85,14 @@ export default class PeerConnection extends EventBase<WEBRTC_EVENT_TYPE, WebRTCE
|
|
|
84
85
|
private lastPacktetsLost;
|
|
85
86
|
private lastPacktetsReceived;
|
|
86
87
|
private larksr;
|
|
88
|
+
private audioStream;
|
|
89
|
+
private videoStream;
|
|
87
90
|
constructor(larksr: LarkSR, config: WebRTCConfig);
|
|
88
91
|
create(): void;
|
|
89
92
|
createOffer(): void;
|
|
90
93
|
close(): void;
|
|
91
94
|
onRemoteDescription(des: RTCSessionDescriptionInit): void;
|
|
92
|
-
onReceiveCandidate(candateInit: RTCIceCandidateInit
|
|
95
|
+
onReceiveCandidate(candateInit: RTCIceCandidateInit): void;
|
|
93
96
|
startNetTest(): void;
|
|
94
97
|
stopNetTest(): void;
|
|
95
98
|
sendInput(input: Input.CloudLark.ClientInput): void;
|
|
@@ -105,7 +108,7 @@ export default class PeerConnection extends EventBase<WEBRTC_EVENT_TYPE, WebRTCE
|
|
|
105
108
|
private onCreateOfferSuccess;
|
|
106
109
|
private onIceCandidate;
|
|
107
110
|
private onIceStateChange;
|
|
108
|
-
private
|
|
111
|
+
private ontrack;
|
|
109
112
|
private addIceCandidate;
|
|
110
113
|
private iceStateChange;
|
|
111
114
|
private $emit;
|