larksr_websdk 3.2.3 → 3.2.7
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 +32 -24
- package/dist/doc/functions.md +2 -2
- package/dist/doc/index.md +43 -3
- package/dist/doc/member_variables.md +148 -0
- package/dist/larksr-web-sdk.min.js +3 -3
- package/dist/types/api.d.ts +3 -0
- package/dist/types/appli_params.d.ts +21 -2
- package/dist/types/index.d.ts +5 -2
- package/dist/types/larksr.d.ts +59 -8
- package/dist/types/screen_state.d.ts +1 -0
- package/package.json +11 -7
- package/types/api.d.ts +88 -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 +24 -0
- package/{dist/types → types}/lark/Worker.d.ts +0 -0
- package/{dist/types → types}/lark/application.d.ts +5 -2
- package/{dist/types → types}/lark/custom.d.ts +0 -0
- package/{dist/types → types}/lark/lark_event_type.d.ts +1 -1
- 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 +509 -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/types/operation/keymap.d.ts +24 -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 +0 -0
- 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 +0 -0
- package/{dist/types → types}/protobuf/message.d.ts +0 -0
- package/types/screen_state.d.ts +109 -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 +0 -0
- package/{dist/types → types}/utils/scale_mode.d.ts +0 -0
- package/{dist/types → types}/utils/unit.d.ts +0 -0
- package/dist/types/operation/keymap.d.ts +0 -20
|
@@ -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,24 @@
|
|
|
1
|
+
import 'core-js/stable/symbol';
|
|
2
|
+
import { LarkSR, 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
|
+
CreateLarkSRClientFromeAPI: typeof CreateLarkSRClientFromeAPI;
|
|
6
|
+
CreateLarkSRClientFromeUrl: typeof CreateLarkSRClientFromeUrl;
|
|
7
|
+
API: typeof API;
|
|
8
|
+
AppliParams: typeof AppliParams;
|
|
9
|
+
LoadAppliParamsFromUrl: typeof LoadAppliParamsFromUrl;
|
|
10
|
+
AppliParamsUtils: typeof AppliParamsUtils;
|
|
11
|
+
LoadAppliParamsStartAppInfo: typeof LoadAppliParamsStartAppInfo;
|
|
12
|
+
EventBase: typeof EventBase;
|
|
13
|
+
ScaleMode: typeof ScaleMode;
|
|
14
|
+
Capabilities: typeof Capabilities;
|
|
15
|
+
CloudLark: typeof CloudLark;
|
|
16
|
+
FullScreen: typeof FullScreen;
|
|
17
|
+
LockPointer: typeof LockPointer;
|
|
18
|
+
Operation: typeof Operation;
|
|
19
|
+
LarkSRClientEvent: typeof LarkSRClientEvent;
|
|
20
|
+
LarkEventType: typeof LarkEventType;
|
|
21
|
+
KEYMAP: import("./operation/keymap").VritualKeyMapOptions;
|
|
22
|
+
};
|
|
23
|
+
export default _default;
|
|
24
|
+
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,9 @@ 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;
|
|
76
79
|
private onChannelOpen;
|
|
77
80
|
private onClose;
|
|
78
81
|
private onChannelMsg;
|
|
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
|