larksr_websdk 3.2.320 → 3.2.323
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/dist/larksr-web-sdk.min.js +1 -1
- package/package.json +2 -1
- package/types/api.d.ts +2 -0
- package/types/index.d.ts +2 -1
- package/types/lark/application.d.ts +2 -1
- package/types/lark/peer_connection.d.ts +3 -2
- package/types/larksr.d.ts +47 -3
- package/types/operation/gesture.d.ts +3 -1
- package/types/operation/gesture_handler.d.ts +37 -0
- package/types/operation/keyboard_handler.d.ts +3 -0
- package/types/operation/operation.d.ts +30 -5
- package/types/utils/capabilities.d.ts +2 -0
- package/types/utils/ios-inner-height.d.ts +4 -0
- package/types/utils/unit.d.ts +0 -5
- package/dist/doc/config.md +0 -145
- package/dist/doc/events.md +0 -139
- package/dist/doc/functions.md +0 -406
- package/dist/doc/index.md +0 -82
- package/dist/doc/member_variables.md +0 -162
- package/dist/doc/sdkid_encryption.md +0 -40
- package/dist/doc/update.md +0 -162
- package/dist/types/api.d.ts +0 -124
- package/dist/types/appli_params.d.ts +0 -289
- package/dist/types/common/cmd.d.ts +0 -28
- package/dist/types/common/constant.d.ts +0 -4
- package/dist/types/common/interface.d.ts +0 -30
- package/dist/types/config.d.ts +0 -59
- package/dist/types/event/event_base.d.ts +0 -11
- package/dist/types/event/iframe_poster.d.ts +0 -9
- package/dist/types/index.d.ts +0 -22
- package/dist/types/lark/Worker.d.ts +0 -0
- package/dist/types/lark/application.d.ts +0 -178
- package/dist/types/lark/custom.d.ts +0 -7
- package/dist/types/lark/ice_candiadate_parser.d.ts +0 -24
- package/dist/types/lark/lark_event_type.d.ts +0 -113
- package/dist/types/lark/message.d.ts +0 -20
- package/dist/types/lark/peer_connection.d.ts +0 -173
- package/dist/types/lark/recoder.d.ts +0 -55
- package/dist/types/lark/sdp_util.d.ts +0 -36
- package/dist/types/lark/test_pixel_streaming.d.ts +0 -54
- package/dist/types/lark/websocket_channel.d.ts +0 -56
- package/dist/types/lark/websocket_proxy.d.ts +0 -56
- package/dist/types/larksr.d.ts +0 -890
- package/dist/types/localization/base.d.ts +0 -8
- package/dist/types/localization/gesture_ins.d.ts +0 -4
- package/dist/types/localization/language.d.ts +0 -6
- package/dist/types/localization/loader.d.ts +0 -14
- package/dist/types/localization/message.d.ts +0 -81
- package/dist/types/localization/ui.d.ts +0 -58
- package/dist/types/operation/gamepad_handler.d.ts +0 -67
- package/dist/types/operation/gesture.d.ts +0 -70
- package/dist/types/operation/gesture_handler.d.ts +0 -16
- package/dist/types/operation/handler_base.d.ts +0 -8
- package/dist/types/operation/keyboard_handler.d.ts +0 -18
- package/dist/types/operation/keymap.d.ts +0 -24
- package/dist/types/operation/letter_keymap.d.ts +0 -8
- package/dist/types/operation/mouse_handler.d.ts +0 -42
- package/dist/types/operation/num_keymap.d.ts +0 -12
- package/dist/types/operation/operation.d.ts +0 -72
- package/dist/types/operation/pixel_streaming_input.d.ts +0 -82
- package/dist/types/operation/touch_handler.d.ts +0 -11
- package/dist/types/operation/utils.d.ts +0 -18
- package/dist/types/protobuf/cloudlark.d.ts +0 -7384
- package/dist/types/screen_state.d.ts +0 -116
- package/dist/types/utils/browser_type.d.ts +0 -37
- package/dist/types/utils/capabilities.d.ts +0 -52
- package/dist/types/utils/full_screen.d.ts +0 -25
- package/dist/types/utils/lock_pointer.d.ts +0 -23
- package/dist/types/utils/log.d.ts +0 -25
- package/dist/types/utils/scale_mode.d.ts +0 -26
- package/dist/types/utils/unit.d.ts +0 -147
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "larksr_websdk",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.323",
|
|
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",
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
"bowser": "^2.11.0",
|
|
33
33
|
"core-js": "^3.18.1",
|
|
34
34
|
"crypto-js": "^4.1.1",
|
|
35
|
+
"ios-inner-height": "^1.1.1",
|
|
35
36
|
"protobufjs": "^6.11.2",
|
|
36
37
|
"webrtc-adapter": "^8.1.0",
|
|
37
38
|
"weixin-js-sdk": "^1.6.0"
|
package/types/api.d.ts
CHANGED
|
@@ -83,6 +83,7 @@ export default class API {
|
|
|
83
83
|
private static PocHostApplGetUrl;
|
|
84
84
|
private static TaskInfoClientStartedPath;
|
|
85
85
|
private static PortMappingListPath;
|
|
86
|
+
private static GetTouchCtrMappingPath;
|
|
86
87
|
static HostAppliGetUrl(params: {
|
|
87
88
|
appliId: string;
|
|
88
89
|
playerMode?: number;
|
|
@@ -120,5 +121,6 @@ export default class API {
|
|
|
120
121
|
static ClientInfo(config: ILarkSRConfig, params: AppliParams): void;
|
|
121
122
|
static TaskInfoClientStarted(config: ILarkSRConfig, params: AppliParams): void;
|
|
122
123
|
static PortMappingList(config: ILarkSRConfig): Promise<unknown>;
|
|
124
|
+
static GetTouchCtrMapping(server: string, appliId?: string): Promise<unknown>;
|
|
123
125
|
static joinParam(params: any): string;
|
|
124
126
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import 'core-js/stable/symbol';
|
|
2
|
-
import { LarkSR, 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, GESTURE_TYPE } from "./larksr";
|
|
3
3
|
declare const _default: {
|
|
4
4
|
LarkSR: typeof LarkSR;
|
|
5
5
|
API: typeof API;
|
|
@@ -16,6 +16,7 @@ declare const _default: {
|
|
|
16
16
|
Operation: typeof Operation;
|
|
17
17
|
LarkSRClientEvent: typeof LarkSRClientEvent;
|
|
18
18
|
LarkEventType: typeof LarkEventType;
|
|
19
|
+
GESTURE_TYPE: typeof GESTURE_TYPE;
|
|
19
20
|
KEYMAP: import("./operation/keymap").VritualKeyMapOptions;
|
|
20
21
|
};
|
|
21
22
|
export default _default;
|
|
@@ -89,7 +89,7 @@ export default class Application extends EventBase<APP_EVENT_TYPE, AppEvent> {
|
|
|
89
89
|
startMonitorSteam(): void;
|
|
90
90
|
restart(): void;
|
|
91
91
|
restartApp(): void;
|
|
92
|
-
rtcOffer(): void
|
|
92
|
+
rtcOffer(): Promise<void>;
|
|
93
93
|
setAnswer(sdp: string): void;
|
|
94
94
|
setIce(sdpMlineindex: number, sdpmid: string, candidate: string): void;
|
|
95
95
|
sendInput(input: Msg.CloudLark.ClientInput): void;
|
|
@@ -113,6 +113,7 @@ export default class Application extends EventBase<APP_EVENT_TYPE, AppEvent> {
|
|
|
113
113
|
private onRemoteStream;
|
|
114
114
|
private onAudioRemoteStream;
|
|
115
115
|
private onRtcError;
|
|
116
|
+
private onRtcInfo;
|
|
116
117
|
private onIceStateChange;
|
|
117
118
|
retryPeerconnection(): void;
|
|
118
119
|
setAudioEnable(enable: boolean): void | undefined;
|
|
@@ -29,7 +29,8 @@ export declare enum WEBRTC_EVENT_TYPE {
|
|
|
29
29
|
AI_VOICE_STATUS = 18,
|
|
30
30
|
AI_VOICE_ASR_RESULT = 19,
|
|
31
31
|
AI_VOICE_DM_RESULT = 20,
|
|
32
|
-
AI_VOICE_ERROR = 21
|
|
32
|
+
AI_VOICE_ERROR = 21,
|
|
33
|
+
INFO = 22
|
|
33
34
|
}
|
|
34
35
|
export interface GoogleBitRate {
|
|
35
36
|
start: number;
|
|
@@ -105,7 +106,7 @@ export default class PeerConnection extends EventBase<WEBRTC_EVENT_TYPE, WebRTCE
|
|
|
105
106
|
private localShareTrackBinding;
|
|
106
107
|
private sdpCreateSuccess;
|
|
107
108
|
constructor(larksr: LarkSR, config: WebRTCConfig);
|
|
108
|
-
create(): void
|
|
109
|
+
create(streams?: MediaStream | undefined | null): Promise<void>;
|
|
109
110
|
createOffer(): void;
|
|
110
111
|
close(): void;
|
|
111
112
|
setAudioEnable(enable: boolean): void;
|
package/types/larksr.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ import LockPointer from './utils/lock_pointer';
|
|
|
16
16
|
import ScaleMode from './utils/scale_mode';
|
|
17
17
|
import Capabilities from './utils/capabilities';
|
|
18
18
|
import Recorder from './lark/recoder';
|
|
19
|
+
import { GESTURE_TYPE } from './operation/gesture';
|
|
19
20
|
declare enum PlayerModeType {
|
|
20
21
|
/**
|
|
21
22
|
* 普通模式
|
|
@@ -179,7 +180,12 @@ declare enum LarkSRClientEvent {
|
|
|
179
180
|
/**
|
|
180
181
|
* 对话出错详细信息
|
|
181
182
|
*/
|
|
182
|
-
AI_VOICE_ERROR = "aivoiceerror"
|
|
183
|
+
AI_VOICE_ERROR = "aivoiceerror",
|
|
184
|
+
/**
|
|
185
|
+
* 服务端 3.2.7.0 添加
|
|
186
|
+
*
|
|
187
|
+
*/
|
|
188
|
+
TOUCH_CTR_MAPPING = "touchctrmapping"
|
|
183
189
|
}
|
|
184
190
|
/**
|
|
185
191
|
* LarkSR 发出的事件
|
|
@@ -333,6 +339,19 @@ interface ILarkSRConfig {
|
|
|
333
339
|
* 需要注意默认打开的是系统中默认的视频设备。
|
|
334
340
|
*/
|
|
335
341
|
videoInputAutoStart?: boolean;
|
|
342
|
+
/**
|
|
343
|
+
* mouseZoomDirection
|
|
344
|
+
* 用于移动端捏合缩放操作与应用鼠标缩放的对应关系
|
|
345
|
+
* 1:鼠标滚轮向上为放大,
|
|
346
|
+
* 0:鼠标滚轮向下为放大(default)
|
|
347
|
+
*/
|
|
348
|
+
mouseZoomDirection?: number;
|
|
349
|
+
/**
|
|
350
|
+
* 触摸指令模式,对应后台应用管理->应用编辑->移动端高级设置->触摸指令模式 优先级高于后台配置
|
|
351
|
+
* 触摸指令,移动端的触摸指令对应为云端的触屏还是鼠标
|
|
352
|
+
* 'touchScreen' | 'mouse'
|
|
353
|
+
*/
|
|
354
|
+
touchOperateMode?: 'touchScreen' | 'mouse';
|
|
336
355
|
}
|
|
337
356
|
declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
|
|
338
357
|
/**
|
|
@@ -429,6 +448,21 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
|
|
|
429
448
|
* 是否显示移动端触摸点
|
|
430
449
|
*/
|
|
431
450
|
set isEnableTouchPonit(enable: boolean);
|
|
451
|
+
set isEnableTouchPoint(enable: boolean);
|
|
452
|
+
/**
|
|
453
|
+
* 虚拟鼠标的当前位置,相对于整体容器
|
|
454
|
+
*/
|
|
455
|
+
get virtualCursorPosition(): {
|
|
456
|
+
x: any;
|
|
457
|
+
y: any;
|
|
458
|
+
};
|
|
459
|
+
/**
|
|
460
|
+
* 虚拟鼠标的当前位置,内部缩放容器,与实际显示虚拟鼠标 CSS 样式相同
|
|
461
|
+
*/
|
|
462
|
+
get virtualCursorPositionRaw(): {
|
|
463
|
+
x: any;
|
|
464
|
+
y: any;
|
|
465
|
+
};
|
|
432
466
|
/**
|
|
433
467
|
* 是否显示载入画面时底部文字
|
|
434
468
|
*/
|
|
@@ -542,6 +576,10 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
|
|
|
542
576
|
* 主动关闭连接
|
|
543
577
|
*/
|
|
544
578
|
close(): void;
|
|
579
|
+
/**
|
|
580
|
+
* 从DOM种删除渲染组件,注意删除渲染组件之后将无法再次进入应用,所有状态将失效,不可恢复,只能重新new LarkSR
|
|
581
|
+
*/
|
|
582
|
+
destroy(): void;
|
|
545
583
|
/**
|
|
546
584
|
* 设置是否强制横屏显示内容.
|
|
547
585
|
* handelRootElementSize 必须设置为 true 才有作用。
|
|
@@ -607,8 +645,13 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
|
|
|
607
645
|
resetAppMouseLockState(): void;
|
|
608
646
|
/**
|
|
609
647
|
* 采集一帧图像
|
|
648
|
+
* @params data: any 抛出采集事件时抛出的附加data,比如采集的时间戳
|
|
649
|
+
* @return { data: any, base64: base64string } 返回传入的 data 和采集的 base64 字符串
|
|
610
650
|
*/
|
|
611
|
-
captrueFrame(data: any):
|
|
651
|
+
captrueFrame(data: any): {
|
|
652
|
+
data: any;
|
|
653
|
+
base64: any;
|
|
654
|
+
};
|
|
612
655
|
/**
|
|
613
656
|
* 操作相关事件
|
|
614
657
|
* 所有事件坐标相对于云端应用,不相对于网页
|
|
@@ -865,6 +908,7 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
|
|
|
865
908
|
addMediaTrack(track: MediaStreamTrack, ...streams: MediaStream[]): boolean | undefined;
|
|
866
909
|
removeMediaTrack(track: RTCRtpSender): boolean | undefined;
|
|
867
910
|
requestUserMediaPermission(constraints?: MediaStreamConstraints): Promise<MediaStream> | undefined;
|
|
911
|
+
getTouchCtrMapping(appliId?: string): Promise<unknown>;
|
|
868
912
|
$emit(type: LarkEventType, data?: any, message?: string): void;
|
|
869
913
|
$emitError(message?: string, code?: number): void;
|
|
870
914
|
$emitInfo(message?: string, code?: number): void;
|
|
@@ -887,4 +931,4 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
|
|
|
887
931
|
private onOperationTimeout;
|
|
888
932
|
private onOperationInput;
|
|
889
933
|
}
|
|
890
|
-
export { LarkSR, ILarkSRConfig, PlayerModeType, UserType, LarkSREvent, LarkEventType, LarkSRClientEvent, AppliParams, AppliParamsUtils, LoadAppliParamsFromUrl, LoadAppliParamsStartAppInfo, EventBase, API, Operation, Capabilities, ScaleMode, VirtualKey, KEYMAP, CloudLark, FullScreen, LockPointer, Recorder, };
|
|
934
|
+
export { LarkSR, ILarkSRConfig, PlayerModeType, UserType, LarkSREvent, LarkEventType, LarkSRClientEvent, AppliParams, AppliParamsUtils, LoadAppliParamsFromUrl, LoadAppliParamsStartAppInfo, EventBase, API, Operation, Capabilities, ScaleMode, VirtualKey, KEYMAP, CloudLark, FullScreen, LockPointer, Recorder, GESTURE_TYPE, };
|
|
@@ -9,7 +9,7 @@ export interface GestureEvent extends LocalEvent<GESTRUE_EVENT_TYPE> {
|
|
|
9
9
|
motion: Vector;
|
|
10
10
|
distance: number;
|
|
11
11
|
}
|
|
12
|
-
export declare
|
|
12
|
+
export declare enum GESTURE_TYPE {
|
|
13
13
|
SINGLE_FINGER_TOUCH_START = 1,
|
|
14
14
|
SINGLE_FINGER_TAP = 2,
|
|
15
15
|
SINGLE_FINGER_TAP_DOWN = 3,
|
|
@@ -43,6 +43,8 @@ export default class Gesture extends EventBase<GESTRUE_EVENT_TYPE, GestureEvent>
|
|
|
43
43
|
private touchStartPoints;
|
|
44
44
|
private touchChangedPoins;
|
|
45
45
|
private tapStart;
|
|
46
|
+
setTapLimitRadius(radius: number): void;
|
|
47
|
+
setTapLimitTimeout(timeout: number): void;
|
|
46
48
|
private tapLimit;
|
|
47
49
|
private lastTap;
|
|
48
50
|
private tapPressTimeout;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import Operation from './operation';
|
|
2
|
+
import { GESTURE_TYPE } from './gesture';
|
|
2
3
|
import HandlerBase from './handler_base';
|
|
3
4
|
export default class GestureHandler extends HandlerBase {
|
|
4
5
|
private gesture;
|
|
@@ -7,6 +8,42 @@ export default class GestureHandler extends HandlerBase {
|
|
|
7
8
|
set mouseZoomDirection(direction: number);
|
|
8
9
|
get mouseZoomDirection(): number;
|
|
9
10
|
private _mouseZoomDirection;
|
|
11
|
+
/**
|
|
12
|
+
*
|
|
13
|
+
*/
|
|
14
|
+
set tapLimitRadius(radius: number);
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
*/
|
|
18
|
+
set tapLimitTimeout(timeout: number);
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
*/
|
|
22
|
+
set relativeMouseMoveSpeed(speed: number);
|
|
23
|
+
get relativeMouseMoveSpeed(): number;
|
|
24
|
+
private _relativeMouseMoveSpeed;
|
|
25
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
*/
|
|
28
|
+
set gestureCallback(callback: null | ((event: {
|
|
29
|
+
type: GESTURE_TYPE;
|
|
30
|
+
x: number;
|
|
31
|
+
y: number;
|
|
32
|
+
rx: number;
|
|
33
|
+
ry: number;
|
|
34
|
+
edge: boolean;
|
|
35
|
+
rawEvent: any;
|
|
36
|
+
}) => void));
|
|
37
|
+
get gestureCallback(): null | ((event: {
|
|
38
|
+
type: GESTURE_TYPE;
|
|
39
|
+
x: number;
|
|
40
|
+
y: number;
|
|
41
|
+
rx: number;
|
|
42
|
+
ry: number;
|
|
43
|
+
edge: boolean;
|
|
44
|
+
rawEvent: any;
|
|
45
|
+
}) => void);
|
|
46
|
+
private _gestureCallback;
|
|
10
47
|
constructor(rootElement: HTMLElement, op: Operation);
|
|
11
48
|
startListening(): void;
|
|
12
49
|
stopListening(): void;
|
|
@@ -4,6 +4,9 @@ export default class KeyboardHandler extends HandlerBase {
|
|
|
4
4
|
private needSyncKeyState;
|
|
5
5
|
private fistSyncKeyState;
|
|
6
6
|
private pressedKeys;
|
|
7
|
+
set preventKeys(keys: string[]);
|
|
8
|
+
get preventKeys(): string[];
|
|
9
|
+
private _preventKeys;
|
|
7
10
|
constructor(op: Operation);
|
|
8
11
|
startListening(): void;
|
|
9
12
|
stopListening(): void;
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { CloudLark } from '../protobuf/cloudlark';
|
|
2
2
|
import { LocalEvent, EventBase } from '../event/event_base';
|
|
3
3
|
import { Point } from '../common/interface';
|
|
4
|
+
import GestureHandler from './gesture_handler';
|
|
5
|
+
import KeyboardHandler from './keyboard_handler';
|
|
6
|
+
import MouseHandler from './mouse_handler';
|
|
7
|
+
import GamepadHandler from './gamepad_handler';
|
|
8
|
+
import TouchHandler from './touch_handler';
|
|
4
9
|
import { LarkSR } from '../larksr';
|
|
5
10
|
export declare const enum OPREATION_EVENT_TYPE {
|
|
6
11
|
Input = 0,
|
|
@@ -14,11 +19,31 @@ export interface OperationEvent extends LocalEvent<OPREATION_EVENT_TYPE> {
|
|
|
14
19
|
cursorPoint?: Point;
|
|
15
20
|
}
|
|
16
21
|
export default class Operation extends EventBase<OPREATION_EVENT_TYPE, OperationEvent> {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
private
|
|
22
|
+
/**
|
|
23
|
+
* 移动端手势处理
|
|
24
|
+
*/
|
|
25
|
+
get gestureHandler(): GestureHandler;
|
|
26
|
+
private _gestureHandler;
|
|
27
|
+
/**
|
|
28
|
+
* 键盘处理
|
|
29
|
+
*/
|
|
30
|
+
get keyboardHandler(): KeyboardHandler;
|
|
31
|
+
private _keyboardHandler;
|
|
32
|
+
/**
|
|
33
|
+
* 鼠标处理
|
|
34
|
+
*/
|
|
35
|
+
get mouseHandler(): MouseHandler;
|
|
36
|
+
private _mouseHandler;
|
|
37
|
+
/**
|
|
38
|
+
* 游戏手柄处理
|
|
39
|
+
*/
|
|
40
|
+
get gamepadHandler(): GamepadHandler;
|
|
41
|
+
private _gamepadHandler;
|
|
42
|
+
/**
|
|
43
|
+
* 触摸屏输入处理
|
|
44
|
+
*/
|
|
45
|
+
get touchHandler(): TouchHandler;
|
|
46
|
+
private _touchHandler;
|
|
22
47
|
private _startListen;
|
|
23
48
|
set enableParse(enable: boolean);
|
|
24
49
|
get enableParse(): boolean;
|
package/types/utils/unit.d.ts
CHANGED
|
@@ -14,11 +14,6 @@ export default class Unit {
|
|
|
14
14
|
/**
|
|
15
15
|
* 浏览器窗口大小相关
|
|
16
16
|
*/
|
|
17
|
-
/**
|
|
18
|
-
* 获取浏览器窗口大小
|
|
19
|
-
* @returns { width: 窗口宽, height: 窗口高 }
|
|
20
|
-
*/
|
|
21
|
-
static viewport(): ViewPort;
|
|
22
17
|
static getElementViewport(element: HTMLElement, baseElementScale?: number): ViewPort;
|
|
23
18
|
/**
|
|
24
19
|
* 获取某元素距离文档的距离
|
package/dist/doc/config.md
DELETED
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
# LarkSR 对象参数
|
|
2
|
-
|
|
3
|
-
创建 LarkSR 对象参数如下
|
|
4
|
-
|
|
5
|
-
```typescript
|
|
6
|
-
/**
|
|
7
|
-
* 构造 LarkSR 参数
|
|
8
|
-
*/
|
|
9
|
-
interface ILarkSRConfig {
|
|
10
|
-
/**
|
|
11
|
-
* 必选项 根元素。组件会挂载到跟元素下面
|
|
12
|
-
* 注意*不要*设置为 document.documentElement
|
|
13
|
-
* 默认模式下会通过旋转根元素实现强制横屏模式。
|
|
14
|
-
* @see handelRootElementSize
|
|
15
|
-
* @see scaleMode
|
|
16
|
-
*/
|
|
17
|
-
rootElement: HTMLElement;
|
|
18
|
-
/**
|
|
19
|
-
* 必选项 服务器地址. LarkServer 前台访问的地址
|
|
20
|
-
* 如: http://192.168.0.55:8181/
|
|
21
|
-
*/
|
|
22
|
-
serverAddress: string;
|
|
23
|
-
/**
|
|
24
|
-
* 可选项。 sdk 授权码。如果不在此处填,则必须在后续的实例里调用 initSDKAuthCode 初始化。
|
|
25
|
-
*/
|
|
26
|
-
authCode?: string;
|
|
27
|
-
/**
|
|
28
|
-
* 可选项,授权是否成功
|
|
29
|
-
* @deprecated 目前不会回调该参数。如果SDK验证失败将在 connect 返回失败
|
|
30
|
-
*/
|
|
31
|
-
authCodeCallback?: (isSuccess: boolean, e: any) => void;
|
|
32
|
-
/**
|
|
33
|
-
* 可选项,载入时的背景图片 url
|
|
34
|
-
*/
|
|
35
|
-
loadingBgUrl?: string;
|
|
36
|
-
/**
|
|
37
|
-
* 可选项,是否同步传入根的组件的大小样式。
|
|
38
|
-
* 默认开启,将跟组件大小设置为浏览器视口大小
|
|
39
|
-
* 如果关闭,内部组件将按照传入的根元素大小去显示
|
|
40
|
-
* 注意,当关闭时不会自动填充根元素,如果根元素高度为 0 将显示不出来。
|
|
41
|
-
* 注意,当关闭时 mobileForceLandscape 将失去作用。
|
|
42
|
-
*/
|
|
43
|
-
handelRootElementSize?: boolean;
|
|
44
|
-
/**
|
|
45
|
-
* 是否在sdk内部监听鼠标键盘等输入事件
|
|
46
|
-
* 如果关闭需要手动发送输入事件
|
|
47
|
-
* 注意关闭时全屏模式和锁定模式将失效,需要在sdk外部触发
|
|
48
|
-
* @see fullScreenMode
|
|
49
|
-
*/
|
|
50
|
-
handlInput?: boolean;
|
|
51
|
-
/**
|
|
52
|
-
* 当视频播自动放失败时是否尝试静音播放,静音播放时将抛出事件
|
|
53
|
-
* 静音播放当用户操作屏幕时将尝试播放声音
|
|
54
|
-
*/
|
|
55
|
-
mutePlayWhenFiled?: boolean;
|
|
56
|
-
/**
|
|
57
|
-
* 可选项,是否是 vr 监控类型。
|
|
58
|
-
*/
|
|
59
|
-
isMonitor?: boolean;
|
|
60
|
-
/**
|
|
61
|
-
* 可选项,码率
|
|
62
|
-
*/
|
|
63
|
-
codeRate?: number;
|
|
64
|
-
/**
|
|
65
|
-
* 可选项,帧率
|
|
66
|
-
*/
|
|
67
|
-
frameRate?: number;
|
|
68
|
-
/**
|
|
69
|
-
* 可选项,音频帧率
|
|
70
|
-
*/
|
|
71
|
-
audioCodeRate?: number;
|
|
72
|
-
/**
|
|
73
|
-
* 可选项,日志级别。默认为 warn
|
|
74
|
-
*/
|
|
75
|
-
logLevel?: 'info' | 'warn' | 'error';
|
|
76
|
-
/**
|
|
77
|
-
* 可选项,载入超时时间. 默认为 60s。超过该事件停止载入
|
|
78
|
-
*/
|
|
79
|
-
loadingTimeout?: number;
|
|
80
|
-
/**
|
|
81
|
-
* 可选项,是否自动同步剪贴板数据
|
|
82
|
-
*/
|
|
83
|
-
syncLocalToCloudClipboard?: boolean;
|
|
84
|
-
/**
|
|
85
|
-
* 可选项,优选选择的视频编码格式
|
|
86
|
-
*/
|
|
87
|
-
perferDecoder?: 'auto' | 'vp8' | 'vp9' | 'h264' | 'av1x';
|
|
88
|
-
/**
|
|
89
|
-
* 可选项,视频在容器中的缩放模式
|
|
90
|
-
* 'contain' | 'fill_clip' | 'fill_stretch'
|
|
91
|
-
* contain: 以应用原始尺寸的缩放
|
|
92
|
-
* fill_clip: 裁剪模式,完全填充屏幕但保留宽高比
|
|
93
|
-
* fill_stretch: 拉伸模式,完全填充屏幕但不保留宽高比
|
|
94
|
-
*/
|
|
95
|
-
scaleMode?: ScaleMode;
|
|
96
|
-
/**
|
|
97
|
-
* 全屏模式
|
|
98
|
-
* 0 -》 用户手动触发
|
|
99
|
-
* 1 -》 首次点击进入触发
|
|
100
|
-
* 2 -》 每次点击触发
|
|
101
|
-
*/
|
|
102
|
-
fullScreenMode?: number;
|
|
103
|
-
/**
|
|
104
|
-
* 可选项,手机端的全屏模式,值同 fullScreenMode
|
|
105
|
-
*/
|
|
106
|
-
mobileFullScreenMode?: number;
|
|
107
|
-
/**
|
|
108
|
-
* 可选项,手机端是否强制横屏
|
|
109
|
-
*/
|
|
110
|
-
mobileForceLandscape?: boolean;
|
|
111
|
-
/**
|
|
112
|
-
* 渲染服务器外网端口映射
|
|
113
|
-
* 格式为 key=[渲染服务器IP:PORT] value=[外网IP:PORT]
|
|
114
|
-
* {
|
|
115
|
-
* "RENDER-A-IP:RENDER-A-PORT1": "PUBLIC-A-IP:PORT1",
|
|
116
|
-
* "RENDER-B-IP:RENDER-B-PORT1": "PUBLIC-A-IP:PORT2",
|
|
117
|
-
* "RENDER-C-IP:RENDER-C-PORT1": "PUBLIC-A-IP:PORT3",
|
|
118
|
-
* "RENDER-D-IP:RENDER-D-PORT1": "PUBLIC-B-IP:PORT1",
|
|
119
|
-
* "RENDER-E-IP:RENDER-E-PORT1": "PUBLIC-B-IP:PORT2",
|
|
120
|
-
* "RENDER-E-IP:RENDER-E-PORT2": "PUBLIC-C-IP:PORT1",
|
|
121
|
-
* }
|
|
122
|
-
*/
|
|
123
|
-
publicPortMapping?: PublicPortMapping;
|
|
124
|
-
/**
|
|
125
|
-
* 是否提示输入文字 APP_REQUEST_INPUT
|
|
126
|
-
* 当服务端检测到输入法事件后会抛出事件,可在 web 层添加输入框,配合 inputText 发送文字到云端
|
|
127
|
-
* 默认打开,当手动关闭时将不会抛出 APP_REQUEST_INPUT 事件
|
|
128
|
-
*/
|
|
129
|
-
textInputEventPrompt?: boolean;
|
|
130
|
-
|
|
131
|
-
/**
|
|
132
|
-
* 当启用音频输入功能,是否自动连入音频设备。
|
|
133
|
-
* 默认关闭。
|
|
134
|
-
* 需要注意默认打开的时系统中默认的音频设备。
|
|
135
|
-
*/
|
|
136
|
-
audioInputAutoStart?: boolean;
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* 当启用视频输入功能,是否自动连入视频设备。
|
|
140
|
-
* 默认关闭。
|
|
141
|
-
* 需要注意默认打开的是系统中默认的视频设备。
|
|
142
|
-
*/
|
|
143
|
-
videoInputAutoStart?: boolean;
|
|
144
|
-
}
|
|
145
|
-
```
|
package/dist/doc/events.md
DELETED
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
# LarkSR 事件系统
|
|
2
|
-
|
|
3
|
-
在 LarkSR 整个生命周期内会抛出多种事件通知。使用方法类似:
|
|
4
|
-
|
|
5
|
-
```javascript
|
|
6
|
-
var larksr;
|
|
7
|
-
|
|
8
|
-
// create code
|
|
9
|
-
...
|
|
10
|
-
|
|
11
|
-
// 监听连接成功事件
|
|
12
|
-
larksr.on('connect', function(e) {
|
|
13
|
-
console.log("LarkSRClientEvent CONNECT", e);
|
|
14
|
-
});
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
## 完整事件定义
|
|
18
|
-
|
|
19
|
-
```javascript
|
|
20
|
-
/**
|
|
21
|
-
* LarkSR 实例完整事件定义
|
|
22
|
-
*/
|
|
23
|
-
declare const enum LarkSRClientEvent {
|
|
24
|
-
/**
|
|
25
|
-
* TASK 创建成功,返回 Task 相关信息
|
|
26
|
-
*/
|
|
27
|
-
TASK_CREATE_SUCCESS = 'taskcreatesuccess',
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* TASK 创建失败
|
|
31
|
-
*/
|
|
32
|
-
TASK_CREATE_FAILED = 'taskcreatefailed',
|
|
33
|
-
/**
|
|
34
|
-
* 连接渲染服务器成功 .
|
|
35
|
-
*/
|
|
36
|
-
CONNECT = "connect",
|
|
37
|
-
/**
|
|
38
|
-
* 登录成功时触发,会返回当前用户id .
|
|
39
|
-
*/
|
|
40
|
-
LOGIN_SUCCESS = "loginsuccess",
|
|
41
|
-
/**
|
|
42
|
-
* 无操作超时时触发 .
|
|
43
|
-
*/
|
|
44
|
-
NO_OPERATION_TIMEOUT = "operatetimeout",
|
|
45
|
-
/**
|
|
46
|
-
* 连接关闭.
|
|
47
|
-
*/
|
|
48
|
-
CLOSE = "close",
|
|
49
|
-
/**
|
|
50
|
-
* 云端应用关闭,但连接未关闭
|
|
51
|
-
*/
|
|
52
|
-
APP_CLOSE = "appclose",
|
|
53
|
-
/**
|
|
54
|
-
* 获取到远端视频流 .
|
|
55
|
-
*/
|
|
56
|
-
GOT_REMOTE_STREAM = "gotremotesteam",
|
|
57
|
-
/**
|
|
58
|
-
* 视频加载成功,等待播放 .
|
|
59
|
-
*/
|
|
60
|
-
MEDIA_LOADED = "meidaloaded",
|
|
61
|
-
/**
|
|
62
|
-
* 视频自动播放成功 .
|
|
63
|
-
*/
|
|
64
|
-
MEDIA_PLAY_SUCCESS = "mediaplaysuccess",
|
|
65
|
-
/**
|
|
66
|
-
* 视频自动播放失败 .
|
|
67
|
-
*/
|
|
68
|
-
MEDIA_PLAY_FAILED = "mediaplayfailed",
|
|
69
|
-
/**
|
|
70
|
-
* 自动播放声音失败,以静音模式播放 .
|
|
71
|
-
*/
|
|
72
|
-
MEDIA_PLAY_MUTE = "meidaplaymute",
|
|
73
|
-
/**
|
|
74
|
-
* 云渲染连接状态改变 .
|
|
75
|
-
*/
|
|
76
|
-
APPSTATE_CHANGE = "appstatechange",
|
|
77
|
-
/**
|
|
78
|
-
* 云端应用大小变化 .
|
|
79
|
-
*/
|
|
80
|
-
APP_RESIZE = "appresize",
|
|
81
|
-
/**
|
|
82
|
-
* 云端应用鼠标模式变化时触发 .
|
|
83
|
-
*/
|
|
84
|
-
APP_MOUSE_MODE = "appmousemode",
|
|
85
|
-
/**
|
|
86
|
-
* 云端应用鼠标状态变化 .
|
|
87
|
-
*/
|
|
88
|
-
APP_CURSOR_MODE = "appcursormode",
|
|
89
|
-
/**
|
|
90
|
-
* 玩家列表 .
|
|
91
|
-
*/
|
|
92
|
-
PLAYER_LIST = "playerlist",
|
|
93
|
-
/**
|
|
94
|
-
* 视频连接状态
|
|
95
|
-
*/
|
|
96
|
-
PEERSTATUS_REPORT = "peerstatusreport",
|
|
97
|
-
/**
|
|
98
|
-
* 云端应用请求输入文字 .
|
|
99
|
-
*/
|
|
100
|
-
APP_REQUEST_INPUT = "apprequestinput",
|
|
101
|
-
/**
|
|
102
|
-
* 云端应用请求手柄震动
|
|
103
|
-
*/
|
|
104
|
-
APP_REQUEST_GAMEPAD_OUPUT = "apprequestgamepadoutput",
|
|
105
|
-
/**
|
|
106
|
-
* 截图成功.
|
|
107
|
-
*/
|
|
108
|
-
CAPTURE_FRAME = "captureframe",
|
|
109
|
-
/**
|
|
110
|
-
* 数据通道打开 .
|
|
111
|
-
*/
|
|
112
|
-
DATACHANNEL_OPEN = "datachannelopen",
|
|
113
|
-
/**
|
|
114
|
-
* 数据通道关闭 .
|
|
115
|
-
*/
|
|
116
|
-
DATACHANNEL_CLOSE = "datachannelclose",
|
|
117
|
-
/**
|
|
118
|
-
* 数据通达收到文字消息 .
|
|
119
|
-
* > V3.2.314 版本对应服务器版本和数据通道版本为 3.2.5.1 及以上
|
|
120
|
-
*/
|
|
121
|
-
DATACHANNEL_TEXT = "datachanneltext",
|
|
122
|
-
/**
|
|
123
|
-
* 数据通道收到字节消息 .
|
|
124
|
-
*/
|
|
125
|
-
DATACHANNEL_BINARY = "datachannelbinary",
|
|
126
|
-
/**
|
|
127
|
-
* 更详细的事件状态,主要用于向iframe外部抛出 .
|
|
128
|
-
*/
|
|
129
|
-
LarkEvent = "larkevent",
|
|
130
|
-
/**
|
|
131
|
-
* 发生错误时抛出
|
|
132
|
-
*/
|
|
133
|
-
ERROR = "error",
|
|
134
|
-
/**
|
|
135
|
-
* 一般信息提示
|
|
136
|
-
*/
|
|
137
|
-
INFO = "info"
|
|
138
|
-
}
|
|
139
|
-
```
|