larksr_websdk 3.2.323 → 3.2.324
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 +158 -0
- package/dist/doc/events.md +149 -0
- package/dist/doc/functions.md +463 -0
- package/dist/doc/index.md +82 -0
- package/dist/doc/member_variables.md +385 -0
- package/dist/doc/sdkid_encryption.md +40 -0
- package/dist/doc/update.md +251 -0
- package/dist/larksr-web-sdk.min.js +1 -1
- package/dist/types/api.d.ts +131 -0
- package/dist/types/appli_params.d.ts +291 -0
- package/dist/types/common/cmd.d.ts +28 -0
- package/dist/types/common/constant.d.ts +4 -0
- package/dist/types/common/interface.d.ts +30 -0
- package/dist/types/config.d.ts +59 -0
- package/dist/types/event/event_base.d.ts +11 -0
- package/dist/types/event/iframe_poster.d.ts +9 -0
- package/dist/types/index.d.ts +23 -0
- package/dist/types/lark/Worker.d.ts +0 -0
- package/dist/types/lark/application.d.ts +185 -0
- package/dist/types/lark/custom.d.ts +7 -0
- package/dist/types/lark/ice_candiadate_parser.d.ts +24 -0
- package/dist/types/lark/lark_event_type.d.ts +113 -0
- package/dist/types/lark/message.d.ts +20 -0
- package/dist/types/lark/peer_connection.d.ts +178 -0
- package/dist/types/lark/recoder.d.ts +55 -0
- package/dist/types/lark/sdp_util.d.ts +36 -0
- package/dist/types/lark/test_pixel_streaming.d.ts +54 -0
- package/dist/types/lark/websocket_channel.d.ts +56 -0
- package/dist/types/lark/websocket_proxy.d.ts +56 -0
- package/dist/types/larksr.d.ts +978 -0
- package/dist/types/localization/base.d.ts +8 -0
- package/dist/types/localization/gesture_ins.d.ts +4 -0
- package/dist/types/localization/language.d.ts +6 -0
- package/dist/types/localization/loader.d.ts +14 -0
- package/dist/types/localization/message.d.ts +81 -0
- package/dist/types/localization/ui.d.ts +58 -0
- package/dist/types/operation/gamepad_handler.d.ts +67 -0
- package/dist/types/operation/gesture.d.ts +72 -0
- package/dist/types/operation/gesture_handler.d.ts +53 -0
- package/dist/types/operation/handler_base.d.ts +8 -0
- package/dist/types/operation/keyboard_handler.d.ts +21 -0
- package/dist/types/operation/keymap.d.ts +24 -0
- package/dist/types/operation/letter_keymap.d.ts +8 -0
- package/dist/types/operation/mouse_handler.d.ts +42 -0
- package/dist/types/operation/num_keymap.d.ts +12 -0
- package/dist/types/operation/operation.d.ts +97 -0
- package/dist/types/operation/pixel_streaming_input.d.ts +82 -0
- package/dist/types/operation/touch_handler.d.ts +11 -0
- package/dist/types/operation/utils.d.ts +18 -0
- package/dist/types/protobuf/cloudlark.d.ts +7854 -0
- package/dist/types/screen_state.d.ts +116 -0
- package/dist/types/utils/browser_type.d.ts +37 -0
- package/dist/types/utils/capabilities.d.ts +54 -0
- package/dist/types/utils/full_screen.d.ts +25 -0
- package/dist/types/utils/ios-inner-height.d.ts +4 -0
- package/dist/types/utils/lock_pointer.d.ts +23 -0
- package/dist/types/utils/log.d.ts +25 -0
- package/dist/types/utils/scale_mode.d.ts +26 -0
- package/dist/types/utils/unit.d.ts +142 -0
- package/package.json +1 -1
- package/types/api.d.ts +5 -0
- package/types/appli_params.d.ts +2 -0
- package/types/lark/application.d.ts +7 -1
- package/types/lark/peer_connection.d.ts +5 -1
- package/types/larksr.d.ts +45 -1
- package/types/protobuf/cloudlark.d.ts +7854 -7384
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { ViewPort } from "./common/interface";
|
|
2
|
+
import { IAppliParams } from "./appli_params";
|
|
3
|
+
import { CloudLark } from "./protobuf/cloudlark";
|
|
4
|
+
import ScaleMode from "./utils/scale_mode";
|
|
5
|
+
import { LocalEvent, EventBase } from './event/event_base';
|
|
6
|
+
import { LarkSR } from "./larksr";
|
|
7
|
+
export interface ContainerSize {
|
|
8
|
+
marginTop: number;
|
|
9
|
+
marginLeft: number;
|
|
10
|
+
width: number;
|
|
11
|
+
height: number;
|
|
12
|
+
}
|
|
13
|
+
export interface ContainerStyle {
|
|
14
|
+
marginTop: string;
|
|
15
|
+
marginLeft: string;
|
|
16
|
+
width: string;
|
|
17
|
+
height: string;
|
|
18
|
+
cursor: any;
|
|
19
|
+
}
|
|
20
|
+
export declare type ScreenOrientation = 'portrait' | 'landscape';
|
|
21
|
+
export declare enum CursorType {
|
|
22
|
+
ARROW = 0,
|
|
23
|
+
IBEAM = 1,
|
|
24
|
+
WAIT = 2,
|
|
25
|
+
CROSS = 3,
|
|
26
|
+
SIZENWSE = 4,
|
|
27
|
+
SIZENESW = 5,
|
|
28
|
+
SIZEWE = 6,
|
|
29
|
+
SIZENS = 7,
|
|
30
|
+
SIZEALL = 8,
|
|
31
|
+
NO = 9,
|
|
32
|
+
HAND = 10,
|
|
33
|
+
CUSTOM = 11,
|
|
34
|
+
DEFAULT = 1000
|
|
35
|
+
}
|
|
36
|
+
export interface SyncCursorStyle {
|
|
37
|
+
type: CursorType;
|
|
38
|
+
hotX: number;
|
|
39
|
+
hotY: number;
|
|
40
|
+
width: number;
|
|
41
|
+
height: number;
|
|
42
|
+
customBase64: string;
|
|
43
|
+
}
|
|
44
|
+
export declare const enum SCREEN_EVENT_TYPE {
|
|
45
|
+
ReSize = 0
|
|
46
|
+
}
|
|
47
|
+
export interface ScreenEvent extends LocalEvent<SCREEN_EVENT_TYPE> {
|
|
48
|
+
container: ContainerSize;
|
|
49
|
+
viewPort: ViewPort;
|
|
50
|
+
}
|
|
51
|
+
export default class ScreenState extends EventBase<SCREEN_EVENT_TYPE, ScreenEvent> {
|
|
52
|
+
get appSize(): CloudLark.IAppResize;
|
|
53
|
+
set appSize(size: CloudLark.IAppResize);
|
|
54
|
+
private _appSize;
|
|
55
|
+
get viewPort(): ViewPort;
|
|
56
|
+
private _viewPort;
|
|
57
|
+
get viewPortStyle(): string;
|
|
58
|
+
get orientationIndexStyle(): {
|
|
59
|
+
width: string;
|
|
60
|
+
height: string;
|
|
61
|
+
top: string;
|
|
62
|
+
left: string;
|
|
63
|
+
transform: string;
|
|
64
|
+
transformOrigin: string;
|
|
65
|
+
backgroundColor: string;
|
|
66
|
+
} | {
|
|
67
|
+
width: string;
|
|
68
|
+
height: string;
|
|
69
|
+
transform: string;
|
|
70
|
+
transformOrigin: string;
|
|
71
|
+
backgroundColor: string;
|
|
72
|
+
top?: undefined;
|
|
73
|
+
left?: undefined;
|
|
74
|
+
};
|
|
75
|
+
get container(): ContainerSize;
|
|
76
|
+
private _container;
|
|
77
|
+
get containerStyle(): string;
|
|
78
|
+
get screenOrientation(): ScreenOrientation;
|
|
79
|
+
private _screenOrientation;
|
|
80
|
+
get scaleMode(): ScaleMode;
|
|
81
|
+
set scaleMode(scaleMode: ScaleMode);
|
|
82
|
+
private _scaleMode;
|
|
83
|
+
get isFullScreen(): boolean;
|
|
84
|
+
private _isFullScreen;
|
|
85
|
+
get cursorStyle(): SyncCursorStyle;
|
|
86
|
+
set cursorStyle(style: SyncCursorStyle);
|
|
87
|
+
private _cursorStyle;
|
|
88
|
+
private get cursorCSSStyle();
|
|
89
|
+
get appMouseMode(): CloudLark.IAppMouseMode;
|
|
90
|
+
set appMouseMode(mode: CloudLark.IAppMouseMode);
|
|
91
|
+
private _appMouseMode;
|
|
92
|
+
get operateScale(): {
|
|
93
|
+
scaleX: number;
|
|
94
|
+
scaleY: number;
|
|
95
|
+
};
|
|
96
|
+
get initCursorMode(): boolean;
|
|
97
|
+
set initCursorMode(mode: boolean);
|
|
98
|
+
private _initCursorMode;
|
|
99
|
+
get isMobile(): boolean;
|
|
100
|
+
private _isMobile;
|
|
101
|
+
get isLocalRenderMouse(): boolean | null | undefined;
|
|
102
|
+
get isLockMosue(): boolean | null | undefined;
|
|
103
|
+
get rootElement(): HTMLElement;
|
|
104
|
+
private _rootElement;
|
|
105
|
+
private mobileForceLandScape;
|
|
106
|
+
private bgColor;
|
|
107
|
+
get handelRootElementSize(): boolean;
|
|
108
|
+
private _handelRootElementSize;
|
|
109
|
+
private larksr;
|
|
110
|
+
get baseElementScale(): number;
|
|
111
|
+
private _baseElementScale;
|
|
112
|
+
constructor(rootElement: HTMLElement, params: IAppliParams, larksr: LarkSR, handelRootElementSize?: boolean);
|
|
113
|
+
reset(params: IAppliParams): void;
|
|
114
|
+
setMobileForceLandScape(force: boolean): void;
|
|
115
|
+
resize(baseElementScale?: number): void;
|
|
116
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export default class BrowserType {
|
|
2
|
+
static Type: {
|
|
3
|
+
Chrome: string;
|
|
4
|
+
iOSChrome: string;
|
|
5
|
+
Firefox: string;
|
|
6
|
+
Edge: string;
|
|
7
|
+
Opera: string;
|
|
8
|
+
IE: string;
|
|
9
|
+
Safari: string;
|
|
10
|
+
};
|
|
11
|
+
static Support: {
|
|
12
|
+
Chrome: number;
|
|
13
|
+
Firefox: number;
|
|
14
|
+
Edge: number;
|
|
15
|
+
};
|
|
16
|
+
static AdviseSupportVersion: {
|
|
17
|
+
Chrome: number;
|
|
18
|
+
Firefox: number;
|
|
19
|
+
Edge: number;
|
|
20
|
+
};
|
|
21
|
+
static SupportMobile: {
|
|
22
|
+
Chrome: number;
|
|
23
|
+
iOSChrome: number;
|
|
24
|
+
Firefox: number;
|
|
25
|
+
Edge: number;
|
|
26
|
+
};
|
|
27
|
+
static getBrowserType(): string;
|
|
28
|
+
/**
|
|
29
|
+
* @return
|
|
30
|
+
* -2 推荐升级版本
|
|
31
|
+
* -1 有问题版本
|
|
32
|
+
* 0 不支持
|
|
33
|
+
* 1 支持
|
|
34
|
+
*/
|
|
35
|
+
static checkSupport(): 0 | 1 | -1 | -2;
|
|
36
|
+
static getBrowserVersion(type?: string): number;
|
|
37
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
declare class Capabilities {
|
|
2
|
+
/**
|
|
3
|
+
* @private
|
|
4
|
+
*/
|
|
5
|
+
static $language: string;
|
|
6
|
+
/**
|
|
7
|
+
* @language zh_CN
|
|
8
|
+
* 表示运行内容的系统的语言代码。语言指定为 ISO 639-1 中的小写双字母语言代码。
|
|
9
|
+
* 对于中文,另外使用 ISO 3166 中的大写双字母国家/地区代码,以区分简体中文和繁体中文。<br/>
|
|
10
|
+
* 以下是可能但不限于的语言和值:
|
|
11
|
+
* <ul>
|
|
12
|
+
* <li>简体中文 zh-CN</li>
|
|
13
|
+
* <li>繁体中文 zh-TW</li>
|
|
14
|
+
* <li>英语 en</li>
|
|
15
|
+
* <li>日语 ja</li>
|
|
16
|
+
* <li>韩语 ko</li>
|
|
17
|
+
* </ul>
|
|
18
|
+
*/
|
|
19
|
+
static get language(): string;
|
|
20
|
+
/**
|
|
21
|
+
* @private
|
|
22
|
+
*/
|
|
23
|
+
static $isMobile: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* 表示程序内容是否运行在移动设备中(例如移动电话或平板电脑)。
|
|
26
|
+
*/
|
|
27
|
+
static get isMobile(): boolean;
|
|
28
|
+
static $isWeChat: boolean;
|
|
29
|
+
static get isWeChat(): boolean;
|
|
30
|
+
static $isQQ: boolean;
|
|
31
|
+
static get isQQ(): boolean;
|
|
32
|
+
static $isHuawei: boolean;
|
|
33
|
+
static get isHuawei(): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* @private
|
|
36
|
+
*/
|
|
37
|
+
static $os: string;
|
|
38
|
+
/**
|
|
39
|
+
* @language zh_CN
|
|
40
|
+
* 指示当前的操作系统。os 属性返回下列字符串:
|
|
41
|
+
* <ul>
|
|
42
|
+
* <li>苹果手机操作系统 "iOS"</li>
|
|
43
|
+
* <li>安卓手机操作系统 "Android"</li>
|
|
44
|
+
* <li>微软手机操作系统 "Windows Phone"</li>
|
|
45
|
+
* <li>微软桌面操作系统 "Windows PC"</li>
|
|
46
|
+
* <li>苹果桌面操作系统 "Mac OS"</li>
|
|
47
|
+
* <li>未知操作系统 "Unknown"</li>
|
|
48
|
+
* </ul>
|
|
49
|
+
*/
|
|
50
|
+
static get os(): string;
|
|
51
|
+
static $isIOSSafari: boolean;
|
|
52
|
+
static get isIOSSafari(): boolean;
|
|
53
|
+
}
|
|
54
|
+
export default Capabilities;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { EventBase, LocalEvent } from '../event/event_base';
|
|
2
|
+
export declare const enum FullScreenEventType {
|
|
3
|
+
FullScreenChange = 0,
|
|
4
|
+
FullScreenFailed = 1
|
|
5
|
+
}
|
|
6
|
+
export interface FullScreenEvent extends LocalEvent<FullScreenEventType> {
|
|
7
|
+
isFullScreen: boolean;
|
|
8
|
+
error: any;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* 全屏显示
|
|
12
|
+
*/
|
|
13
|
+
export default class FullScreen extends EventBase<FullScreenEventType, FullScreenEvent> {
|
|
14
|
+
get isFullScreen(): boolean;
|
|
15
|
+
element: HTMLElement;
|
|
16
|
+
private _isFullScreen;
|
|
17
|
+
constructor();
|
|
18
|
+
startListening(): void;
|
|
19
|
+
stopListening(): void;
|
|
20
|
+
private fullscreenChange;
|
|
21
|
+
private fullscreenError;
|
|
22
|
+
launchFullScreen(): void;
|
|
23
|
+
exitFullscreen(): void;
|
|
24
|
+
private createEvent;
|
|
25
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { EventBase, LocalEvent } from '../event/event_base';
|
|
2
|
+
export declare const enum LockPointerEventType {
|
|
3
|
+
LockPointChange = 0,
|
|
4
|
+
LockPointFailed = 1
|
|
5
|
+
}
|
|
6
|
+
export interface LockPointerEvent extends LocalEvent<LockPointerEventType> {
|
|
7
|
+
isLockPointer: boolean;
|
|
8
|
+
error: any;
|
|
9
|
+
}
|
|
10
|
+
export default class LockPointer extends EventBase<LockPointerEventType, LockPointerEvent> {
|
|
11
|
+
get isLockPointer(): boolean;
|
|
12
|
+
private _isLockPointer;
|
|
13
|
+
element: HTMLElement;
|
|
14
|
+
constructor(element: HTMLElement);
|
|
15
|
+
listenLockChange(): void;
|
|
16
|
+
removeListenLockChange(): void;
|
|
17
|
+
lockPointer(): void;
|
|
18
|
+
requestLockPointer(): void;
|
|
19
|
+
exitPointerLock(): void;
|
|
20
|
+
private pointerlockChange;
|
|
21
|
+
private lockscreenFailed;
|
|
22
|
+
private createEvent;
|
|
23
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export declare class Level {
|
|
2
|
+
static INFO: string;
|
|
3
|
+
static WARN: string;
|
|
4
|
+
static ERR: string;
|
|
5
|
+
static TRACE: string;
|
|
6
|
+
static getLevelIndex(level: string): 0 | 2 | 1 | 3 | 4;
|
|
7
|
+
}
|
|
8
|
+
export interface LogObserver {
|
|
9
|
+
onLog(msg: string): void;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
*
|
|
13
|
+
*/
|
|
14
|
+
export default class Log {
|
|
15
|
+
static get logLevel(): string;
|
|
16
|
+
static set logLevel(level: string);
|
|
17
|
+
static _logLevel: string;
|
|
18
|
+
static info(...info: any[]): void;
|
|
19
|
+
static warn(...warn: any[]): void;
|
|
20
|
+
static err(...err: any[]): void;
|
|
21
|
+
static trace(...log: any[]): void;
|
|
22
|
+
static setObserver(ob: LogObserver): void;
|
|
23
|
+
private static _observer;
|
|
24
|
+
private static log;
|
|
25
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export default class ScaleMode {
|
|
2
|
+
/**
|
|
3
|
+
* fit模式,完整的显示内容,如果太大就缩小至合适的大小
|
|
4
|
+
*/
|
|
5
|
+
static FIT_SCREEN: string;
|
|
6
|
+
/**
|
|
7
|
+
* 以视频的宽高为基准缩放
|
|
8
|
+
*/
|
|
9
|
+
static CONTAIN_VIDEO: string;
|
|
10
|
+
/**
|
|
11
|
+
* 以应用原始尺寸的缩放.
|
|
12
|
+
*/
|
|
13
|
+
static CONTAIN_APP: string;
|
|
14
|
+
/**
|
|
15
|
+
* 裁剪模式,完全填充屏幕但保留宽高比
|
|
16
|
+
*/
|
|
17
|
+
static FILL_CLIP: string;
|
|
18
|
+
/**
|
|
19
|
+
* 拉伸模式,完全填充屏幕但不保留宽高比
|
|
20
|
+
*/
|
|
21
|
+
static FILL_STRETCH: string;
|
|
22
|
+
/**
|
|
23
|
+
* offset 控制条的高度
|
|
24
|
+
*/
|
|
25
|
+
static OFFSET: number;
|
|
26
|
+
}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unit 类 常用单元函数
|
|
3
|
+
*/
|
|
4
|
+
import { CSSPosition, Point, ViewPort, OffsetView, Vector } from '../common/interface';
|
|
5
|
+
export default class Unit {
|
|
6
|
+
static queryString(name: string): string;
|
|
7
|
+
static queryURL(uri: URL, name: string): string;
|
|
8
|
+
/**
|
|
9
|
+
* 深度拷贝对象,创建新对象
|
|
10
|
+
* @param source 输入对象
|
|
11
|
+
*/
|
|
12
|
+
static deepCopy(source: any): any;
|
|
13
|
+
static deepCopyArray<T>(source: T[]): T[];
|
|
14
|
+
/**
|
|
15
|
+
* 浏览器窗口大小相关
|
|
16
|
+
*/
|
|
17
|
+
static getElementViewport(element: HTMLElement, baseElementScale?: number): ViewPort;
|
|
18
|
+
/**
|
|
19
|
+
* 获取某元素距离文档的距离
|
|
20
|
+
* @param element 元素对象
|
|
21
|
+
* @returns 高度
|
|
22
|
+
*/
|
|
23
|
+
static elementTop(element: HTMLElement): number;
|
|
24
|
+
/**
|
|
25
|
+
* 获取元素距离文档左侧的距离
|
|
26
|
+
* @param element 元素对象
|
|
27
|
+
* @returns 左侧距离
|
|
28
|
+
*/
|
|
29
|
+
static elementLeft(element: HTMLElement): number;
|
|
30
|
+
static singlePointRelativePosition(e: Touch | MouseEvent, element: HTMLElement): Point;
|
|
31
|
+
/**
|
|
32
|
+
* 获取触摸点相对元素的坐标
|
|
33
|
+
* @param {e} e 触摸回调事件
|
|
34
|
+
* @param offset getOffsetViewport 获取的 offset 对象. {offsetX,offsetY}
|
|
35
|
+
* @return res[] 包含多指操作触摸点的数组
|
|
36
|
+
*/
|
|
37
|
+
static touchRelativePosition(e: any, offset: OffsetView): Array<any>;
|
|
38
|
+
/**
|
|
39
|
+
* 计算两个点之间的距离
|
|
40
|
+
*/
|
|
41
|
+
static pointsDistance(p1: Point, p2: Point): number;
|
|
42
|
+
/**
|
|
43
|
+
* 获取两点间的向量
|
|
44
|
+
* @p1 start point
|
|
45
|
+
* @p2 end point
|
|
46
|
+
*/
|
|
47
|
+
static vector(p1: Point, p2: Point): Vector;
|
|
48
|
+
static vectorModule(v: Vector): number;
|
|
49
|
+
static vectorCosAngle(v1: Vector, v2: Vector): number;
|
|
50
|
+
static vectorDotProduct(v1: Vector, v2: Vector): number;
|
|
51
|
+
static vectorDet(v1: Vector, v2: Vector): number;
|
|
52
|
+
static midpointCoordinate(pointList: Point[]): Point;
|
|
53
|
+
/**
|
|
54
|
+
* 格式化输出时间
|
|
55
|
+
* @param t 输入时间,以秒计算
|
|
56
|
+
* @return 输出时间字符串 aa:bb:cc
|
|
57
|
+
*/
|
|
58
|
+
static formatTimeString(t?: number): string;
|
|
59
|
+
/**
|
|
60
|
+
* 格式化输出时间
|
|
61
|
+
* @param t 输入时间,以分钟计算
|
|
62
|
+
* @return 输出时间字符串 aa:bb:cc
|
|
63
|
+
*/
|
|
64
|
+
static formatMinTimeString(t?: number): string;
|
|
65
|
+
/**
|
|
66
|
+
* get sign
|
|
67
|
+
* -0 ===> -1
|
|
68
|
+
* +0 ===> +1
|
|
69
|
+
* 22 ===> +1
|
|
70
|
+
* -2 ===> -1
|
|
71
|
+
*/
|
|
72
|
+
static sign(num: number): number;
|
|
73
|
+
/**
|
|
74
|
+
* cover css position to point
|
|
75
|
+
*/
|
|
76
|
+
static coverPointToCssPosition(p: Point): CSSPosition;
|
|
77
|
+
/**
|
|
78
|
+
* cover point to css position
|
|
79
|
+
*/
|
|
80
|
+
static coverCssPositionToPoint(p: CSSPosition): Point;
|
|
81
|
+
/**
|
|
82
|
+
* 获取浏览器窗口大小
|
|
83
|
+
* @returns { width: 窗口宽, height: 窗口高 }
|
|
84
|
+
*/
|
|
85
|
+
static getViewport(): {
|
|
86
|
+
width: number;
|
|
87
|
+
height: number;
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* 获取某元素距离文档的距离
|
|
91
|
+
* @param element 元素对象
|
|
92
|
+
* @returns 高度
|
|
93
|
+
*/
|
|
94
|
+
static getElementTop(element: HTMLElement): number;
|
|
95
|
+
/**
|
|
96
|
+
* 获取元素距离文档左侧的距离
|
|
97
|
+
* @param element 元素对象
|
|
98
|
+
* @returns 左侧距离
|
|
99
|
+
*/
|
|
100
|
+
static getElementLeft(element: HTMLElement): number;
|
|
101
|
+
/**
|
|
102
|
+
* 获取元素相对文档位置
|
|
103
|
+
* @param element 元素对象
|
|
104
|
+
* @returns { offsetX:X, offsetY:Y }
|
|
105
|
+
*/
|
|
106
|
+
static getOffsetViewport(element: HTMLElement): {
|
|
107
|
+
offsetX: number;
|
|
108
|
+
offsetY: number;
|
|
109
|
+
};
|
|
110
|
+
static getBoundingClientRect(element: HTMLElement): {
|
|
111
|
+
top: number;
|
|
112
|
+
left: number;
|
|
113
|
+
right: number;
|
|
114
|
+
bottom: number;
|
|
115
|
+
};
|
|
116
|
+
static getBoundingClientRectSize(element: HTMLElement): {
|
|
117
|
+
width: number;
|
|
118
|
+
height: number;
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* 获取鼠标相对元素的坐标
|
|
122
|
+
* @param {*} e 鼠标回调事件
|
|
123
|
+
* @param element dom 元素
|
|
124
|
+
*/
|
|
125
|
+
static getMousePositon(e: MouseEvent, element: HTMLElement): {
|
|
126
|
+
x: number;
|
|
127
|
+
y: number;
|
|
128
|
+
};
|
|
129
|
+
/**
|
|
130
|
+
* 刷新当前页面
|
|
131
|
+
*/
|
|
132
|
+
static fresh(): void;
|
|
133
|
+
static ab2str(buf: ArrayBuffer): string;
|
|
134
|
+
static strToU8Arraybuf(str: string): ArrayBuffer;
|
|
135
|
+
static bytesEqual(buf1: Uint8Array, buf2: Uint8Array): boolean;
|
|
136
|
+
/**
|
|
137
|
+
* 获取手机端相对像素
|
|
138
|
+
* ue图宽度 1340
|
|
139
|
+
*/
|
|
140
|
+
static getMobliePixelWidth(px: number, mobilePixelUnit: number): number;
|
|
141
|
+
static IsIframe(): boolean;
|
|
142
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "larksr_websdk",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.324",
|
|
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
|
@@ -38,6 +38,7 @@ export interface GetTaskResult {
|
|
|
38
38
|
audioInputAutoStart: number;
|
|
39
39
|
videoInput: number;
|
|
40
40
|
videoInputAutoStart: number;
|
|
41
|
+
liveStreaming: number;
|
|
41
42
|
}
|
|
42
43
|
export interface StartAppInfo {
|
|
43
44
|
appliId: string;
|
|
@@ -84,6 +85,8 @@ export default class API {
|
|
|
84
85
|
private static TaskInfoClientStartedPath;
|
|
85
86
|
private static PortMappingListPath;
|
|
86
87
|
private static GetTouchCtrMappingPath;
|
|
88
|
+
private static GetAppliListPath;
|
|
89
|
+
private static RegionListPath;
|
|
87
90
|
static HostAppliGetUrl(params: {
|
|
88
91
|
appliId: string;
|
|
89
92
|
playerMode?: number;
|
|
@@ -122,5 +125,7 @@ export default class API {
|
|
|
122
125
|
static TaskInfoClientStarted(config: ILarkSRConfig, params: AppliParams): void;
|
|
123
126
|
static PortMappingList(config: ILarkSRConfig): Promise<unknown>;
|
|
124
127
|
static GetTouchCtrMapping(server: string, appliId?: string): Promise<unknown>;
|
|
128
|
+
static GetAppliList(server: string, params: any): Promise<unknown>;
|
|
129
|
+
static RegionList(server: string, params: any): Promise<unknown>;
|
|
125
130
|
static joinParam(params: any): string;
|
|
126
131
|
}
|
package/types/appli_params.d.ts
CHANGED
|
@@ -195,6 +195,7 @@ export interface IAppliParams {
|
|
|
195
195
|
audioInputAutoStart: boolean;
|
|
196
196
|
videoInput: boolean;
|
|
197
197
|
videoInputAutoStart: boolean;
|
|
198
|
+
liveStreaming: boolean;
|
|
198
199
|
}
|
|
199
200
|
export declare enum AppliType {
|
|
200
201
|
DESKTOP = 1,
|
|
@@ -259,6 +260,7 @@ export declare class AppliParams implements IAppliParams {
|
|
|
259
260
|
audioInputAutoStart: boolean;
|
|
260
261
|
videoInput: boolean;
|
|
261
262
|
videoInputAutoStart: boolean;
|
|
263
|
+
liveStreaming: boolean;
|
|
262
264
|
static copyAndCreate(params?: IAppliParams): AppliParams;
|
|
263
265
|
static setUpWithSDKConfig(params: IAppliParams, config: ILarkSRConfig): AppliParams;
|
|
264
266
|
}
|
|
@@ -43,7 +43,9 @@ export declare enum APP_EVENT_TYPE {
|
|
|
43
43
|
AI_VOICE_STATUS = 18,
|
|
44
44
|
AI_VOICE_ASR_RESULT = 19,
|
|
45
45
|
AI_VOICE_DM_RESULT = 20,
|
|
46
|
-
AI_VOICE_ERROR = 21
|
|
46
|
+
AI_VOICE_ERROR = 21,
|
|
47
|
+
RTMP_STREAM_STATE = 22,
|
|
48
|
+
RTMP_STREAM_ERROR = 23
|
|
47
49
|
}
|
|
48
50
|
export interface AppEvent extends LocalEvent<APP_EVENT_TYPE> {
|
|
49
51
|
data?: any;
|
|
@@ -114,6 +116,8 @@ export default class Application extends EventBase<APP_EVENT_TYPE, AppEvent> {
|
|
|
114
116
|
private onAudioRemoteStream;
|
|
115
117
|
private onRtcError;
|
|
116
118
|
private onRtcInfo;
|
|
119
|
+
private onRtmpStreamingState;
|
|
120
|
+
private onRtmpStreamingError;
|
|
117
121
|
private onIceStateChange;
|
|
118
122
|
retryPeerconnection(): void;
|
|
119
123
|
setAudioEnable(enable: boolean): void | undefined;
|
|
@@ -151,6 +155,8 @@ export default class Application extends EventBase<APP_EVENT_TYPE, AppEvent> {
|
|
|
151
155
|
addMediaTrack(track: MediaStreamTrack, ...streams: MediaStream[]): boolean | undefined;
|
|
152
156
|
removeMediaTrack(track: RTCRtpSender): boolean | undefined;
|
|
153
157
|
requestUserMediaPermission(constraints?: MediaStreamConstraints): Promise<MediaStream> | undefined;
|
|
158
|
+
StartCloudLiveStreaming(params: Msg.CloudLark.IRtmp_Start): Promise<void> | undefined;
|
|
159
|
+
StopLiveStreaming(): void | undefined;
|
|
154
160
|
private onPeerConnectionDisconnect;
|
|
155
161
|
private onBadNetwork;
|
|
156
162
|
private onPixelStreamingPlayerList;
|
|
@@ -30,7 +30,9 @@ export declare enum WEBRTC_EVENT_TYPE {
|
|
|
30
30
|
AI_VOICE_ASR_RESULT = 19,
|
|
31
31
|
AI_VOICE_DM_RESULT = 20,
|
|
32
32
|
AI_VOICE_ERROR = 21,
|
|
33
|
-
|
|
33
|
+
RTMP_STREAM_STATE = 22,
|
|
34
|
+
RTMP_STREAM_ERROR = 23,
|
|
35
|
+
INFO = 24
|
|
34
36
|
}
|
|
35
37
|
export interface GoogleBitRate {
|
|
36
38
|
start: number;
|
|
@@ -157,6 +159,8 @@ export default class PeerConnection extends EventBase<WEBRTC_EVENT_TYPE, WebRTCE
|
|
|
157
159
|
sendBuffer(buffer: ArrayBuffer): void;
|
|
158
160
|
sendToAppTextMsg(msg: string): void;
|
|
159
161
|
sendToAppBinaryMsg(binary: Uint8Array): void;
|
|
162
|
+
StartCloudLiveStreaming(params: Input.CloudLark.IRtmp_Start): Promise<void>;
|
|
163
|
+
StopLiveStreaming(): void;
|
|
160
164
|
changeOperater(uid: number): void;
|
|
161
165
|
inputText(txt: string): void;
|
|
162
166
|
private getStats;
|
package/types/larksr.d.ts
CHANGED
|
@@ -185,7 +185,17 @@ declare enum LarkSRClientEvent {
|
|
|
185
185
|
* 服务端 3.2.7.0 添加
|
|
186
186
|
*
|
|
187
187
|
*/
|
|
188
|
-
TOUCH_CTR_MAPPING = "touchctrmapping"
|
|
188
|
+
TOUCH_CTR_MAPPING = "touchctrmapping",
|
|
189
|
+
/**
|
|
190
|
+
* 服务端 3.2.7.0 添加
|
|
191
|
+
* rtmp 直播推流状态
|
|
192
|
+
*/
|
|
193
|
+
RTMP_STREAM_STATE = "rtmpstreamstate",
|
|
194
|
+
/**
|
|
195
|
+
* 服务端 3.2.7.0 添加
|
|
196
|
+
* rtmp 直播推流出错
|
|
197
|
+
*/
|
|
198
|
+
RTMP_STREAM_ERROR = "rtmpstreamerror"
|
|
189
199
|
}
|
|
190
200
|
/**
|
|
191
201
|
* LarkSR 发出的事件
|
|
@@ -908,6 +918,40 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
|
|
|
908
918
|
addMediaTrack(track: MediaStreamTrack, ...streams: MediaStream[]): boolean | undefined;
|
|
909
919
|
removeMediaTrack(track: RTCRtpSender): boolean | undefined;
|
|
910
920
|
requestUserMediaPermission(constraints?: MediaStreamConstraints): Promise<MediaStream> | undefined;
|
|
921
|
+
/**
|
|
922
|
+
* 启动云端推流功能
|
|
923
|
+
* @param params {
|
|
924
|
+
* // rtmp push url 必须填
|
|
925
|
+
* path: "",
|
|
926
|
+
* //rtmp push key
|
|
927
|
+
* key: "",
|
|
928
|
+
* // 推流的宽
|
|
929
|
+
* width: 1280,
|
|
930
|
+
* // 推流的高
|
|
931
|
+
* height: 720,
|
|
932
|
+
* framerate: 30,
|
|
933
|
+
* // kbps
|
|
934
|
+
* bitrate: 1024 * 2,
|
|
935
|
+
* // 是否支持断线重连
|
|
936
|
+
* reconnect: true,
|
|
937
|
+
* //最大重连次数
|
|
938
|
+
* reconnectRetries: 3,
|
|
939
|
+
* //是否串流麦克风(语音输入支持的情况)
|
|
940
|
+
* voice: audioInput,
|
|
941
|
+
* }
|
|
942
|
+
* @returns Promise
|
|
943
|
+
*/
|
|
944
|
+
StartCloudLiveStreaming(params: CloudLark.IRtmp_Start): Promise<void> | undefined;
|
|
945
|
+
/**
|
|
946
|
+
* 关闭云端推流功能
|
|
947
|
+
* @returns
|
|
948
|
+
*/
|
|
949
|
+
StopLiveStreaming(): void | undefined;
|
|
950
|
+
/**
|
|
951
|
+
* 获取当前服务器应用手柄配置
|
|
952
|
+
* @param appliId 应用id,传空为当前应用
|
|
953
|
+
* @returns
|
|
954
|
+
*/
|
|
911
955
|
getTouchCtrMapping(appliId?: string): Promise<unknown>;
|
|
912
956
|
$emit(type: LarkEventType, data?: any, message?: string): void;
|
|
913
957
|
$emitError(message?: string, code?: number): void;
|