larksr_websdk 3.2.0
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 +31 -0
- package/dist/larksr-web-sdk.min.js +15 -0
- package/dist/larksr-web-sdk.min.worker.js +1 -0
- package/dist/types/api.d.ts +85 -0
- package/dist/types/appli_params.d.ts +244 -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/bus.d.ts +8 -0
- package/dist/types/event/event_base.d.ts +14 -0
- package/dist/types/event/events.d.ts +126 -0
- package/dist/types/event/iframe_poster.d.ts +9 -0
- package/dist/types/event/message.d.ts +69 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/lark/Worker.d.ts +3 -0
- package/dist/types/lark/application.d.ts +102 -0
- package/dist/types/lark/custom.d.ts +7 -0
- package/dist/types/lark/lark_event_type.d.ts +109 -0
- package/dist/types/lark/message.d.ts +19 -0
- package/dist/types/lark/peer_connection.d.ts +113 -0
- package/dist/types/lark/sdp_util.d.ts +36 -0
- package/dist/types/lark/websocket_channel.d.ts +57 -0
- package/dist/types/lark/websocket_proxy.d.ts +57 -0
- package/dist/types/larksr.d.ts +138 -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 +70 -0
- package/dist/types/operation/gesture_handler.d.ts +13 -0
- package/dist/types/operation/handler_base.d.ts +8 -0
- package/dist/types/operation/keyboard_handler.d.ts +15 -0
- package/dist/types/operation/keymap.d.ts +20 -0
- package/dist/types/operation/letter_keymap.d.ts +8 -0
- package/dist/types/operation/mouse_handler.d.ts +40 -0
- package/dist/types/operation/num_keymap.d.ts +12 -0
- package/dist/types/operation/operation.d.ts +58 -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 +5944 -0
- package/dist/types/protobuf/message.d.ts +528 -0
- package/dist/types/screen_state.d.ts +108 -0
- package/dist/types/sdk_auth.d.ts +11 -0
- package/dist/types/utils/browser_type.d.ts +37 -0
- package/dist/types/utils/capabilities.d.ts +48 -0
- package/dist/types/utils/full_screen.d.ts +25 -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 +20 -0
- package/dist/types/utils/unit.d.ts +152 -0
- package/package.json +61 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(){"use strict";const e=self;var s=!1,t=0;e.addEventListener("message",(a=>{switch(a.data){case"start":s||(s=!0,t=setInterval((()=>{e.postMessage("tick")}),1e4));break;case"stop":clearInterval(t),s=!1}}),!1)}();
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { ILarkSRConfig } from './larksr';
|
|
2
|
+
import { AppliParams } from './appli_params';
|
|
3
|
+
export interface UTLockInfo {
|
|
4
|
+
checkUtLockMessage: string;
|
|
5
|
+
checkUtLockResult: boolean;
|
|
6
|
+
remainMinutes: number;
|
|
7
|
+
}
|
|
8
|
+
export interface GetTaskResult {
|
|
9
|
+
adminViewer: number;
|
|
10
|
+
appKey: string;
|
|
11
|
+
appliId: string;
|
|
12
|
+
appliType: number;
|
|
13
|
+
city: string;
|
|
14
|
+
clientIp: string;
|
|
15
|
+
country: string;
|
|
16
|
+
createDate: string;
|
|
17
|
+
dcs: number;
|
|
18
|
+
limitMaxFps: number;
|
|
19
|
+
offScreen: number;
|
|
20
|
+
playerListToggle: number;
|
|
21
|
+
playerMode: number;
|
|
22
|
+
province: string;
|
|
23
|
+
publicIp: string;
|
|
24
|
+
reserveFlag: number;
|
|
25
|
+
serverId: string;
|
|
26
|
+
serverIp: string;
|
|
27
|
+
shareUrl: string;
|
|
28
|
+
startAt: string;
|
|
29
|
+
startParam: string;
|
|
30
|
+
startProcType: number;
|
|
31
|
+
status: number;
|
|
32
|
+
taskId: string;
|
|
33
|
+
updateDate: string;
|
|
34
|
+
useGamepad: number;
|
|
35
|
+
wm: number;
|
|
36
|
+
}
|
|
37
|
+
export interface StartAppInfo {
|
|
38
|
+
appliId: string;
|
|
39
|
+
taskId: string;
|
|
40
|
+
renderServerIp: string;
|
|
41
|
+
wsProxy: string;
|
|
42
|
+
preferPublicIp: string;
|
|
43
|
+
renderServerPort: number;
|
|
44
|
+
initCursorMode: number;
|
|
45
|
+
rttLimit: string;
|
|
46
|
+
touchOperateMode: string;
|
|
47
|
+
fullScreenMode: number;
|
|
48
|
+
mobileForceLandscape: number;
|
|
49
|
+
mobileFullScreenMode: number;
|
|
50
|
+
language: string;
|
|
51
|
+
noOperationTimeout: string;
|
|
52
|
+
serverId: string;
|
|
53
|
+
network: string;
|
|
54
|
+
playerListToggle: number;
|
|
55
|
+
bgColor: string;
|
|
56
|
+
logLevel: string;
|
|
57
|
+
mobileVirtualJoystick: number;
|
|
58
|
+
initWinSize: number;
|
|
59
|
+
taskStatus: number;
|
|
60
|
+
mouseZoomDirection: number;
|
|
61
|
+
useGamepad: number;
|
|
62
|
+
rttLimitInterval: string;
|
|
63
|
+
playerMode?: number;
|
|
64
|
+
userType?: number;
|
|
65
|
+
roomCode?: string;
|
|
66
|
+
nickname?: string;
|
|
67
|
+
}
|
|
68
|
+
export default class API {
|
|
69
|
+
static CheckUTLockInfoPath: string;
|
|
70
|
+
static GetTaskPATH: string;
|
|
71
|
+
static ClientLogErrorPath: string;
|
|
72
|
+
static GetStartInfoPath: string;
|
|
73
|
+
static GetStartInfo(serverAddress: string, params: {
|
|
74
|
+
appliId: string;
|
|
75
|
+
playerMode?: number;
|
|
76
|
+
userType?: number;
|
|
77
|
+
roomCode?: string;
|
|
78
|
+
taskId?: string;
|
|
79
|
+
}): Promise<StartAppInfo>;
|
|
80
|
+
static CheckUTLockInfo(config: ILarkSRConfig): Promise<UTLockInfo>;
|
|
81
|
+
static GetTask(config: ILarkSRConfig, taskid: string): Promise<GetTaskResult>;
|
|
82
|
+
static LogError(errorCode: number, errorMsg: string, params: string, config: ILarkSRConfig): void;
|
|
83
|
+
static ClientInfo(config: ILarkSRConfig, params: AppliParams): void;
|
|
84
|
+
static joinParam(params: any): string;
|
|
85
|
+
}
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
import ScaleMode from './utils/scale_mode';
|
|
2
|
+
import { StartAppInfo } from './api';
|
|
3
|
+
export interface IAppliParams {
|
|
4
|
+
/**
|
|
5
|
+
* appserver 的ip地址
|
|
6
|
+
*/
|
|
7
|
+
appServer: string;
|
|
8
|
+
/**
|
|
9
|
+
* appserver 的端口号
|
|
10
|
+
*/
|
|
11
|
+
appPort: string;
|
|
12
|
+
/**
|
|
13
|
+
* 是否使用 websocket 代理
|
|
14
|
+
*/
|
|
15
|
+
wsProxy: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* 优先使用的外网ip. 用在webrtc ice处替换为高优先级的ip
|
|
18
|
+
*/
|
|
19
|
+
preferPubOutIp: string;
|
|
20
|
+
/**
|
|
21
|
+
* taskid
|
|
22
|
+
*/
|
|
23
|
+
taskid: string;
|
|
24
|
+
/**
|
|
25
|
+
* 当前应用名称
|
|
26
|
+
*/
|
|
27
|
+
courseName: string;
|
|
28
|
+
/**
|
|
29
|
+
* @deprecated
|
|
30
|
+
* 应用的宽高。现在云端自动获取宽高
|
|
31
|
+
*/
|
|
32
|
+
width: number;
|
|
33
|
+
/**
|
|
34
|
+
* @deprecated
|
|
35
|
+
* 应用的宽高。现在云端自动获取宽高
|
|
36
|
+
*/
|
|
37
|
+
height: number;
|
|
38
|
+
/**
|
|
39
|
+
* 缩放模式
|
|
40
|
+
*/
|
|
41
|
+
scaleMode: ScaleMode;
|
|
42
|
+
/**
|
|
43
|
+
* 日志级别
|
|
44
|
+
* @default 'info'
|
|
45
|
+
*/
|
|
46
|
+
logLevel: 'info' | 'warn' | 'error';
|
|
47
|
+
/**
|
|
48
|
+
* 无操作时间。超时断开连接.
|
|
49
|
+
*/
|
|
50
|
+
noOperationTimeout: number;
|
|
51
|
+
/**
|
|
52
|
+
* 是否显示右下角的水印。
|
|
53
|
+
*/
|
|
54
|
+
waterMark: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* 检测的rtt值,rtt超过该值将提示用户网络环境差
|
|
57
|
+
*/
|
|
58
|
+
rttLimit: number;
|
|
59
|
+
/**
|
|
60
|
+
* 检测的丢包率。丢包率超过该值提示用户网络环境差
|
|
61
|
+
*/
|
|
62
|
+
packetLostLimit: number;
|
|
63
|
+
/**
|
|
64
|
+
* 丢包率和rtt提示的时间间隔。
|
|
65
|
+
*/
|
|
66
|
+
rttLimitInterval: number;
|
|
67
|
+
/**
|
|
68
|
+
* 码率. 用在在创建 webrtc sdp时替换为此码率。
|
|
69
|
+
*/
|
|
70
|
+
codeRate: number;
|
|
71
|
+
/**
|
|
72
|
+
* audio code rate
|
|
73
|
+
* https://stackoverflow.com/questions/33649283/how-to-set-up-sdp-for-high-quality-opus-audio
|
|
74
|
+
* a=fmtp:111 minptime=10;useinbandfec=1; stereo=1; maxaveragebitrate=510000
|
|
75
|
+
*/
|
|
76
|
+
audioCodeRate: number;
|
|
77
|
+
/**
|
|
78
|
+
* 帧率,在登录task时传给后端。
|
|
79
|
+
*/
|
|
80
|
+
frameRate: number;
|
|
81
|
+
/**
|
|
82
|
+
* 网络状态,影响 webrtc offer 创建时最低码率。
|
|
83
|
+
*/
|
|
84
|
+
network: 'local' | 'public';
|
|
85
|
+
/**
|
|
86
|
+
* 使用的语言,目前只支持英语和中文。
|
|
87
|
+
*/
|
|
88
|
+
language: string;
|
|
89
|
+
/**
|
|
90
|
+
* 初始的鼠标锁定模式
|
|
91
|
+
* false:非锁定模式
|
|
92
|
+
* true:锁定模式
|
|
93
|
+
*/
|
|
94
|
+
initCursorMode: boolean;
|
|
95
|
+
/**
|
|
96
|
+
* 背景颜色
|
|
97
|
+
*/
|
|
98
|
+
bgColor: string;
|
|
99
|
+
/**
|
|
100
|
+
* 全屏模式
|
|
101
|
+
* 0 -》 用户手动触发
|
|
102
|
+
* 1 -》 首次点击进入触发
|
|
103
|
+
* 2 -》 每次点击触发
|
|
104
|
+
*/
|
|
105
|
+
fullScreenMode: number;
|
|
106
|
+
/**
|
|
107
|
+
* 手机端全屏模式
|
|
108
|
+
* 0 -》 用户手动触发
|
|
109
|
+
* 1 -》 首次点击进入触发
|
|
110
|
+
* 2 -》 每次点击触发
|
|
111
|
+
*/
|
|
112
|
+
mobileFullScreenMode: number;
|
|
113
|
+
/**
|
|
114
|
+
* 一人操作多人看 0 普通模式 1 交互模式(可以一人操作多人看)
|
|
115
|
+
* 2 多人互动模式,鼠标键盘都放开
|
|
116
|
+
*/
|
|
117
|
+
playerMode: number;
|
|
118
|
+
/**
|
|
119
|
+
* 用户类型 number
|
|
120
|
+
* 所有者:1 观察者:0;
|
|
121
|
+
*/
|
|
122
|
+
userType: number;
|
|
123
|
+
/**
|
|
124
|
+
* 用户昵称
|
|
125
|
+
*/
|
|
126
|
+
nickname: string;
|
|
127
|
+
/**
|
|
128
|
+
* 口令:8位唯一码,写入TaskInfo. 房间code,备用。
|
|
129
|
+
*/
|
|
130
|
+
roomCode: number;
|
|
131
|
+
/**
|
|
132
|
+
* debug task. 跳过task检测
|
|
133
|
+
*/
|
|
134
|
+
debugTask: boolean;
|
|
135
|
+
/**
|
|
136
|
+
* debug webserver
|
|
137
|
+
*/
|
|
138
|
+
debugWebServer: string;
|
|
139
|
+
/**
|
|
140
|
+
* laoding timeout
|
|
141
|
+
* 5 * 60
|
|
142
|
+
*/
|
|
143
|
+
loadingTimeout: number;
|
|
144
|
+
/**
|
|
145
|
+
* share url
|
|
146
|
+
*/
|
|
147
|
+
shareUrl: boolean;
|
|
148
|
+
/**
|
|
149
|
+
* 是否强制横屏
|
|
150
|
+
*/
|
|
151
|
+
mobileForceLandscape: boolean;
|
|
152
|
+
/**
|
|
153
|
+
* 移动端初始化初始化是否显示手柄
|
|
154
|
+
*/
|
|
155
|
+
mobileVirtualJoystick: boolean;
|
|
156
|
+
/**
|
|
157
|
+
* mouseZoomDirection
|
|
158
|
+
* 用于移动端捏合缩放操作与应用鼠标缩放的对应关系
|
|
159
|
+
* 1:鼠标滚轮向上为放大,
|
|
160
|
+
* 0:鼠标滚轮向下为放大(default)
|
|
161
|
+
*/
|
|
162
|
+
mouseZoomDirection: number;
|
|
163
|
+
/**
|
|
164
|
+
* 初始是否显示玩家列表
|
|
165
|
+
*/
|
|
166
|
+
showPlayerList: boolean;
|
|
167
|
+
/**
|
|
168
|
+
* 优先使用的解码器
|
|
169
|
+
*/
|
|
170
|
+
perferDecoder: 'auto' | 'vp8' | 'vp9' | 'h264' | 'av1x';
|
|
171
|
+
/**
|
|
172
|
+
* 触摸操作对应的操作方式,触摸屏还是鼠标
|
|
173
|
+
*/
|
|
174
|
+
touchOperateMode: 'touchScreen' | 'mouse';
|
|
175
|
+
/**
|
|
176
|
+
* appid
|
|
177
|
+
*/
|
|
178
|
+
appliId: string;
|
|
179
|
+
/**
|
|
180
|
+
*
|
|
181
|
+
*/
|
|
182
|
+
syncLocalToCloudClipboard: boolean;
|
|
183
|
+
enableRttIcon: boolean;
|
|
184
|
+
enableSoundRequire: boolean;
|
|
185
|
+
toastLevel: number;
|
|
186
|
+
}
|
|
187
|
+
export declare class AppliParams implements IAppliParams {
|
|
188
|
+
appServer: string;
|
|
189
|
+
appPort: string;
|
|
190
|
+
wsProxy: boolean;
|
|
191
|
+
preferPubOutIp: string;
|
|
192
|
+
taskid: string;
|
|
193
|
+
courseName: string;
|
|
194
|
+
width: number;
|
|
195
|
+
height: number;
|
|
196
|
+
scaleMode: ScaleMode;
|
|
197
|
+
logLevel: 'info' | 'warn' | 'error';
|
|
198
|
+
noOperationTimeout: number;
|
|
199
|
+
waterMark: boolean;
|
|
200
|
+
rttLimit: number;
|
|
201
|
+
packetLostLimit: number;
|
|
202
|
+
rttLimitInterval: number;
|
|
203
|
+
codeRate: number;
|
|
204
|
+
audioCodeRate: number;
|
|
205
|
+
frameRate: number;
|
|
206
|
+
network: 'local' | 'public';
|
|
207
|
+
language: string;
|
|
208
|
+
initCursorMode: boolean;
|
|
209
|
+
bgColor: string;
|
|
210
|
+
fullScreenMode: number;
|
|
211
|
+
mobileFullScreenMode: number;
|
|
212
|
+
playerMode: number;
|
|
213
|
+
userType: number;
|
|
214
|
+
nickname: string;
|
|
215
|
+
roomCode: number;
|
|
216
|
+
debugTask: boolean;
|
|
217
|
+
debugWebServer: string;
|
|
218
|
+
loadingTimeout: number;
|
|
219
|
+
shareUrl: boolean;
|
|
220
|
+
mobileForceLandscape: boolean;
|
|
221
|
+
mobileVirtualJoystick: boolean;
|
|
222
|
+
mouseZoomDirection: number;
|
|
223
|
+
showPlayerList: boolean;
|
|
224
|
+
perferDecoder: 'auto' | 'vp8' | 'vp9' | 'h264' | 'av1x';
|
|
225
|
+
touchOperateMode: 'touchScreen' | 'mouse';
|
|
226
|
+
appliId: string;
|
|
227
|
+
syncLocalToCloudClipboard: boolean;
|
|
228
|
+
enableRttIcon: boolean;
|
|
229
|
+
enableSoundRequire: boolean;
|
|
230
|
+
toastLevel: number;
|
|
231
|
+
}
|
|
232
|
+
export declare function CreateAppliParams(): IAppliParams;
|
|
233
|
+
export declare class AppliParamsUtils {
|
|
234
|
+
static getScaleMode(init: number | null | undefined): string;
|
|
235
|
+
static getNetwork(init: number | null | undefined): 'local' | 'public';
|
|
236
|
+
static getLogLevel(level: string | null | undefined): 'info' | 'warn';
|
|
237
|
+
static getBoolOption(option: string | null | undefined | boolean, emptyValue?: boolean): boolean;
|
|
238
|
+
static getNumberBoolOption(option: string | null | undefined | number, emptyValue?: boolean): boolean;
|
|
239
|
+
static getStringOption(option: string | null | undefined, emptyValue?: string): string;
|
|
240
|
+
static getIntOption(option: string | null | undefined, emptyValue?: number): number;
|
|
241
|
+
static getBgColor(option: string | null | undefined): string;
|
|
242
|
+
}
|
|
243
|
+
export declare function LoadAppliParamsFromUrl(): IAppliParams;
|
|
244
|
+
export declare function LoadAppliParamsStartAppInfo(startAppInfo: StartAppInfo): IAppliParams;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
declare const enum CMD {
|
|
2
|
+
SESSIONKEY = 1,
|
|
3
|
+
APPSTART = 2,
|
|
4
|
+
VIDEO = 3,
|
|
5
|
+
MOUSE_DOWN = 4,
|
|
6
|
+
MOUSE_UP = 5,
|
|
7
|
+
MOUSE_MOVE = 6,
|
|
8
|
+
KEY_DOWN = 7,
|
|
9
|
+
KEY_UP = 8,
|
|
10
|
+
KEY_PRESS = 9,
|
|
11
|
+
CONNECT_APP_SERVER = 10,
|
|
12
|
+
APP_SERVER_CONNECTED = 11,
|
|
13
|
+
APP_SERVER_CONNECT_FAILED = 12,
|
|
14
|
+
CONNECT_ALREADY_EXIST = 13,
|
|
15
|
+
MOUSE_RIGHT = 14,
|
|
16
|
+
MOUSE_WHEELE = 15,
|
|
17
|
+
WEBRTC_GETICESERVER = 16,
|
|
18
|
+
WEBRTC_GET_REMOTE_ICECANDIDATE = 17,
|
|
19
|
+
WEBRTC_CALL = 18,
|
|
20
|
+
WEBRTC_ADD_ICECANDIDATE = 19,
|
|
21
|
+
WEBRTC_HANGUP = 20,
|
|
22
|
+
WEBRTC_GETDEVICELIST = 21,
|
|
23
|
+
REMOTE_APP_CLOSE = 22,
|
|
24
|
+
MOUSE_BUTTON = 23,
|
|
25
|
+
KEEP_ALIVE = 24,
|
|
26
|
+
REMOTE_APP_COUSOR_CHANGE = 25
|
|
27
|
+
}
|
|
28
|
+
export default CMD;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const VIDEO_ID = "video";
|
|
2
|
+
export declare const IMAGE_CURSOR_ID = "cursorid";
|
|
3
|
+
export declare const EMPTY_PNG = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjbQg61aAAAADUlEQVQYV2P4//8/IwAI/QL/+TZZdwAAAABJRU5ErkJggg==";
|
|
4
|
+
export declare const TOKEN_EXPIRED = "TOKEN_EXPIRED";
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export interface Point {
|
|
2
|
+
x: number;
|
|
3
|
+
y: number;
|
|
4
|
+
}
|
|
5
|
+
export interface Vector {
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
8
|
+
startPoint: Point;
|
|
9
|
+
endPoint: Point;
|
|
10
|
+
}
|
|
11
|
+
export interface Stage {
|
|
12
|
+
width: number;
|
|
13
|
+
height: number;
|
|
14
|
+
Position: Point;
|
|
15
|
+
}
|
|
16
|
+
export interface CSSPosition {
|
|
17
|
+
top: number;
|
|
18
|
+
left: number;
|
|
19
|
+
}
|
|
20
|
+
export interface ViewPort {
|
|
21
|
+
width: number;
|
|
22
|
+
height: number;
|
|
23
|
+
}
|
|
24
|
+
export interface Toggle {
|
|
25
|
+
show: boolean;
|
|
26
|
+
}
|
|
27
|
+
export interface OffsetView {
|
|
28
|
+
offsetX: number;
|
|
29
|
+
offsetY: number;
|
|
30
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import ScaleModel from './utils/scale_mode';
|
|
2
|
+
export default class Config {
|
|
3
|
+
static BuildType: 'local' | 'public';
|
|
4
|
+
static LocalHomepagePath: string;
|
|
5
|
+
/**
|
|
6
|
+
*/
|
|
7
|
+
static VersionMarjor: number;
|
|
8
|
+
static VersionMinorr: number;
|
|
9
|
+
static VersionRevise: number;
|
|
10
|
+
static VersionBuild: number;
|
|
11
|
+
/**
|
|
12
|
+
* webrtc 断开连接重试次数
|
|
13
|
+
*/
|
|
14
|
+
static RetryTime: number;
|
|
15
|
+
/**
|
|
16
|
+
* design width/height
|
|
17
|
+
* TODO reset with 0. check with render server.
|
|
18
|
+
*/
|
|
19
|
+
static OriginW: number;
|
|
20
|
+
static OriginH: number;
|
|
21
|
+
/**
|
|
22
|
+
* 默认码率从应用服务器接收码率
|
|
23
|
+
*/
|
|
24
|
+
static CodeRate: number;
|
|
25
|
+
static AudioCodeRate: number;
|
|
26
|
+
static FrameRate: number;
|
|
27
|
+
/**
|
|
28
|
+
* default scale mode. 以应用原始尺寸的缩放
|
|
29
|
+
*/
|
|
30
|
+
static ScaleMode: ScaleModel;
|
|
31
|
+
/**
|
|
32
|
+
* default net work.
|
|
33
|
+
*/
|
|
34
|
+
static Network: 'local' | 'public';
|
|
35
|
+
/**
|
|
36
|
+
* 鼠标模式
|
|
37
|
+
* 0 == 相对
|
|
38
|
+
* 1 == 绝对
|
|
39
|
+
*/
|
|
40
|
+
static MouseMode: number;
|
|
41
|
+
/**
|
|
42
|
+
* replace server ip for aws
|
|
43
|
+
*/
|
|
44
|
+
static ForceIceAddr: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* 禁用 VPX
|
|
47
|
+
*/
|
|
48
|
+
static DisableVPX: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* 是否启用相对鼠标移动虚拟摇杆
|
|
51
|
+
*/
|
|
52
|
+
static RelativeMouseMove: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* 虚拟摇杆精度
|
|
55
|
+
*/
|
|
56
|
+
static VirtualRackerScale: number;
|
|
57
|
+
static ErrChromeAndroidVersion: string[];
|
|
58
|
+
static DownloadChromium: string;
|
|
59
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { EventBase, LocalEvent } from './event_base';
|
|
2
|
+
import GLOBAL_EVENT_TYPE from './events';
|
|
3
|
+
interface GlobalEvent extends LocalEvent<GLOBAL_EVENT_TYPE> {
|
|
4
|
+
}
|
|
5
|
+
declare class Global extends EventBase<GLOBAL_EVENT_TYPE, GlobalEvent> {
|
|
6
|
+
}
|
|
7
|
+
declare const Bus: Global;
|
|
8
|
+
export default Bus;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TODO
|
|
3
|
+
*/
|
|
4
|
+
export interface LocalEvent<E> {
|
|
5
|
+
type: E;
|
|
6
|
+
target?: any;
|
|
7
|
+
}
|
|
8
|
+
export declare type Callback<E> = (e: E, ...params: any[]) => void;
|
|
9
|
+
export declare abstract class EventBase<T, E extends LocalEvent<T>> {
|
|
10
|
+
private listeners;
|
|
11
|
+
on(type: T, callback: Callback<E>, self?: any): void;
|
|
12
|
+
off(type: T, callback: Callback<E>, self?: any): void;
|
|
13
|
+
emit(event: E, ...params: any[]): void;
|
|
14
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { LocalEvent } from './event_base';
|
|
2
|
+
export declare enum GLOBAL_EVENT_TYPE {
|
|
3
|
+
/**
|
|
4
|
+
* video 元素已挂载
|
|
5
|
+
*/
|
|
6
|
+
MOUNTED = 1,
|
|
7
|
+
/**
|
|
8
|
+
* 打开 socket
|
|
9
|
+
*/
|
|
10
|
+
SOCKET_OPEN = 2,
|
|
11
|
+
/**
|
|
12
|
+
* 消息窗口
|
|
13
|
+
*/
|
|
14
|
+
ALERT = 3,
|
|
15
|
+
/**
|
|
16
|
+
* 获取远程视频流
|
|
17
|
+
*/
|
|
18
|
+
GOT_REMOTE_STREAM = 4,
|
|
19
|
+
/**
|
|
20
|
+
* 视频流加载成功
|
|
21
|
+
*/
|
|
22
|
+
LOADEDMETADATA = 5,
|
|
23
|
+
/**
|
|
24
|
+
* 重设config
|
|
25
|
+
*/
|
|
26
|
+
RECONFIG = 6,
|
|
27
|
+
/**
|
|
28
|
+
* 开始点对点连接
|
|
29
|
+
*/
|
|
30
|
+
STARTPC = 7,
|
|
31
|
+
/**
|
|
32
|
+
* 连接失败
|
|
33
|
+
*/
|
|
34
|
+
PC_FAILED = 8,
|
|
35
|
+
/**
|
|
36
|
+
* 结束点对点连接
|
|
37
|
+
*/
|
|
38
|
+
STOPPC = 9,
|
|
39
|
+
/**
|
|
40
|
+
* 结束点对点连接
|
|
41
|
+
*/
|
|
42
|
+
RTSP_SUCCESS = 10,
|
|
43
|
+
/**
|
|
44
|
+
* 刷新连接
|
|
45
|
+
*/
|
|
46
|
+
REFRESH = 11,
|
|
47
|
+
/**
|
|
48
|
+
* 开始计时
|
|
49
|
+
*/
|
|
50
|
+
START_TIMER = 12,
|
|
51
|
+
/**
|
|
52
|
+
* 计时结束 结束应用
|
|
53
|
+
*/
|
|
54
|
+
COURSE_OVER = 13,
|
|
55
|
+
/**
|
|
56
|
+
* 退出
|
|
57
|
+
*/
|
|
58
|
+
QUIT = 14,
|
|
59
|
+
/**
|
|
60
|
+
* 虚拟按键按下事件
|
|
61
|
+
*/
|
|
62
|
+
VIRTUAL_KEY_DOWN = 15,
|
|
63
|
+
/**
|
|
64
|
+
* 虚拟按键抬起
|
|
65
|
+
*/
|
|
66
|
+
VIRTUAL_KEY_UP = 16,
|
|
67
|
+
/**
|
|
68
|
+
* 摇杆事件
|
|
69
|
+
*/
|
|
70
|
+
JOY_STICK_MOUSE_MOVE = 17,
|
|
71
|
+
/**
|
|
72
|
+
* 虚拟鼠标移动
|
|
73
|
+
*/
|
|
74
|
+
VIRTUAL_MOUSE_MOVE = 18,
|
|
75
|
+
/**
|
|
76
|
+
* 虚拟鼠标触摸点移动
|
|
77
|
+
*/
|
|
78
|
+
VIRTUAL_MOUSE_POINTER = 19,
|
|
79
|
+
/**
|
|
80
|
+
*
|
|
81
|
+
*/
|
|
82
|
+
VIRTUAL_MOUSE_DOWN = 20,
|
|
83
|
+
/**
|
|
84
|
+
*
|
|
85
|
+
*/
|
|
86
|
+
VIRTUAL_MOUSE_UP = 21,
|
|
87
|
+
/**
|
|
88
|
+
* 虚拟滚轮滚动
|
|
89
|
+
*/
|
|
90
|
+
VIRTUAL_MOUSE_WHEEL = 22,
|
|
91
|
+
/***
|
|
92
|
+
* pc鼠标事件转发
|
|
93
|
+
*/
|
|
94
|
+
MOUSE_MOVE = 23,
|
|
95
|
+
MOUSE_WHEEL = 24,
|
|
96
|
+
MOUSE_DOWN = 25,
|
|
97
|
+
MOUSE_UP = 26,
|
|
98
|
+
/**
|
|
99
|
+
* 鼠标指针移动
|
|
100
|
+
*/
|
|
101
|
+
CURSOR_MOVE = 27,
|
|
102
|
+
/**
|
|
103
|
+
* 鼠标变化
|
|
104
|
+
*/
|
|
105
|
+
APP_CURSOR_CHANGE = 28,
|
|
106
|
+
FULL_SCREEN_CHANGE = 29,
|
|
107
|
+
REMOTE_SCREEN_READY = 30,
|
|
108
|
+
DISPATCH_CONTROLLER = 31,
|
|
109
|
+
LK_RE_CONNECT_DATA_CHANNEL = 32,
|
|
110
|
+
LK_CLOSE_DATA_CHANNEL = 33,
|
|
111
|
+
LK_DATA_CHANNEL_SEND_TEXT = 34,
|
|
112
|
+
LK_DATA_CHANNEL_SEND_BINARY = 35,
|
|
113
|
+
LK_DATA_CHANNEL_SEND_VIEW_PORT = 36,
|
|
114
|
+
LK_DATA_CHANNEL_SEND_CLIENT_INFO = 37,
|
|
115
|
+
LK_DATA_CHANNEL_RENDERSERVER_SEND_TEXT = 38,
|
|
116
|
+
LK_DATA_CHANNEL_RENDERSERVER_SEND_BINARY = 39,
|
|
117
|
+
INPUT_TEXT = 40,
|
|
118
|
+
SET_VOLUME = 41,
|
|
119
|
+
LK_IFRAME_POSTER_FUNC_RESTART_CLOUD_APP = 42,
|
|
120
|
+
LK_IFRAME_POSTER_FUNC_WX_JS_BRIDGE_READY = 43,
|
|
121
|
+
LK_REQUEST_CAPTURE_FRAME = 44,
|
|
122
|
+
LK_REQUEST_CAPTURE_FRAME_WITH_EXTRA_DATA = 45
|
|
123
|
+
}
|
|
124
|
+
export declare type GlobalEvent = LocalEvent<GLOBAL_EVENT_TYPE>;
|
|
125
|
+
export declare function createGlobalEvent(type: GLOBAL_EVENT_TYPE, target?: any): GlobalEvent;
|
|
126
|
+
export default GLOBAL_EVENT_TYPE;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { LarkEventType } from '../lark/lark_event_type';
|
|
2
|
+
import { LarkSR } from '../larksr';
|
|
3
|
+
export declare const PREX = "pxymessage";
|
|
4
|
+
export declare const LOG_ERROR_EVENT_TYPE: LarkEventType[];
|
|
5
|
+
export default class IframeHandler {
|
|
6
|
+
larksr: LarkSR;
|
|
7
|
+
constructor(larksr: LarkSR);
|
|
8
|
+
listenParent(): void;
|
|
9
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
export declare class Msglevel {
|
|
2
|
+
static get INFO(): string;
|
|
3
|
+
static get WARING(): string;
|
|
4
|
+
static get ERROR(): string;
|
|
5
|
+
}
|
|
6
|
+
export declare class Msg {
|
|
7
|
+
/**
|
|
8
|
+
* peerconnection messages
|
|
9
|
+
*/
|
|
10
|
+
static get CONNECT_WEBRTC(): string;
|
|
11
|
+
static get ICE_FAILED(): string;
|
|
12
|
+
static get ICE_SUCCESS(): string;
|
|
13
|
+
static get WEBRTC_HANGUP(): string;
|
|
14
|
+
/**
|
|
15
|
+
* app server messages
|
|
16
|
+
*/
|
|
17
|
+
static get CONNECT_WS_ERR(): string;
|
|
18
|
+
static get CONNECT_WS_ERR_1(): string;
|
|
19
|
+
static get CONNECT_WS_CLOSE(): string;
|
|
20
|
+
static get APP_LOGIN_ERR_1(): string;
|
|
21
|
+
static get APP_LOGIN_ERR_2(): string;
|
|
22
|
+
static get CONNECT_APP_ERR(): string;
|
|
23
|
+
static get CONNECT_APP_ERR2(): string;
|
|
24
|
+
static get SIGNALING_APP_TIMEOUT(): string;
|
|
25
|
+
static get REMOTE_APP_FAILED(): string;
|
|
26
|
+
static get REMOTE_APP_CLOSE(): string;
|
|
27
|
+
/**
|
|
28
|
+
* control message
|
|
29
|
+
*/
|
|
30
|
+
static get REFRESH(): string;
|
|
31
|
+
static get COURSE_OVER(): string;
|
|
32
|
+
static get COURSE_QUIT(): string;
|
|
33
|
+
/**
|
|
34
|
+
* 开启横屏
|
|
35
|
+
*/
|
|
36
|
+
static get ORIENTATION(): string;
|
|
37
|
+
/**
|
|
38
|
+
* 请求相对鼠标模式
|
|
39
|
+
*/
|
|
40
|
+
static get REQUEST_LOCK_MOUSE(): string;
|
|
41
|
+
/**
|
|
42
|
+
* 进入独占模式
|
|
43
|
+
*/
|
|
44
|
+
static get LOCK_MOUSE(): string;
|
|
45
|
+
/**
|
|
46
|
+
* 输入参数错误
|
|
47
|
+
*/
|
|
48
|
+
static get PARAM_ERROR(): string;
|
|
49
|
+
/**
|
|
50
|
+
*
|
|
51
|
+
*/
|
|
52
|
+
static get LOAD_CONFIG_FAILED(): string;
|
|
53
|
+
/**
|
|
54
|
+
*
|
|
55
|
+
*/
|
|
56
|
+
static get TOKEN_EXPIRED(): string;
|
|
57
|
+
/**
|
|
58
|
+
* 浏览器需要用户确认播放视频
|
|
59
|
+
*/
|
|
60
|
+
static get REQUEST_PLAY_VIDEO(): string;
|
|
61
|
+
/**
|
|
62
|
+
* 无操作超时
|
|
63
|
+
*/
|
|
64
|
+
static get NO_OPERATION_TIMEOUT(): string;
|
|
65
|
+
/**
|
|
66
|
+
* 超过载入时间
|
|
67
|
+
*/
|
|
68
|
+
static get LK_LOADING_TIMEOUT(): string;
|
|
69
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { LarkSR, ILarkSRConfig, PlayerModeType, UserType, LarkSREvent, AppliParams, AppliParamsUtils, LoadAppliParamsStartAppInfo, EventBase, LocalEvent, API, Operation, Capabilities, ScaleMode, KEYMAP, CloudLark, FullScreen, LockPointer, } from "./larksr";
|