larksr_websdk 3.2.4 → 3.2.8
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 +35 -24
- package/dist/doc/index.md +43 -3
- package/dist/larksr-web-sdk.min.js +2 -2
- package/dist/types/api.d.ts +23 -0
- package/dist/types/appli_params.d.ts +21 -2
- package/dist/types/index.d.ts +2 -1
- package/dist/types/larksr.d.ts +83 -7
- package/dist/types/screen_state.d.ts +6 -1
- package/package.json +9 -6
- package/types/api.d.ts +108 -0
- package/types/appli_params.d.ts +263 -0
- package/{dist/types → types}/common/cmd.d.ts +0 -0
- package/{dist/types → types}/common/constant.d.ts +0 -0
- package/{dist/types → types}/common/interface.d.ts +0 -0
- package/types/config.d.ts +59 -0
- package/{dist/types → types}/event/bus.d.ts +0 -0
- package/{dist/types → types}/event/event_base.d.ts +0 -0
- package/{dist/types → types}/event/events.d.ts +0 -0
- package/{dist/types → types}/event/iframe_poster.d.ts +0 -0
- package/{dist/types → types}/event/message.d.ts +0 -0
- package/types/index.d.ts +25 -0
- package/{dist/types → types}/lark/Worker.d.ts +0 -0
- package/{dist/types → types}/lark/application.d.ts +10 -2
- package/{dist/types → types}/lark/custom.d.ts +0 -0
- package/{dist/types → types}/lark/lark_event_type.d.ts +0 -0
- package/{dist/types → types}/lark/message.d.ts +5 -4
- package/{dist/types → types}/lark/peer_connection.d.ts +0 -0
- package/{dist/types → types}/lark/sdp_util.d.ts +0 -0
- package/types/lark/test_pixel_streaming.d.ts +54 -0
- package/{dist/types → types}/lark/websocket_channel.d.ts +0 -0
- package/{dist/types → types}/lark/websocket_proxy.d.ts +0 -0
- package/types/larksr.d.ts +534 -0
- package/{dist/types → types}/localization/base.d.ts +0 -0
- package/{dist/types → types}/localization/gesture_ins.d.ts +0 -0
- package/{dist/types → types}/localization/language.d.ts +0 -0
- package/{dist/types → types}/localization/loader.d.ts +0 -0
- package/{dist/types → types}/localization/message.d.ts +0 -0
- package/{dist/types → types}/localization/ui.d.ts +0 -0
- package/{dist/types → types}/operation/gamepad_handler.d.ts +0 -0
- package/{dist/types → types}/operation/gesture.d.ts +0 -0
- package/{dist/types → types}/operation/gesture_handler.d.ts +0 -0
- package/{dist/types → types}/operation/handler_base.d.ts +0 -0
- package/{dist/types → types}/operation/keyboard_handler.d.ts +0 -0
- package/{dist/types → types}/operation/keymap.d.ts +0 -0
- package/{dist/types → types}/operation/letter_keymap.d.ts +0 -0
- package/{dist/types → types}/operation/mouse_handler.d.ts +0 -0
- package/{dist/types → types}/operation/num_keymap.d.ts +0 -0
- package/{dist/types → types}/operation/operation.d.ts +3 -1
- package/types/operation/pixel_streaming_input.d.ts +82 -0
- package/{dist/types → types}/operation/touch_handler.d.ts +0 -0
- package/{dist/types → types}/operation/utils.d.ts +0 -0
- package/{dist/types → types}/protobuf/cloudlark.d.ts +6466 -5944
- package/{dist/types → types}/protobuf/message.d.ts +0 -0
- package/types/screen_state.d.ts +113 -0
- package/types/sdk_auth.d.ts +11 -0
- package/{dist/types → types}/utils/browser_type.d.ts +0 -0
- package/{dist/types → types}/utils/capabilities.d.ts +0 -0
- package/{dist/types → types}/utils/full_screen.d.ts +0 -0
- package/{dist/types → types}/utils/lock_pointer.d.ts +0 -0
- package/{dist/types → types}/utils/log.d.ts +1 -1
- package/{dist/types → types}/utils/scale_mode.d.ts +0 -0
- package/{dist/types → types}/utils/unit.d.ts +1 -0
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
import ScaleMode from './utils/scale_mode';
|
|
2
|
+
import { StartAppInfo } from './api';
|
|
3
|
+
import { ILarkSRConfig } from './larksr';
|
|
4
|
+
export interface IAppliParams {
|
|
5
|
+
/**
|
|
6
|
+
* appserver 的ip地址
|
|
7
|
+
*/
|
|
8
|
+
appServer: string;
|
|
9
|
+
/**
|
|
10
|
+
* appserver 的端口号
|
|
11
|
+
*/
|
|
12
|
+
appPort: string;
|
|
13
|
+
/**
|
|
14
|
+
* appli type
|
|
15
|
+
*/
|
|
16
|
+
appliType: number;
|
|
17
|
+
/**
|
|
18
|
+
* 是否使用 websocket 代理
|
|
19
|
+
*/
|
|
20
|
+
wsProxy: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* 优先使用的外网ip. 用在webrtc ice处替换为高优先级的ip
|
|
23
|
+
*/
|
|
24
|
+
preferPubOutIp: string;
|
|
25
|
+
/**
|
|
26
|
+
* taskid
|
|
27
|
+
*/
|
|
28
|
+
taskid: string;
|
|
29
|
+
/**
|
|
30
|
+
* 当前应用名称
|
|
31
|
+
*/
|
|
32
|
+
appliName: string;
|
|
33
|
+
/**
|
|
34
|
+
* @deprecated
|
|
35
|
+
* 应用的宽高。现在云端自动获取宽高
|
|
36
|
+
*/
|
|
37
|
+
width: number;
|
|
38
|
+
/**
|
|
39
|
+
* @deprecated
|
|
40
|
+
* 应用的宽高。现在云端自动获取宽高
|
|
41
|
+
*/
|
|
42
|
+
height: number;
|
|
43
|
+
/**
|
|
44
|
+
* 缩放模式
|
|
45
|
+
*/
|
|
46
|
+
scaleMode: ScaleMode;
|
|
47
|
+
/**
|
|
48
|
+
* 日志级别
|
|
49
|
+
* @default 'warn'
|
|
50
|
+
*/
|
|
51
|
+
logLevel: 'info' | 'warn' | 'error';
|
|
52
|
+
/**
|
|
53
|
+
* 无操作时间。超时断开连接.
|
|
54
|
+
*/
|
|
55
|
+
noOperationTimeout: number;
|
|
56
|
+
/**
|
|
57
|
+
* 是否显示右下角的水印。
|
|
58
|
+
*/
|
|
59
|
+
waterMark: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* 检测的rtt值,rtt超过该值将提示用户网络环境差
|
|
62
|
+
*/
|
|
63
|
+
rttLimit: number;
|
|
64
|
+
/**
|
|
65
|
+
* 检测的丢包率。丢包率超过该值提示用户网络环境差
|
|
66
|
+
*/
|
|
67
|
+
packetLostLimit: number;
|
|
68
|
+
/**
|
|
69
|
+
* 丢包率和rtt提示的时间间隔。
|
|
70
|
+
*/
|
|
71
|
+
rttLimitInterval: number;
|
|
72
|
+
/**
|
|
73
|
+
* 码率. 用在在创建 webrtc sdp时替换为此码率。
|
|
74
|
+
*/
|
|
75
|
+
codeRate: number;
|
|
76
|
+
/**
|
|
77
|
+
* audio code rate
|
|
78
|
+
* https://stackoverflow.com/questions/33649283/how-to-set-up-sdp-for-high-quality-opus-audio
|
|
79
|
+
* a=fmtp:111 minptime=10;useinbandfec=1; stereo=1; maxaveragebitrate=510000
|
|
80
|
+
*/
|
|
81
|
+
audioCodeRate: number;
|
|
82
|
+
/**
|
|
83
|
+
* 帧率,在登录task时传给后端。
|
|
84
|
+
*/
|
|
85
|
+
frameRate: number;
|
|
86
|
+
/**
|
|
87
|
+
* 网络状态,影响 webrtc offer 创建时最低码率。
|
|
88
|
+
*/
|
|
89
|
+
network: 'local' | 'public';
|
|
90
|
+
/**
|
|
91
|
+
* 使用的语言,目前只支持英语和中文。
|
|
92
|
+
*/
|
|
93
|
+
language: string;
|
|
94
|
+
/**
|
|
95
|
+
* 初始的鼠标锁定模式
|
|
96
|
+
* false:非锁定模式
|
|
97
|
+
* true:锁定模式
|
|
98
|
+
*/
|
|
99
|
+
initCursorMode: boolean;
|
|
100
|
+
/**
|
|
101
|
+
* 背景颜色
|
|
102
|
+
*/
|
|
103
|
+
bgColor: string;
|
|
104
|
+
/**
|
|
105
|
+
* 全屏模式
|
|
106
|
+
* 0 -》 用户手动触发
|
|
107
|
+
* 1 -》 首次点击进入触发
|
|
108
|
+
* 2 -》 每次点击触发
|
|
109
|
+
*/
|
|
110
|
+
fullScreenMode: number;
|
|
111
|
+
/**
|
|
112
|
+
* 手机端全屏模式
|
|
113
|
+
* 0 -》 用户手动触发
|
|
114
|
+
* 1 -》 首次点击进入触发
|
|
115
|
+
* 2 -》 每次点击触发
|
|
116
|
+
*/
|
|
117
|
+
mobileFullScreenMode: number;
|
|
118
|
+
/**
|
|
119
|
+
* 一人操作多人看 0 普通模式 1 交互模式(可以一人操作多人看)
|
|
120
|
+
* 2 多人互动模式,鼠标键盘都放开
|
|
121
|
+
*/
|
|
122
|
+
playerMode: number;
|
|
123
|
+
/**
|
|
124
|
+
* 用户类型 number
|
|
125
|
+
* 所有者:1 观察者:0;
|
|
126
|
+
*/
|
|
127
|
+
userType: number;
|
|
128
|
+
/**
|
|
129
|
+
* 用户昵称
|
|
130
|
+
*/
|
|
131
|
+
nickname: string;
|
|
132
|
+
/**
|
|
133
|
+
* 口令:8位唯一码,写入TaskInfo. 房间code,备用。
|
|
134
|
+
*/
|
|
135
|
+
roomCode: number;
|
|
136
|
+
/**
|
|
137
|
+
* debug task. 跳过task检测
|
|
138
|
+
*/
|
|
139
|
+
debugTask: boolean;
|
|
140
|
+
/**
|
|
141
|
+
* debug webserver
|
|
142
|
+
*/
|
|
143
|
+
debugWebServer: string;
|
|
144
|
+
/**
|
|
145
|
+
* laoding timeout
|
|
146
|
+
* 5 * 60
|
|
147
|
+
*/
|
|
148
|
+
loadingTimeout: number;
|
|
149
|
+
/**
|
|
150
|
+
* share url
|
|
151
|
+
*/
|
|
152
|
+
shareUrl: boolean;
|
|
153
|
+
/**
|
|
154
|
+
* 是否强制横屏
|
|
155
|
+
*/
|
|
156
|
+
mobileForceLandscape: boolean;
|
|
157
|
+
/**
|
|
158
|
+
* 移动端初始化初始化是否显示手柄
|
|
159
|
+
*/
|
|
160
|
+
mobileVirtualJoystick: boolean;
|
|
161
|
+
/**
|
|
162
|
+
* mouseZoomDirection
|
|
163
|
+
* 用于移动端捏合缩放操作与应用鼠标缩放的对应关系
|
|
164
|
+
* 1:鼠标滚轮向上为放大,
|
|
165
|
+
* 0:鼠标滚轮向下为放大(default)
|
|
166
|
+
*/
|
|
167
|
+
mouseZoomDirection: number;
|
|
168
|
+
/**
|
|
169
|
+
* 初始是否显示玩家列表
|
|
170
|
+
*/
|
|
171
|
+
showPlayerList: boolean;
|
|
172
|
+
/**
|
|
173
|
+
* 优先使用的解码器
|
|
174
|
+
*/
|
|
175
|
+
perferDecoder: 'auto' | 'vp8' | 'vp9' | 'h264' | 'av1x';
|
|
176
|
+
/**
|
|
177
|
+
* 触摸操作对应的操作方式,触摸屏还是鼠标
|
|
178
|
+
*/
|
|
179
|
+
touchOperateMode: 'touchScreen' | 'mouse';
|
|
180
|
+
/**
|
|
181
|
+
* appid
|
|
182
|
+
*/
|
|
183
|
+
appliId: string;
|
|
184
|
+
/**
|
|
185
|
+
*
|
|
186
|
+
*/
|
|
187
|
+
syncLocalToCloudClipboard: boolean;
|
|
188
|
+
enableRttIcon: boolean;
|
|
189
|
+
enableSoundRequire: boolean;
|
|
190
|
+
toastLevel: number;
|
|
191
|
+
}
|
|
192
|
+
export declare enum AppliType {
|
|
193
|
+
DESKTOP = 1,
|
|
194
|
+
SHARED = 2,
|
|
195
|
+
PIXEL_STREAMING = 13,
|
|
196
|
+
VR = 3,
|
|
197
|
+
VR_STEAM = 5,
|
|
198
|
+
NV_VR = 6,
|
|
199
|
+
XR = 7,
|
|
200
|
+
PXY_AR = 9,
|
|
201
|
+
NV_AR = 11
|
|
202
|
+
}
|
|
203
|
+
export declare class AppliParams implements IAppliParams {
|
|
204
|
+
appServer: string;
|
|
205
|
+
appPort: string;
|
|
206
|
+
appliType: AppliType;
|
|
207
|
+
wsProxy: boolean;
|
|
208
|
+
preferPubOutIp: string;
|
|
209
|
+
taskid: string;
|
|
210
|
+
appliName: string;
|
|
211
|
+
width: number;
|
|
212
|
+
height: number;
|
|
213
|
+
scaleMode: ScaleMode;
|
|
214
|
+
logLevel: 'info' | 'warn' | 'error';
|
|
215
|
+
noOperationTimeout: number;
|
|
216
|
+
waterMark: boolean;
|
|
217
|
+
rttLimit: number;
|
|
218
|
+
packetLostLimit: number;
|
|
219
|
+
rttLimitInterval: number;
|
|
220
|
+
codeRate: number;
|
|
221
|
+
audioCodeRate: number;
|
|
222
|
+
frameRate: number;
|
|
223
|
+
network: 'local' | 'public';
|
|
224
|
+
language: string;
|
|
225
|
+
initCursorMode: boolean;
|
|
226
|
+
bgColor: string;
|
|
227
|
+
fullScreenMode: number;
|
|
228
|
+
mobileFullScreenMode: number;
|
|
229
|
+
playerMode: number;
|
|
230
|
+
userType: number;
|
|
231
|
+
nickname: string;
|
|
232
|
+
roomCode: number;
|
|
233
|
+
debugTask: boolean;
|
|
234
|
+
debugWebServer: string;
|
|
235
|
+
loadingTimeout: number;
|
|
236
|
+
shareUrl: boolean;
|
|
237
|
+
mobileForceLandscape: boolean;
|
|
238
|
+
mobileVirtualJoystick: boolean;
|
|
239
|
+
mouseZoomDirection: number;
|
|
240
|
+
showPlayerList: boolean;
|
|
241
|
+
perferDecoder: 'auto' | 'vp8' | 'vp9' | 'h264' | 'av1x';
|
|
242
|
+
touchOperateMode: 'touchScreen' | 'mouse';
|
|
243
|
+
appliId: string;
|
|
244
|
+
syncLocalToCloudClipboard: boolean;
|
|
245
|
+
enableRttIcon: boolean;
|
|
246
|
+
enableSoundRequire: boolean;
|
|
247
|
+
toastLevel: number;
|
|
248
|
+
static copyAndCreate(params?: IAppliParams): AppliParams;
|
|
249
|
+
static setUpWithSDKConfig(params: IAppliParams, config: ILarkSRConfig): AppliParams;
|
|
250
|
+
}
|
|
251
|
+
export declare function CreateAppliParams(): IAppliParams;
|
|
252
|
+
export declare class AppliParamsUtils {
|
|
253
|
+
static getScaleMode(init: number | null | undefined): string;
|
|
254
|
+
static getNetwork(init: number | null | undefined): 'local' | 'public';
|
|
255
|
+
static getLogLevel(level: string | null | undefined): 'info' | 'warn';
|
|
256
|
+
static getBoolOption(option: string | null | undefined | boolean, emptyValue?: boolean): boolean;
|
|
257
|
+
static getNumberBoolOption(option: string | null | undefined | number, emptyValue?: boolean): boolean;
|
|
258
|
+
static getStringOption(option: string | null | undefined, emptyValue?: string): string;
|
|
259
|
+
static getIntOption(option: string | null | undefined, emptyValue?: number): number;
|
|
260
|
+
static getBgColor(option: string | null | undefined): string;
|
|
261
|
+
}
|
|
262
|
+
export declare function LoadAppliParamsFromUrl(): IAppliParams;
|
|
263
|
+
export declare function LoadAppliParamsStartAppInfo(startAppInfo: StartAppInfo): IAppliParams;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -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
|
+
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import 'core-js/stable/symbol';
|
|
2
|
+
import { LarkSR, CreateLarkSRClientFromePXYHost, CreateLarkSRClientFromeAPI, CreateLarkSRClientFromeUrl, LarkEventType, LarkSRClientEvent, AppliParams, LoadAppliParamsFromUrl, AppliParamsUtils, LoadAppliParamsStartAppInfo, EventBase, API, Operation, Capabilities, ScaleMode, CloudLark, FullScreen, LockPointer, ILarkSRConfig, PlayerModeType, UserType, LarkSREvent } from "./larksr";
|
|
3
|
+
declare const _default: {
|
|
4
|
+
LarkSR: typeof LarkSR;
|
|
5
|
+
CreateLarkSRClientFromePXYHost: typeof CreateLarkSRClientFromePXYHost;
|
|
6
|
+
CreateLarkSRClientFromeAPI: typeof CreateLarkSRClientFromeAPI;
|
|
7
|
+
CreateLarkSRClientFromeUrl: typeof CreateLarkSRClientFromeUrl;
|
|
8
|
+
API: typeof API;
|
|
9
|
+
AppliParams: typeof AppliParams;
|
|
10
|
+
LoadAppliParamsFromUrl: typeof LoadAppliParamsFromUrl;
|
|
11
|
+
AppliParamsUtils: typeof AppliParamsUtils;
|
|
12
|
+
LoadAppliParamsStartAppInfo: typeof LoadAppliParamsStartAppInfo;
|
|
13
|
+
EventBase: typeof EventBase;
|
|
14
|
+
ScaleMode: typeof ScaleMode;
|
|
15
|
+
Capabilities: typeof Capabilities;
|
|
16
|
+
CloudLark: typeof CloudLark;
|
|
17
|
+
FullScreen: typeof FullScreen;
|
|
18
|
+
LockPointer: typeof LockPointer;
|
|
19
|
+
Operation: typeof Operation;
|
|
20
|
+
LarkSRClientEvent: typeof LarkSRClientEvent;
|
|
21
|
+
LarkEventType: typeof LarkEventType;
|
|
22
|
+
KEYMAP: import("./operation/keymap").VritualKeyMapOptions;
|
|
23
|
+
};
|
|
24
|
+
export default _default;
|
|
25
|
+
export { ILarkSRConfig, PlayerModeType, UserType, LarkSREvent, };
|
|
File without changes
|
|
@@ -3,6 +3,7 @@ import * as Msg from '../protobuf/cloudlark';
|
|
|
3
3
|
import WebSocektChannel from './websocket_channel';
|
|
4
4
|
import WebsocketProxy from './websocket_proxy';
|
|
5
5
|
import { LarkSR } from '../larksr';
|
|
6
|
+
import PixelStreamingWebsocketChannel from './test_pixel_streaming';
|
|
6
7
|
export declare enum APP_STATE {
|
|
7
8
|
BEFORE_CREATE = 0,
|
|
8
9
|
INITED = 1,
|
|
@@ -44,6 +45,7 @@ export interface AppEvent extends LocalEvent<APP_EVENT_TYPE> {
|
|
|
44
45
|
export default class Application extends EventBase<APP_EVENT_TYPE, AppEvent> {
|
|
45
46
|
private websocketChannel;
|
|
46
47
|
private websocketProxy;
|
|
48
|
+
private testPixelStreaming;
|
|
47
49
|
private peerConnection;
|
|
48
50
|
get state(): APP_STATE;
|
|
49
51
|
set state(state: APP_STATE);
|
|
@@ -60,7 +62,7 @@ export default class Application extends EventBase<APP_EVENT_TYPE, AppEvent> {
|
|
|
60
62
|
sendTextToDataChannel(text: string): void;
|
|
61
63
|
sendBinaryToDataChannel(binary: Uint8Array): void;
|
|
62
64
|
start(): Promise<void>;
|
|
63
|
-
connect(): Promise<WebsocketProxy> | Promise<WebSocektChannel> | undefined;
|
|
65
|
+
connect(): Promise<PixelStreamingWebsocketChannel> | Promise<WebsocketProxy> | Promise<WebSocektChannel> | undefined;
|
|
64
66
|
disConnect(): void;
|
|
65
67
|
closeRtc(): void;
|
|
66
68
|
versionCheck(): void;
|
|
@@ -71,8 +73,11 @@ export default class Application extends EventBase<APP_EVENT_TYPE, AppEvent> {
|
|
|
71
73
|
restartApp(): void;
|
|
72
74
|
rtcOffer(): void;
|
|
73
75
|
setAnswer(sdp: string): void;
|
|
74
|
-
setIce(candidate: string): void;
|
|
76
|
+
setIce(sdpMlineindex: number, sdpmid: string, candidate: string): void;
|
|
75
77
|
sendInput(input: Msg.CloudLark.ClientInput): void;
|
|
78
|
+
sendInputBuffer(buffer: ArrayBuffer): void;
|
|
79
|
+
private sendToWebsocektChannelBuffer;
|
|
80
|
+
private sendToWebsocektChannelMsg;
|
|
76
81
|
private onChannelOpen;
|
|
77
82
|
private onClose;
|
|
78
83
|
private onChannelMsg;
|
|
@@ -93,6 +98,9 @@ export default class Application extends EventBase<APP_EVENT_TYPE, AppEvent> {
|
|
|
93
98
|
retryPeerconnection(): void;
|
|
94
99
|
private onPeerConnectionDisconnect;
|
|
95
100
|
private onBadNetwork;
|
|
101
|
+
private onPixelStreamingPlayerList;
|
|
102
|
+
private onPixelStreamingDataChannelState;
|
|
103
|
+
private onPixelStreamingDataChannelData;
|
|
96
104
|
private onCursorStyle;
|
|
97
105
|
private onAppResize;
|
|
98
106
|
private onAppMouseMode;
|
|
File without changes
|
|
File without changes
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import * as Msg from '../protobuf/cloudlark';
|
|
2
2
|
import { LarkEventType } from './lark_event_type';
|
|
3
3
|
export declare const MESSAGE_MAGIC = 538317090;
|
|
4
|
+
export declare const PIXEL_STREAMING_MESSAGE_MAGIC = 539037986;
|
|
4
5
|
export default class Message {
|
|
5
|
-
static emptyMsg(): Msg.CloudLark.ToServerMessage;
|
|
6
|
-
static versionCheckRequest(): Msg.CloudLark.ToServerMessage;
|
|
7
|
-
static taskRequest(taskid: string, isInteractiveMode: boolean, isObMode: boolean, nickName: string): Msg.CloudLark.ToServerMessage;
|
|
8
|
-
static startStreamReqeuest(request: Msg.CloudLark.IStartStreamRequest): Msg.CloudLark.ToServerMessage;
|
|
6
|
+
static emptyMsg(isPixelStreaming?: boolean): Msg.CloudLark.ToServerMessage;
|
|
7
|
+
static versionCheckRequest(isPixelStreaming: boolean): Msg.CloudLark.ToServerMessage;
|
|
8
|
+
static taskRequest(taskid: string, isInteractiveMode: boolean, isObMode: boolean, nickName: string, isPixelStreaming: boolean): Msg.CloudLark.ToServerMessage;
|
|
9
|
+
static startStreamReqeuest(request: Msg.CloudLark.IStartStreamRequest, isPixelStreaming: boolean): Msg.CloudLark.ToServerMessage;
|
|
9
10
|
static startMonitorStreamReqeuest(request: Msg.CloudLark.IVrMonitorRequest): Msg.CloudLark.ToServerMessage;
|
|
10
11
|
static rtcOfferMsg(type: string, sdp: string): Msg.CloudLark.ToServerMessage;
|
|
11
12
|
static iceMsg(sdpmid: string, sdpMlineindex: number, candidate: string): Msg.CloudLark.ToServerMessage;
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { EventBase, LocalEvent } from '../event/event_base';
|
|
2
|
+
import { LarkSR } from '../larksr';
|
|
3
|
+
export declare enum CHANNEL_EVENT_TYPE {
|
|
4
|
+
OPEN = 0,
|
|
5
|
+
CLOSE = 1,
|
|
6
|
+
ERROR = 2,
|
|
7
|
+
CLIENT_MSG = 3
|
|
8
|
+
}
|
|
9
|
+
export interface ChannelEvent extends LocalEvent<CHANNEL_EVENT_TYPE> {
|
|
10
|
+
data?: any;
|
|
11
|
+
}
|
|
12
|
+
export interface PixelStreamingWebscocketConfig {
|
|
13
|
+
serverAddress: string;
|
|
14
|
+
ip: string;
|
|
15
|
+
port: string;
|
|
16
|
+
path?: string;
|
|
17
|
+
}
|
|
18
|
+
export default class PixelStreamingWebsocketChannel extends EventBase<CHANNEL_EVENT_TYPE, ChannelEvent> {
|
|
19
|
+
private get wsServer();
|
|
20
|
+
private config;
|
|
21
|
+
private connection;
|
|
22
|
+
private keepAliveTimeout;
|
|
23
|
+
private larksr;
|
|
24
|
+
constructor(config: PixelStreamingWebscocketConfig, larksr: LarkSR);
|
|
25
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
*/
|
|
28
|
+
connect(): Promise<this>;
|
|
29
|
+
/**
|
|
30
|
+
*
|
|
31
|
+
*/
|
|
32
|
+
close(): Promise<void>;
|
|
33
|
+
sendMsg(msg: any): void;
|
|
34
|
+
isOpen(): boolean;
|
|
35
|
+
private startKeepAlive;
|
|
36
|
+
private stopKeepAlive;
|
|
37
|
+
/**
|
|
38
|
+
*
|
|
39
|
+
*/
|
|
40
|
+
private onMessage;
|
|
41
|
+
private onOpen;
|
|
42
|
+
/**
|
|
43
|
+
*
|
|
44
|
+
* @param e
|
|
45
|
+
*/
|
|
46
|
+
private onWSError;
|
|
47
|
+
/**
|
|
48
|
+
*
|
|
49
|
+
* @param e
|
|
50
|
+
*/
|
|
51
|
+
private onWSClose;
|
|
52
|
+
private $emit;
|
|
53
|
+
private createEvent;
|
|
54
|
+
}
|
|
File without changes
|
|
File without changes
|