larksr_websdk 3.2.318 → 3.2.321
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/doc/config.md +20 -0
- package/dist/doc/events.md +9 -0
- package/dist/doc/functions.md +72 -2
- package/dist/doc/member_variables.md +160 -0
- package/dist/doc/update.md +138 -1
- package/dist/larksr-web-sdk.min.js +1 -1
- package/dist/types/api.d.ts +3 -0
- package/dist/types/appli_params.d.ts +4 -0
- package/dist/types/index.d.ts +2 -1
- package/dist/types/lark/application.d.ts +4 -1
- package/dist/types/lark/peer_connection.d.ts +5 -2
- package/dist/types/larksr.d.ts +64 -5
- package/dist/types/operation/gesture.d.ts +3 -1
- package/dist/types/operation/gesture_handler.d.ts +37 -0
- package/dist/types/operation/keyboard_handler.d.ts +3 -0
- package/dist/types/operation/operation.d.ts +30 -5
- package/dist/types/utils/capabilities.d.ts +2 -0
- package/dist/types/utils/ios-inner-height.d.ts +4 -0
- package/dist/types/utils/unit.d.ts +0 -5
- package/package.json +2 -1
- package/types/api.d.ts +3 -0
- package/types/appli_params.d.ts +4 -0
- package/types/index.d.ts +2 -1
- package/types/lark/application.d.ts +4 -1
- package/types/lark/peer_connection.d.ts +5 -2
- package/types/larksr.d.ts +64 -5
- 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/types/api.d.ts
CHANGED
|
@@ -193,6 +193,8 @@ export interface IAppliParams {
|
|
|
193
193
|
textInputEventPrompt: boolean;
|
|
194
194
|
audioInput: boolean;
|
|
195
195
|
audioInputAutoStart: boolean;
|
|
196
|
+
videoInput: boolean;
|
|
197
|
+
videoInputAutoStart: boolean;
|
|
196
198
|
}
|
|
197
199
|
export declare enum AppliType {
|
|
198
200
|
DESKTOP = 1,
|
|
@@ -255,6 +257,8 @@ export declare class AppliParams implements IAppliParams {
|
|
|
255
257
|
textInputEventPrompt: boolean;
|
|
256
258
|
audioInput: boolean;
|
|
257
259
|
audioInputAutoStart: boolean;
|
|
260
|
+
videoInput: boolean;
|
|
261
|
+
videoInputAutoStart: boolean;
|
|
258
262
|
static copyAndCreate(params?: IAppliParams): AppliParams;
|
|
259
263
|
static setUpWithSDKConfig(params: IAppliParams, config: ILarkSRConfig): AppliParams;
|
|
260
264
|
}
|
package/dist/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;
|
|
@@ -59,6 +59,8 @@ export default class Application extends EventBase<APP_EVENT_TYPE, AppEvent> {
|
|
|
59
59
|
private _state;
|
|
60
60
|
get audioDeviceId(): string | undefined;
|
|
61
61
|
get audioTrack(): MediaStreamTrack | undefined;
|
|
62
|
+
get videoDeviceId(): string | undefined;
|
|
63
|
+
get videoTrack(): MediaStreamTrack | undefined;
|
|
62
64
|
private retryTime;
|
|
63
65
|
private larksr;
|
|
64
66
|
get voiceId(): number;
|
|
@@ -87,7 +89,7 @@ export default class Application extends EventBase<APP_EVENT_TYPE, AppEvent> {
|
|
|
87
89
|
startMonitorSteam(): void;
|
|
88
90
|
restart(): void;
|
|
89
91
|
restartApp(): void;
|
|
90
|
-
rtcOffer(): void
|
|
92
|
+
rtcOffer(): Promise<void>;
|
|
91
93
|
setAnswer(sdp: string): void;
|
|
92
94
|
setIce(sdpMlineindex: number, sdpmid: string, candidate: string): void;
|
|
93
95
|
sendInput(input: Msg.CloudLark.ClientInput): void;
|
|
@@ -111,6 +113,7 @@ export default class Application extends EventBase<APP_EVENT_TYPE, AppEvent> {
|
|
|
111
113
|
private onRemoteStream;
|
|
112
114
|
private onAudioRemoteStream;
|
|
113
115
|
private onRtcError;
|
|
116
|
+
private onRtcInfo;
|
|
114
117
|
private onIceStateChange;
|
|
115
118
|
retryPeerconnection(): void;
|
|
116
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;
|
|
@@ -98,12 +99,14 @@ export default class PeerConnection extends EventBase<WEBRTC_EVENT_TYPE, WebRTCE
|
|
|
98
99
|
private videoStream;
|
|
99
100
|
get audioDeviceId(): string | undefined;
|
|
100
101
|
get audioTrack(): MediaStreamTrack | undefined;
|
|
102
|
+
get videoDeviceId(): string | undefined;
|
|
103
|
+
get videoTrack(): MediaStreamTrack | undefined;
|
|
101
104
|
private localAudioTrackBinding;
|
|
102
105
|
private localVideoTrackBinding;
|
|
103
106
|
private localShareTrackBinding;
|
|
104
107
|
private sdpCreateSuccess;
|
|
105
108
|
constructor(larksr: LarkSR, config: WebRTCConfig);
|
|
106
|
-
create(): void
|
|
109
|
+
create(streams?: MediaStream | undefined | null): Promise<void>;
|
|
107
110
|
createOffer(): void;
|
|
108
111
|
close(): void;
|
|
109
112
|
setAudioEnable(enable: boolean): void;
|
package/dist/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
|
* 普通模式
|
|
@@ -324,9 +325,28 @@ interface ILarkSRConfig {
|
|
|
324
325
|
/**
|
|
325
326
|
* 当启用音频输入功能,是否自动连入音频设备。
|
|
326
327
|
* 默认关闭。
|
|
327
|
-
*
|
|
328
|
+
* 需要注意默认打开的是系统中默认的音频设备。
|
|
328
329
|
*/
|
|
329
330
|
audioInputAutoStart?: boolean;
|
|
331
|
+
/**
|
|
332
|
+
* 当启用视频输入功能,是否自动连入视频设备。
|
|
333
|
+
* 默认关闭。
|
|
334
|
+
* 需要注意默认打开的是系统中默认的视频设备。
|
|
335
|
+
*/
|
|
336
|
+
videoInputAutoStart?: boolean;
|
|
337
|
+
/**
|
|
338
|
+
* mouseZoomDirection
|
|
339
|
+
* 用于移动端捏合缩放操作与应用鼠标缩放的对应关系
|
|
340
|
+
* 1:鼠标滚轮向上为放大,
|
|
341
|
+
* 0:鼠标滚轮向下为放大(default)
|
|
342
|
+
*/
|
|
343
|
+
mouseZoomDirection?: number;
|
|
344
|
+
/**
|
|
345
|
+
* 触摸指令模式,对应后台应用管理->应用编辑->移动端高级设置->触摸指令模式 优先级高于后台配置
|
|
346
|
+
* 触摸指令,移动端的触摸指令对应为云端的触屏还是鼠标
|
|
347
|
+
* 'touchScreen' | 'mouse'
|
|
348
|
+
*/
|
|
349
|
+
touchOperateMode?: 'touchScreen' | 'mouse';
|
|
330
350
|
}
|
|
331
351
|
declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
|
|
332
352
|
/**
|
|
@@ -462,6 +482,14 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
|
|
|
462
482
|
* 当前打开音频的track对象,未打开状态为空
|
|
463
483
|
*/
|
|
464
484
|
get audioTrack(): MediaStreamTrack | undefined;
|
|
485
|
+
/**
|
|
486
|
+
* 当前打开视频设备 ID,如果打开时没指定特设备id为空
|
|
487
|
+
*/
|
|
488
|
+
get videoDeviceId(): string | undefined;
|
|
489
|
+
/**
|
|
490
|
+
* 当前打开视频track对象,未打开状态为空
|
|
491
|
+
*/
|
|
492
|
+
get videoTrack(): MediaStreamTrack | undefined;
|
|
465
493
|
/**
|
|
466
494
|
* LarkSR 客户端。所有操作和事件通过该类传递
|
|
467
495
|
* @param config 本地配置,优先级最高
|
|
@@ -528,6 +556,10 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
|
|
|
528
556
|
* 主动关闭连接
|
|
529
557
|
*/
|
|
530
558
|
close(): void;
|
|
559
|
+
/**
|
|
560
|
+
* 从DOM种删除渲染组件,注意删除渲染组件之后将无法再次进入应用,所有状态将失效,不可恢复,只能重新new LarkSR
|
|
561
|
+
*/
|
|
562
|
+
destroy(): void;
|
|
531
563
|
/**
|
|
532
564
|
* 设置是否强制横屏显示内容.
|
|
533
565
|
* handelRootElementSize 必须设置为 true 才有作用。
|
|
@@ -593,8 +625,13 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
|
|
|
593
625
|
resetAppMouseLockState(): void;
|
|
594
626
|
/**
|
|
595
627
|
* 采集一帧图像
|
|
628
|
+
* @params data: any 抛出采集事件时抛出的附加data,比如采集的时间戳
|
|
629
|
+
* @return { data: any, base64: base64string } 返回传入的 data 和采集的 base64 字符串
|
|
596
630
|
*/
|
|
597
|
-
captrueFrame(data: any):
|
|
631
|
+
captrueFrame(data: any): {
|
|
632
|
+
data: any;
|
|
633
|
+
base64: any;
|
|
634
|
+
};
|
|
598
635
|
/**
|
|
599
636
|
* 操作相关事件
|
|
600
637
|
* 所有事件坐标相对于云端应用,不相对于网页
|
|
@@ -782,6 +819,11 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
|
|
|
782
819
|
* @returns
|
|
783
820
|
*/
|
|
784
821
|
setAudioEnable(enable: boolean): void | undefined;
|
|
822
|
+
/**
|
|
823
|
+
* 设置当前已开启的视频track是否启用状态
|
|
824
|
+
* @param enable 是否启用
|
|
825
|
+
* @returns
|
|
826
|
+
*/
|
|
785
827
|
setVideoEnable(enable: boolean): void | undefined;
|
|
786
828
|
setShareEnable(enable: boolean): void | undefined;
|
|
787
829
|
/**
|
|
@@ -794,24 +836,41 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
|
|
|
794
836
|
/**
|
|
795
837
|
* 打开一个音频设备,要注意浏览器限制在 https 或者 localhost 下才能打开音频
|
|
796
838
|
* @param deviceId 音频设备id,如果不传将打开默认设备。@see getConnectedAudioinputDevices
|
|
797
|
-
* @returns
|
|
839
|
+
* @returns Promise
|
|
798
840
|
*/
|
|
799
841
|
openAudio(deviceId?: string): Promise<{
|
|
800
842
|
streams: MediaStream;
|
|
801
843
|
rtcRtpSenders: import("./lark/peer_connection").RTCMediaTrackBinding[];
|
|
802
844
|
} | undefined>;
|
|
845
|
+
/**
|
|
846
|
+
* 打开一个视频设备,要注意浏览器限制在 https 或者 localhost 下才能打开视频
|
|
847
|
+
* @param audio boolean 是否同时开启音频
|
|
848
|
+
* @param cameraId 视频设备id,如果不传将打开默认设备。@see getConnectedVideoinputDevices
|
|
849
|
+
* @returns Promise
|
|
850
|
+
*/
|
|
803
851
|
openVideo(audio?: boolean, cameraId?: string): Promise<{
|
|
804
852
|
streams: MediaStream;
|
|
805
853
|
rtcRtpSenders: import("./lark/peer_connection").RTCMediaTrackBinding[];
|
|
806
854
|
} | undefined>;
|
|
855
|
+
/**
|
|
856
|
+
* 打开默认媒体设备,要注意浏览器限制在 https 或者 localhost 下
|
|
857
|
+
* 如果需要指定特殊的媒体设备请单独使用 @see openAudio @see openVideo
|
|
858
|
+
* @param video 是否包含视频
|
|
859
|
+
* @param audio 是否包含音频
|
|
860
|
+
* @returns Promise
|
|
861
|
+
*/
|
|
807
862
|
openDefaultMedia(video?: boolean, audio?: boolean): Promise<void | undefined>;
|
|
808
863
|
openShareMediaDevice(): Promise<void | undefined>;
|
|
809
864
|
/**
|
|
810
865
|
* 返回已连接的音频设备列表,设备列表中的设备的 deviceId 可用来打开某个音频设备
|
|
811
|
-
* @returns
|
|
866
|
+
* @returns Promise<MediaDeviceInfo[]>
|
|
812
867
|
*/
|
|
813
868
|
getConnectedAudioinputDevices(): Promise<MediaDeviceInfo[] | undefined>;
|
|
814
869
|
getConnectedAudioOutputDevices(): Promise<MediaDeviceInfo[] | undefined>;
|
|
870
|
+
/**
|
|
871
|
+
* 返回已连接的视频设备
|
|
872
|
+
* @returns Promise<MediaDeviceInfo[]>
|
|
873
|
+
*/
|
|
815
874
|
getConnectedVideoinputDevices(): Promise<MediaDeviceInfo[] | undefined>;
|
|
816
875
|
getConnectedDevices(type: MediaDeviceKind): Promise<MediaDeviceInfo[] | undefined>;
|
|
817
876
|
openAudioDevice(deviceId: string, kind?: "audioinput" | "audiooutput"): Promise<{
|
|
@@ -851,4 +910,4 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
|
|
|
851
910
|
private onOperationTimeout;
|
|
852
911
|
private onOperationInput;
|
|
853
912
|
}
|
|
854
|
-
export { LarkSR, ILarkSRConfig, PlayerModeType, UserType, LarkSREvent, LarkEventType, LarkSRClientEvent, AppliParams, AppliParamsUtils, LoadAppliParamsFromUrl, LoadAppliParamsStartAppInfo, EventBase, API, Operation, Capabilities, ScaleMode, VirtualKey, KEYMAP, CloudLark, FullScreen, LockPointer, Recorder, };
|
|
913
|
+
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;
|
|
@@ -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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "larksr_websdk",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.321",
|
|
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
package/types/appli_params.d.ts
CHANGED
|
@@ -193,6 +193,8 @@ export interface IAppliParams {
|
|
|
193
193
|
textInputEventPrompt: boolean;
|
|
194
194
|
audioInput: boolean;
|
|
195
195
|
audioInputAutoStart: boolean;
|
|
196
|
+
videoInput: boolean;
|
|
197
|
+
videoInputAutoStart: boolean;
|
|
196
198
|
}
|
|
197
199
|
export declare enum AppliType {
|
|
198
200
|
DESKTOP = 1,
|
|
@@ -255,6 +257,8 @@ export declare class AppliParams implements IAppliParams {
|
|
|
255
257
|
textInputEventPrompt: boolean;
|
|
256
258
|
audioInput: boolean;
|
|
257
259
|
audioInputAutoStart: boolean;
|
|
260
|
+
videoInput: boolean;
|
|
261
|
+
videoInputAutoStart: boolean;
|
|
258
262
|
static copyAndCreate(params?: IAppliParams): AppliParams;
|
|
259
263
|
static setUpWithSDKConfig(params: IAppliParams, config: ILarkSRConfig): AppliParams;
|
|
260
264
|
}
|
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;
|
|
@@ -59,6 +59,8 @@ export default class Application extends EventBase<APP_EVENT_TYPE, AppEvent> {
|
|
|
59
59
|
private _state;
|
|
60
60
|
get audioDeviceId(): string | undefined;
|
|
61
61
|
get audioTrack(): MediaStreamTrack | undefined;
|
|
62
|
+
get videoDeviceId(): string | undefined;
|
|
63
|
+
get videoTrack(): MediaStreamTrack | undefined;
|
|
62
64
|
private retryTime;
|
|
63
65
|
private larksr;
|
|
64
66
|
get voiceId(): number;
|
|
@@ -87,7 +89,7 @@ export default class Application extends EventBase<APP_EVENT_TYPE, AppEvent> {
|
|
|
87
89
|
startMonitorSteam(): void;
|
|
88
90
|
restart(): void;
|
|
89
91
|
restartApp(): void;
|
|
90
|
-
rtcOffer(): void
|
|
92
|
+
rtcOffer(): Promise<void>;
|
|
91
93
|
setAnswer(sdp: string): void;
|
|
92
94
|
setIce(sdpMlineindex: number, sdpmid: string, candidate: string): void;
|
|
93
95
|
sendInput(input: Msg.CloudLark.ClientInput): void;
|
|
@@ -111,6 +113,7 @@ export default class Application extends EventBase<APP_EVENT_TYPE, AppEvent> {
|
|
|
111
113
|
private onRemoteStream;
|
|
112
114
|
private onAudioRemoteStream;
|
|
113
115
|
private onRtcError;
|
|
116
|
+
private onRtcInfo;
|
|
114
117
|
private onIceStateChange;
|
|
115
118
|
retryPeerconnection(): void;
|
|
116
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;
|
|
@@ -98,12 +99,14 @@ export default class PeerConnection extends EventBase<WEBRTC_EVENT_TYPE, WebRTCE
|
|
|
98
99
|
private videoStream;
|
|
99
100
|
get audioDeviceId(): string | undefined;
|
|
100
101
|
get audioTrack(): MediaStreamTrack | undefined;
|
|
102
|
+
get videoDeviceId(): string | undefined;
|
|
103
|
+
get videoTrack(): MediaStreamTrack | undefined;
|
|
101
104
|
private localAudioTrackBinding;
|
|
102
105
|
private localVideoTrackBinding;
|
|
103
106
|
private localShareTrackBinding;
|
|
104
107
|
private sdpCreateSuccess;
|
|
105
108
|
constructor(larksr: LarkSR, config: WebRTCConfig);
|
|
106
|
-
create(): void
|
|
109
|
+
create(streams?: MediaStream | undefined | null): Promise<void>;
|
|
107
110
|
createOffer(): void;
|
|
108
111
|
close(): void;
|
|
109
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
|
* 普通模式
|
|
@@ -324,9 +325,28 @@ interface ILarkSRConfig {
|
|
|
324
325
|
/**
|
|
325
326
|
* 当启用音频输入功能,是否自动连入音频设备。
|
|
326
327
|
* 默认关闭。
|
|
327
|
-
*
|
|
328
|
+
* 需要注意默认打开的是系统中默认的音频设备。
|
|
328
329
|
*/
|
|
329
330
|
audioInputAutoStart?: boolean;
|
|
331
|
+
/**
|
|
332
|
+
* 当启用视频输入功能,是否自动连入视频设备。
|
|
333
|
+
* 默认关闭。
|
|
334
|
+
* 需要注意默认打开的是系统中默认的视频设备。
|
|
335
|
+
*/
|
|
336
|
+
videoInputAutoStart?: boolean;
|
|
337
|
+
/**
|
|
338
|
+
* mouseZoomDirection
|
|
339
|
+
* 用于移动端捏合缩放操作与应用鼠标缩放的对应关系
|
|
340
|
+
* 1:鼠标滚轮向上为放大,
|
|
341
|
+
* 0:鼠标滚轮向下为放大(default)
|
|
342
|
+
*/
|
|
343
|
+
mouseZoomDirection?: number;
|
|
344
|
+
/**
|
|
345
|
+
* 触摸指令模式,对应后台应用管理->应用编辑->移动端高级设置->触摸指令模式 优先级高于后台配置
|
|
346
|
+
* 触摸指令,移动端的触摸指令对应为云端的触屏还是鼠标
|
|
347
|
+
* 'touchScreen' | 'mouse'
|
|
348
|
+
*/
|
|
349
|
+
touchOperateMode?: 'touchScreen' | 'mouse';
|
|
330
350
|
}
|
|
331
351
|
declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
|
|
332
352
|
/**
|
|
@@ -462,6 +482,14 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
|
|
|
462
482
|
* 当前打开音频的track对象,未打开状态为空
|
|
463
483
|
*/
|
|
464
484
|
get audioTrack(): MediaStreamTrack | undefined;
|
|
485
|
+
/**
|
|
486
|
+
* 当前打开视频设备 ID,如果打开时没指定特设备id为空
|
|
487
|
+
*/
|
|
488
|
+
get videoDeviceId(): string | undefined;
|
|
489
|
+
/**
|
|
490
|
+
* 当前打开视频track对象,未打开状态为空
|
|
491
|
+
*/
|
|
492
|
+
get videoTrack(): MediaStreamTrack | undefined;
|
|
465
493
|
/**
|
|
466
494
|
* LarkSR 客户端。所有操作和事件通过该类传递
|
|
467
495
|
* @param config 本地配置,优先级最高
|
|
@@ -528,6 +556,10 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
|
|
|
528
556
|
* 主动关闭连接
|
|
529
557
|
*/
|
|
530
558
|
close(): void;
|
|
559
|
+
/**
|
|
560
|
+
* 从DOM种删除渲染组件,注意删除渲染组件之后将无法再次进入应用,所有状态将失效,不可恢复,只能重新new LarkSR
|
|
561
|
+
*/
|
|
562
|
+
destroy(): void;
|
|
531
563
|
/**
|
|
532
564
|
* 设置是否强制横屏显示内容.
|
|
533
565
|
* handelRootElementSize 必须设置为 true 才有作用。
|
|
@@ -593,8 +625,13 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
|
|
|
593
625
|
resetAppMouseLockState(): void;
|
|
594
626
|
/**
|
|
595
627
|
* 采集一帧图像
|
|
628
|
+
* @params data: any 抛出采集事件时抛出的附加data,比如采集的时间戳
|
|
629
|
+
* @return { data: any, base64: base64string } 返回传入的 data 和采集的 base64 字符串
|
|
596
630
|
*/
|
|
597
|
-
captrueFrame(data: any):
|
|
631
|
+
captrueFrame(data: any): {
|
|
632
|
+
data: any;
|
|
633
|
+
base64: any;
|
|
634
|
+
};
|
|
598
635
|
/**
|
|
599
636
|
* 操作相关事件
|
|
600
637
|
* 所有事件坐标相对于云端应用,不相对于网页
|
|
@@ -782,6 +819,11 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
|
|
|
782
819
|
* @returns
|
|
783
820
|
*/
|
|
784
821
|
setAudioEnable(enable: boolean): void | undefined;
|
|
822
|
+
/**
|
|
823
|
+
* 设置当前已开启的视频track是否启用状态
|
|
824
|
+
* @param enable 是否启用
|
|
825
|
+
* @returns
|
|
826
|
+
*/
|
|
785
827
|
setVideoEnable(enable: boolean): void | undefined;
|
|
786
828
|
setShareEnable(enable: boolean): void | undefined;
|
|
787
829
|
/**
|
|
@@ -794,24 +836,41 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
|
|
|
794
836
|
/**
|
|
795
837
|
* 打开一个音频设备,要注意浏览器限制在 https 或者 localhost 下才能打开音频
|
|
796
838
|
* @param deviceId 音频设备id,如果不传将打开默认设备。@see getConnectedAudioinputDevices
|
|
797
|
-
* @returns
|
|
839
|
+
* @returns Promise
|
|
798
840
|
*/
|
|
799
841
|
openAudio(deviceId?: string): Promise<{
|
|
800
842
|
streams: MediaStream;
|
|
801
843
|
rtcRtpSenders: import("./lark/peer_connection").RTCMediaTrackBinding[];
|
|
802
844
|
} | undefined>;
|
|
845
|
+
/**
|
|
846
|
+
* 打开一个视频设备,要注意浏览器限制在 https 或者 localhost 下才能打开视频
|
|
847
|
+
* @param audio boolean 是否同时开启音频
|
|
848
|
+
* @param cameraId 视频设备id,如果不传将打开默认设备。@see getConnectedVideoinputDevices
|
|
849
|
+
* @returns Promise
|
|
850
|
+
*/
|
|
803
851
|
openVideo(audio?: boolean, cameraId?: string): Promise<{
|
|
804
852
|
streams: MediaStream;
|
|
805
853
|
rtcRtpSenders: import("./lark/peer_connection").RTCMediaTrackBinding[];
|
|
806
854
|
} | undefined>;
|
|
855
|
+
/**
|
|
856
|
+
* 打开默认媒体设备,要注意浏览器限制在 https 或者 localhost 下
|
|
857
|
+
* 如果需要指定特殊的媒体设备请单独使用 @see openAudio @see openVideo
|
|
858
|
+
* @param video 是否包含视频
|
|
859
|
+
* @param audio 是否包含音频
|
|
860
|
+
* @returns Promise
|
|
861
|
+
*/
|
|
807
862
|
openDefaultMedia(video?: boolean, audio?: boolean): Promise<void | undefined>;
|
|
808
863
|
openShareMediaDevice(): Promise<void | undefined>;
|
|
809
864
|
/**
|
|
810
865
|
* 返回已连接的音频设备列表,设备列表中的设备的 deviceId 可用来打开某个音频设备
|
|
811
|
-
* @returns
|
|
866
|
+
* @returns Promise<MediaDeviceInfo[]>
|
|
812
867
|
*/
|
|
813
868
|
getConnectedAudioinputDevices(): Promise<MediaDeviceInfo[] | undefined>;
|
|
814
869
|
getConnectedAudioOutputDevices(): Promise<MediaDeviceInfo[] | undefined>;
|
|
870
|
+
/**
|
|
871
|
+
* 返回已连接的视频设备
|
|
872
|
+
* @returns Promise<MediaDeviceInfo[]>
|
|
873
|
+
*/
|
|
815
874
|
getConnectedVideoinputDevices(): Promise<MediaDeviceInfo[] | undefined>;
|
|
816
875
|
getConnectedDevices(type: MediaDeviceKind): Promise<MediaDeviceInfo[] | undefined>;
|
|
817
876
|
openAudioDevice(deviceId: string, kind?: "audioinput" | "audiooutput"): Promise<{
|
|
@@ -851,4 +910,4 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
|
|
|
851
910
|
private onOperationTimeout;
|
|
852
911
|
private onOperationInput;
|
|
853
912
|
}
|
|
854
|
-
export { LarkSR, ILarkSRConfig, PlayerModeType, UserType, LarkSREvent, LarkEventType, LarkSRClientEvent, AppliParams, AppliParamsUtils, LoadAppliParamsFromUrl, LoadAppliParamsStartAppInfo, EventBase, API, Operation, Capabilities, ScaleMode, VirtualKey, KEYMAP, CloudLark, FullScreen, LockPointer, Recorder, };
|
|
913
|
+
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;
|