larksr_websdk 3.2.402 → 3.2.404
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/en/config.md +228 -0
- package/dist/doc/en/dev.md +84 -0
- package/dist/doc/en/event_codes.md +286 -0
- package/dist/doc/en/events.md +229 -0
- package/dist/doc/en/functions.md +603 -0
- package/dist/doc/en/index.md +115 -0
- package/dist/doc/en/member_variables.md +407 -0
- package/dist/doc/en/multi_media_3_2_401.md +84 -0
- package/dist/doc/en/sdkid_encryption.md +40 -0
- package/dist/doc/en/update.md +462 -0
- package/dist/doc/zh_CN/config.md +243 -0
- package/dist/doc/zh_CN/event_codes.md +286 -0
- package/dist/doc/zh_CN/events.md +229 -0
- package/dist/doc/zh_CN/functions.md +658 -0
- package/dist/doc/zh_CN/index.md +84 -0
- package/dist/doc/zh_CN/member_variables.md +431 -0
- package/dist/doc/zh_CN/multi_media_3_2_401.md +84 -0
- package/dist/doc/zh_CN/sdkid_encryption.md +40 -0
- package/dist/doc/zh_CN/update.md +579 -0
- package/dist/larksr-web-sdk.min.js +1 -1
- package/dist/types/api.d.ts +1 -0
- package/dist/types/appli_params.d.ts +9 -6
- package/dist/types/config.d.ts +0 -1
- package/dist/types/lark/Worker.d.ts +3 -0
- package/dist/types/lark/application.d.ts +7 -2
- package/dist/types/lark/custom.d.ts +7 -0
- package/dist/types/lark/peer_connection.d.ts +3 -2
- package/dist/types/lark/webcodec.d.ts +40 -0
- package/dist/types/lark/webcodecs.generated.d.ts +417 -0
- package/dist/types/lark/websocket_channel.d.ts +1 -0
- package/dist/types/lark/websocket_proxy.d.ts +2 -0
- package/dist/types/larksr.d.ts +19 -7
- package/dist/types/protobuf/cloudlark.d.ts +9674 -0
- package/dist/types/screen_state.d.ts +8 -3
- package/dist/types/utils/ios-inner-height.d.ts +4 -0
- package/dist/types/utils/lock_pointer.d.ts +2 -1
- package/dist/types/utils/scale_mode.d.ts +44 -0
- package/package.json +72 -71
- package/types/api.d.ts +1 -0
- package/types/appli_params.d.ts +9 -6
- package/types/config.d.ts +0 -1
- package/types/lark/Worker.d.ts +3 -0
- package/types/lark/application.d.ts +7 -2
- package/types/lark/custom.d.ts +7 -0
- package/types/lark/peer_connection.d.ts +3 -2
- package/types/lark/webcodec.d.ts +40 -0
- package/types/lark/webcodecs.generated.d.ts +417 -0
- package/types/lark/websocket_channel.d.ts +1 -0
- package/types/lark/websocket_proxy.d.ts +2 -0
- package/types/larksr.d.ts +19 -7
- package/types/protobuf/cloudlark.d.ts +9674 -0
- package/types/screen_state.d.ts +8 -3
- package/types/utils/ios-inner-height.d.ts +4 -0
- package/types/utils/lock_pointer.d.ts +2 -1
- package/types/utils/scale_mode.d.ts +44 -0
package/dist/types/api.d.ts
CHANGED
|
@@ -132,6 +132,7 @@ export default class API {
|
|
|
132
132
|
static GetTouchCtrMapping(server: string, appliId?: string): Promise<unknown>;
|
|
133
133
|
static GetAppliList(server: string, params: any): Promise<unknown>;
|
|
134
134
|
static RegionList(server: string, params: any): Promise<unknown>;
|
|
135
|
+
static heartbeat(server: string, taskId: string): Promise<unknown>;
|
|
135
136
|
static joinParam(params: any): string;
|
|
136
137
|
}
|
|
137
138
|
export {};
|
|
@@ -98,10 +98,11 @@ export interface IAppliParams {
|
|
|
98
98
|
language: string;
|
|
99
99
|
/**
|
|
100
100
|
* 初始的鼠标锁定模式
|
|
101
|
-
*
|
|
102
|
-
*
|
|
101
|
+
* 0:自动判断模式
|
|
102
|
+
* 1:锁定模式
|
|
103
|
+
* 2: 非锁定模式
|
|
103
104
|
*/
|
|
104
|
-
initCursorMode:
|
|
105
|
+
initCursorMode: number;
|
|
105
106
|
/**
|
|
106
107
|
* 背景颜色
|
|
107
108
|
*/
|
|
@@ -181,7 +182,7 @@ export interface IAppliParams {
|
|
|
181
182
|
/**
|
|
182
183
|
* 触摸操作对应的操作方式,触摸屏还是鼠标
|
|
183
184
|
*/
|
|
184
|
-
touchOperateMode: 'touchScreen' | 'mouse';
|
|
185
|
+
touchOperateMode: 'touchScreen' | 'mouse' | 'mix';
|
|
185
186
|
/**
|
|
186
187
|
* appid
|
|
187
188
|
*/
|
|
@@ -204,6 +205,7 @@ export interface IAppliParams {
|
|
|
204
205
|
useSeparateMediaSharePeer: boolean;
|
|
205
206
|
mobileKeyboardType: number;
|
|
206
207
|
initResolutionType: number;
|
|
208
|
+
useWebcodec: boolean;
|
|
207
209
|
}
|
|
208
210
|
export declare enum AppliType {
|
|
209
211
|
DESKTOP = 1,
|
|
@@ -240,7 +242,7 @@ export declare class AppliParams implements IAppliParams {
|
|
|
240
242
|
frameRate: number;
|
|
241
243
|
network: 'local' | 'public';
|
|
242
244
|
language: string;
|
|
243
|
-
initCursorMode:
|
|
245
|
+
initCursorMode: number;
|
|
244
246
|
bgColor: string;
|
|
245
247
|
fullScreenMode: number;
|
|
246
248
|
mobileFullScreenMode: number;
|
|
@@ -257,7 +259,7 @@ export declare class AppliParams implements IAppliParams {
|
|
|
257
259
|
mouseZoomDirection: number;
|
|
258
260
|
showPlayerList: boolean;
|
|
259
261
|
preferDecoder: 'auto' | 'vp8' | 'vp9' | 'h264' | 'h265' | 'hevc' | 'av1' | 'av1x';
|
|
260
|
-
touchOperateMode: 'touchScreen' | 'mouse';
|
|
262
|
+
touchOperateMode: 'touchScreen' | 'mouse' | 'mix';
|
|
261
263
|
appliId: string;
|
|
262
264
|
syncLocalToCloudClipboard: boolean;
|
|
263
265
|
enableRttIcon: boolean;
|
|
@@ -274,6 +276,7 @@ export declare class AppliParams implements IAppliParams {
|
|
|
274
276
|
useSeparateMediaSharePeer: boolean;
|
|
275
277
|
mobileKeyboardType: number;
|
|
276
278
|
initResolutionType: number;
|
|
279
|
+
useWebcodec: boolean;
|
|
277
280
|
static copyAndCreate(params?: IAppliParams): AppliParams;
|
|
278
281
|
static setUpWithSDKConfig(params: IAppliParams, config: ILarkSRConfig): AppliParams;
|
|
279
282
|
}
|
package/dist/types/config.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { LarkSR } from '../larksr';
|
|
|
6
6
|
import PixelStreamingWebsocketChannel from './test_pixel_streaming';
|
|
7
7
|
import { RECORDER_STATE } from './recoder';
|
|
8
8
|
import PeerConnectionMediaShare from './peer_connection_media_share';
|
|
9
|
+
import WebCodec from './webcodec';
|
|
9
10
|
export declare enum APP_STATE {
|
|
10
11
|
BEFORE_CREATE = 0,
|
|
11
12
|
INITED = 1,
|
|
@@ -82,6 +83,8 @@ export default class Application extends EventBase<APP_EVENT_TYPE, AppEvent> {
|
|
|
82
83
|
private recoder;
|
|
83
84
|
private rtcConfig;
|
|
84
85
|
get currentAppSize(): Msg.CloudLark.IAppResize | null | undefined;
|
|
86
|
+
get webcodecDecoder(): WebCodec;
|
|
87
|
+
private _webcodecDecoder;
|
|
85
88
|
constructor(larksr: LarkSR);
|
|
86
89
|
init(): void;
|
|
87
90
|
initSharePc(): void;
|
|
@@ -118,18 +121,19 @@ export default class Application extends EventBase<APP_EVENT_TYPE, AppEvent> {
|
|
|
118
121
|
private onRecoderData;
|
|
119
122
|
start(): Promise<void>;
|
|
120
123
|
connect(): Promise<PixelStreamingWebsocketChannel> | Promise<WebsocketProxy> | Promise<WebSocektChannel> | undefined;
|
|
124
|
+
sendKeepAlive(): void | undefined;
|
|
121
125
|
disConnect(): void;
|
|
122
126
|
closeRtc(): void;
|
|
123
127
|
versionCheck(): void;
|
|
124
128
|
task(): void;
|
|
125
|
-
startSteam(): void
|
|
129
|
+
startSteam(): Promise<void>;
|
|
126
130
|
startMonitorSteam(): void;
|
|
127
131
|
restart(): void;
|
|
128
132
|
restartApp(): void;
|
|
129
133
|
rtcOffer(): Promise<void>;
|
|
130
134
|
setAnswer(sdp: string): void;
|
|
131
135
|
setIce(sdpMlineindex: number, sdpmid: string, candidate: string): void;
|
|
132
|
-
sendInput(input: Msg.CloudLark.ClientInput): void;
|
|
136
|
+
sendInput(input: Msg.CloudLark.ClientInput, needRemoteScreen?: boolean): void;
|
|
133
137
|
sendInputBuffer(buffer: ArrayBuffer): void;
|
|
134
138
|
private sendToWebsocektChannelBuffer;
|
|
135
139
|
private sendToWebsocektChannelMsg;
|
|
@@ -157,6 +161,7 @@ export default class Application extends EventBase<APP_EVENT_TYPE, AppEvent> {
|
|
|
157
161
|
retryPeerconnection(): void;
|
|
158
162
|
private onAerialViewStatus;
|
|
159
163
|
private onAerialViewScreen;
|
|
164
|
+
private onVideoFrame;
|
|
160
165
|
private onShareMediaError;
|
|
161
166
|
private onShareMediaInfo;
|
|
162
167
|
private onShareMediaOffer;
|
|
@@ -36,7 +36,8 @@ export declare enum WEBRTC_EVENT_TYPE {
|
|
|
36
36
|
RTMP_STREAM_ERROR = 23,
|
|
37
37
|
INFO = 24,
|
|
38
38
|
AerialViewStatus = 25,
|
|
39
|
-
AerialViewScreen = 26
|
|
39
|
+
AerialViewScreen = 26,
|
|
40
|
+
VideoFrame = 27
|
|
40
41
|
}
|
|
41
42
|
export interface GoogleBitRate {
|
|
42
43
|
start: number;
|
|
@@ -177,7 +178,7 @@ export default class PeerConnection extends EventBase<WEBRTC_EVENT_TYPE, WebRTCE
|
|
|
177
178
|
onReceiveCandidate(candateInit: RTCIceCandidateInit): void;
|
|
178
179
|
startNetTest(): void;
|
|
179
180
|
stopNetTest(): void;
|
|
180
|
-
sendInput(input: Input.CloudLark.ClientInput): void;
|
|
181
|
+
sendInput(input: Input.CloudLark.ClientInput, needRemoteScreen?: boolean): void;
|
|
181
182
|
sendBuffer(buffer: ArrayBuffer): void;
|
|
182
183
|
sendToAppTextMsg(msg: string): void;
|
|
183
184
|
sendToAppBinaryMsg(binary: Uint8Array): void;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { LocalEvent } from "@/event/event_base";
|
|
2
|
+
import { EventBase, LarkSR } from "@/larksr";
|
|
3
|
+
import { CloudLark } from '@/protobuf/cloudlark';
|
|
4
|
+
export declare enum WebCodecType {
|
|
5
|
+
WebCodecTypeH264 = "h264",
|
|
6
|
+
WebCodecTypeH265 = "h265",
|
|
7
|
+
WebCodecTypeNone = "none"
|
|
8
|
+
}
|
|
9
|
+
export declare enum WEB_CODEC_EVENT_TYPE {
|
|
10
|
+
PLAYED = 0
|
|
11
|
+
}
|
|
12
|
+
export interface WebCodecEvent extends LocalEvent<WEB_CODEC_EVENT_TYPE> {
|
|
13
|
+
data?: any;
|
|
14
|
+
}
|
|
15
|
+
export default class WebCodec extends EventBase<WEB_CODEC_EVENT_TYPE, WebCodecEvent> {
|
|
16
|
+
static AVC_High_PROFILE: string;
|
|
17
|
+
static HEVC_MAIN_PROFILE: string;
|
|
18
|
+
static checkSupport(codec: WebCodecType, width?: number, height?: number): Promise<boolean>;
|
|
19
|
+
static toWebCodecType(cloudType: CloudLark.StreamVideoFrame.Codec | null | undefined): WebCodecType;
|
|
20
|
+
static getProfileName(codec: WebCodecType): string;
|
|
21
|
+
private larksr;
|
|
22
|
+
private decoder;
|
|
23
|
+
private codec;
|
|
24
|
+
private width;
|
|
25
|
+
private height;
|
|
26
|
+
private canvas;
|
|
27
|
+
private context;
|
|
28
|
+
private frameData;
|
|
29
|
+
private dataOffset;
|
|
30
|
+
private firstFrame;
|
|
31
|
+
constructor(larksr: LarkSR);
|
|
32
|
+
setCanvas(canvas: HTMLCanvasElement, context: CanvasRenderingContext2D): void;
|
|
33
|
+
init(frame: CloudLark.IStreamVideoFrame): Promise<boolean | undefined>;
|
|
34
|
+
onStreamVideoFrame(frame: CloudLark.IStreamVideoFrame): Promise<void>;
|
|
35
|
+
private checkConfig;
|
|
36
|
+
private onFrameDecode;
|
|
37
|
+
private onFrameError;
|
|
38
|
+
private $emit;
|
|
39
|
+
private createAppEvent;
|
|
40
|
+
}
|
|
@@ -0,0 +1,417 @@
|
|
|
1
|
+
/////////////////////////////
|
|
2
|
+
/// webcodecs APIs
|
|
3
|
+
/////////////////////////////
|
|
4
|
+
|
|
5
|
+
interface AudioDataCopyToOptions {
|
|
6
|
+
format?: AudioSampleFormat | undefined;
|
|
7
|
+
frameCount?: number | undefined;
|
|
8
|
+
frameOffset?: number | undefined;
|
|
9
|
+
planeIndex: number;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
interface AudioDataInit {
|
|
13
|
+
data: AllowSharedBufferSource;
|
|
14
|
+
format: AudioSampleFormat;
|
|
15
|
+
numberOfChannels: number;
|
|
16
|
+
numberOfFrames: number;
|
|
17
|
+
sampleRate: number;
|
|
18
|
+
timestamp: number;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
interface AudioDecoderConfig {
|
|
22
|
+
codec: string;
|
|
23
|
+
description?: AllowSharedBufferSource | undefined;
|
|
24
|
+
numberOfChannels: number;
|
|
25
|
+
sampleRate: number;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
interface AudioDecoderInit {
|
|
29
|
+
error: WebCodecsErrorCallback;
|
|
30
|
+
output: AudioDataOutputCallback;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
interface AudioDecoderSupport {
|
|
34
|
+
config: AudioDecoderConfig;
|
|
35
|
+
supported: boolean;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
interface AudioEncoderConfig {
|
|
39
|
+
bitrate?: number | undefined;
|
|
40
|
+
codec: string;
|
|
41
|
+
numberOfChannels: number;
|
|
42
|
+
sampleRate: number;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
interface AudioEncoderInit {
|
|
46
|
+
error: WebCodecsErrorCallback;
|
|
47
|
+
output: EncodedAudioChunkOutputCallback;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
interface AudioEncoderSupport {
|
|
51
|
+
config: AudioEncoderConfig;
|
|
52
|
+
supported: boolean;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
interface AvcEncoderConfig {
|
|
56
|
+
format?: AvcBitstreamFormat | undefined;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
interface EncodedAudioChunkInit {
|
|
60
|
+
data: AllowSharedBufferSource;
|
|
61
|
+
duration?: number | undefined;
|
|
62
|
+
timestamp: number;
|
|
63
|
+
type: EncodedAudioChunkType;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
interface EncodedAudioChunkMetadata {
|
|
67
|
+
decoderConfig?: AudioDecoderConfig | undefined;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
interface EncodedVideoChunkInit {
|
|
71
|
+
data: AllowSharedBufferSource;
|
|
72
|
+
duration?: number | undefined;
|
|
73
|
+
timestamp: number;
|
|
74
|
+
type: EncodedVideoChunkType;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
interface EncodedVideoChunkMetadata {
|
|
78
|
+
decoderConfig?: VideoDecoderConfig | undefined;
|
|
79
|
+
temporalLayerId?: number | undefined;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
interface ImageDecodeOptions {
|
|
83
|
+
completeFramesOnly?: boolean | undefined;
|
|
84
|
+
frameIndex?: number | undefined;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
interface ImageDecodeResult {
|
|
88
|
+
complete: boolean;
|
|
89
|
+
image: VideoFrame;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
interface ImageDecoderInit {
|
|
93
|
+
colorSpaceConversion?: ColorSpaceConversion | undefined;
|
|
94
|
+
data: ImageBufferSource;
|
|
95
|
+
desiredHeight?: number | undefined;
|
|
96
|
+
desiredWidth?: number | undefined;
|
|
97
|
+
preferAnimation?: boolean | undefined;
|
|
98
|
+
premultiplyAlpha?: PremultiplyAlpha | undefined;
|
|
99
|
+
type: string;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
interface PlaneLayout {
|
|
103
|
+
offset: number;
|
|
104
|
+
stride: number;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
interface VideoColorSpaceInit {
|
|
108
|
+
fullRange?: boolean | null | undefined;
|
|
109
|
+
matrix?: VideoMatrixCoefficients | null | undefined;
|
|
110
|
+
primaries?: VideoColorPrimaries | null | undefined;
|
|
111
|
+
transfer?: VideoTransferCharacteristics | null | undefined;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
interface VideoDecoderConfig {
|
|
115
|
+
codec: string;
|
|
116
|
+
codedHeight?: number | undefined;
|
|
117
|
+
codedWidth?: number | undefined;
|
|
118
|
+
colorSpace?: VideoColorSpaceInit | undefined;
|
|
119
|
+
description?: AllowSharedBufferSource | undefined;
|
|
120
|
+
displayAspectHeight?: number | undefined;
|
|
121
|
+
displayAspectWidth?: number | undefined;
|
|
122
|
+
hardwareAcceleration?: HardwarePreference | undefined;
|
|
123
|
+
optimizeForLatency?: boolean | undefined;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
interface VideoDecoderInit {
|
|
127
|
+
error: WebCodecsErrorCallback;
|
|
128
|
+
output: VideoFrameOutputCallback;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
interface VideoDecoderSupport {
|
|
132
|
+
config?: VideoDecoderConfig;
|
|
133
|
+
supported?: boolean;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
interface VideoEncoderConfig {
|
|
137
|
+
alpha?: AlphaOption | undefined;
|
|
138
|
+
avc?: AvcEncoderConfig | undefined;
|
|
139
|
+
bitrate?: number | undefined;
|
|
140
|
+
bitrateMode?: VideoEncoderBitrateMode | undefined;
|
|
141
|
+
codec: string;
|
|
142
|
+
displayHeight?: number | undefined;
|
|
143
|
+
displayWidth?: number | undefined;
|
|
144
|
+
framerate?: number | undefined;
|
|
145
|
+
hardwareAcceleration?: HardwarePreference | undefined;
|
|
146
|
+
height: number;
|
|
147
|
+
latencyMode?: LatencyMode | undefined;
|
|
148
|
+
scalabilityMode?: string | undefined;
|
|
149
|
+
width: number;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
interface VideoEncoderEncodeOptions {
|
|
153
|
+
keyFrame?: boolean;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
interface VideoEncoderInit {
|
|
157
|
+
error: WebCodecsErrorCallback;
|
|
158
|
+
output: EncodedVideoChunkOutputCallback;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
interface VideoEncoderSupport {
|
|
162
|
+
config?: VideoEncoderConfig;
|
|
163
|
+
supported?: boolean;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
interface VideoFrameBufferInit {
|
|
167
|
+
codedHeight: number;
|
|
168
|
+
codedWidth: number;
|
|
169
|
+
colorSpace?: VideoColorSpaceInit | undefined;
|
|
170
|
+
displayHeight?: number | undefined;
|
|
171
|
+
displayWidth?: number | undefined;
|
|
172
|
+
duration?: number | undefined;
|
|
173
|
+
format: VideoPixelFormat;
|
|
174
|
+
layout?: PlaneLayout[] | undefined;
|
|
175
|
+
timestamp: number;
|
|
176
|
+
visibleRect?: DOMRectInit | undefined;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
interface VideoFrameCopyToOptions {
|
|
180
|
+
layout?: PlaneLayout[] | undefined;
|
|
181
|
+
rect?: DOMRectInit | undefined;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
interface VideoFrameInit {
|
|
185
|
+
alpha?: AlphaOption | undefined;
|
|
186
|
+
displayHeight?: number | undefined;
|
|
187
|
+
displayWidth?: number | undefined;
|
|
188
|
+
duration?: number | undefined;
|
|
189
|
+
timestamp?: number | undefined;
|
|
190
|
+
visibleRect?: DOMRectInit | undefined;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
interface AudioData {
|
|
194
|
+
readonly duration: number;
|
|
195
|
+
readonly format: AudioSampleFormat;
|
|
196
|
+
readonly numberOfChannels: number;
|
|
197
|
+
readonly numberOfFrames: number;
|
|
198
|
+
readonly sampleRate: number;
|
|
199
|
+
readonly timestamp: number;
|
|
200
|
+
allocationSize(options: AudioDataCopyToOptions): number;
|
|
201
|
+
clone(): AudioData;
|
|
202
|
+
close(): void;
|
|
203
|
+
copyTo(destination: AllowSharedBufferSource, options: AudioDataCopyToOptions): void;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
declare var AudioData: {
|
|
207
|
+
prototype: AudioData;
|
|
208
|
+
new(init: AudioDataInit): AudioData;
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
/** Available only in secure contexts. */
|
|
212
|
+
interface AudioDecoder {
|
|
213
|
+
readonly decodeQueueSize: number;
|
|
214
|
+
readonly state: CodecState;
|
|
215
|
+
close(): void;
|
|
216
|
+
configure(config: AudioDecoderConfig): void;
|
|
217
|
+
decode(chunk: EncodedAudioChunk): void;
|
|
218
|
+
flush(): Promise<void>;
|
|
219
|
+
reset(): void;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
declare var AudioDecoder: {
|
|
223
|
+
prototype: AudioDecoder;
|
|
224
|
+
new(init: AudioDecoderInit): AudioDecoder;
|
|
225
|
+
isConfigSupported(config: AudioDecoderConfig): Promise<AudioDecoderSupport>;
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
/** Available only in secure contexts. */
|
|
229
|
+
interface AudioEncoder {
|
|
230
|
+
readonly encodeQueueSize: number;
|
|
231
|
+
readonly state: CodecState;
|
|
232
|
+
close(): void;
|
|
233
|
+
configure(config: AudioEncoderConfig): void;
|
|
234
|
+
encode(data: AudioData): void;
|
|
235
|
+
flush(): Promise<void>;
|
|
236
|
+
reset(): void;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
declare var AudioEncoder: {
|
|
240
|
+
prototype: AudioEncoder;
|
|
241
|
+
new(init: AudioEncoderInit): AudioEncoder;
|
|
242
|
+
isConfigSupported(config: AudioEncoderConfig): Promise<AudioEncoderSupport>;
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
interface EncodedAudioChunk {
|
|
246
|
+
readonly byteLength: number;
|
|
247
|
+
readonly duration: number | null;
|
|
248
|
+
readonly timestamp: number;
|
|
249
|
+
readonly type: EncodedAudioChunkType;
|
|
250
|
+
copyTo(destination: AllowSharedBufferSource): void;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
declare var EncodedAudioChunk: {
|
|
254
|
+
prototype: EncodedAudioChunk;
|
|
255
|
+
new(init: EncodedAudioChunkInit): EncodedAudioChunk;
|
|
256
|
+
};
|
|
257
|
+
|
|
258
|
+
interface EncodedVideoChunk {
|
|
259
|
+
readonly byteLength: number;
|
|
260
|
+
readonly duration: number | null;
|
|
261
|
+
readonly timestamp: number;
|
|
262
|
+
readonly type: EncodedVideoChunkType;
|
|
263
|
+
copyTo(destination: AllowSharedBufferSource): void;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
declare var EncodedVideoChunk: {
|
|
267
|
+
prototype: EncodedVideoChunk;
|
|
268
|
+
new(init: EncodedVideoChunkInit): EncodedVideoChunk;
|
|
269
|
+
};
|
|
270
|
+
|
|
271
|
+
/** Available only in secure contexts. */
|
|
272
|
+
interface ImageDecoder {
|
|
273
|
+
readonly complete: boolean;
|
|
274
|
+
readonly completed: Promise<void>;
|
|
275
|
+
readonly tracks: ImageTrackList;
|
|
276
|
+
readonly type: string;
|
|
277
|
+
close(): void;
|
|
278
|
+
decode(options?: ImageDecodeOptions): Promise<ImageDecodeResult>;
|
|
279
|
+
reset(): void;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
declare var ImageDecoder: {
|
|
283
|
+
prototype: ImageDecoder;
|
|
284
|
+
new(init: ImageDecoderInit): ImageDecoder;
|
|
285
|
+
isTypeSupported(type: string): Promise<boolean>;
|
|
286
|
+
};
|
|
287
|
+
|
|
288
|
+
interface ImageTrack {
|
|
289
|
+
readonly animated: boolean;
|
|
290
|
+
readonly frameCount: number;
|
|
291
|
+
readonly repetitionCount: number;
|
|
292
|
+
selected: boolean;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
declare var ImageTrack: {
|
|
296
|
+
prototype: ImageTrack;
|
|
297
|
+
new(): ImageTrack;
|
|
298
|
+
};
|
|
299
|
+
|
|
300
|
+
interface ImageTrackList {
|
|
301
|
+
readonly length: number;
|
|
302
|
+
readonly ready: Promise<void>;
|
|
303
|
+
readonly selectedIndex: number;
|
|
304
|
+
readonly selectedTrack: ImageTrack | null;
|
|
305
|
+
[index: number]: ImageTrack;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
declare var ImageTrackList: {
|
|
309
|
+
prototype: ImageTrackList;
|
|
310
|
+
new(): ImageTrackList;
|
|
311
|
+
};
|
|
312
|
+
|
|
313
|
+
interface VideoColorSpace {
|
|
314
|
+
readonly fullRange: boolean | null;
|
|
315
|
+
readonly matrix: VideoMatrixCoefficients | null;
|
|
316
|
+
readonly primaries: VideoColorPrimaries | null;
|
|
317
|
+
readonly transfer: VideoTransferCharacteristics | null;
|
|
318
|
+
toJSON(): VideoColorSpaceInit;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
declare var VideoColorSpace: {
|
|
322
|
+
prototype: VideoColorSpace;
|
|
323
|
+
new(init?: VideoColorSpaceInit): VideoColorSpace;
|
|
324
|
+
};
|
|
325
|
+
|
|
326
|
+
/** Available only in secure contexts. */
|
|
327
|
+
interface VideoDecoder {
|
|
328
|
+
readonly decodeQueueSize: number;
|
|
329
|
+
readonly state: CodecState;
|
|
330
|
+
close(): void;
|
|
331
|
+
configure(config: VideoDecoderConfig): void;
|
|
332
|
+
decode(chunk: EncodedVideoChunk): void;
|
|
333
|
+
flush(): Promise<void>;
|
|
334
|
+
reset(): void;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
declare var VideoDecoder: {
|
|
338
|
+
prototype: VideoDecoder;
|
|
339
|
+
new(init: VideoDecoderInit): VideoDecoder;
|
|
340
|
+
isConfigSupported(config: VideoDecoderConfig): Promise<VideoDecoderSupport>;
|
|
341
|
+
};
|
|
342
|
+
|
|
343
|
+
/** Available only in secure contexts. */
|
|
344
|
+
interface VideoEncoder {
|
|
345
|
+
readonly encodeQueueSize: number;
|
|
346
|
+
readonly state: CodecState;
|
|
347
|
+
close(): void;
|
|
348
|
+
configure(config: VideoEncoderConfig): void;
|
|
349
|
+
encode(frame: VideoFrame, options?: VideoEncoderEncodeOptions): void;
|
|
350
|
+
flush(): Promise<void>;
|
|
351
|
+
reset(): void;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
declare var VideoEncoder: {
|
|
355
|
+
prototype: VideoEncoder;
|
|
356
|
+
new(init: VideoEncoderInit): VideoEncoder;
|
|
357
|
+
isConfigSupported(config: VideoEncoderConfig): Promise<VideoEncoderSupport>;
|
|
358
|
+
};
|
|
359
|
+
|
|
360
|
+
interface VideoFrame {
|
|
361
|
+
readonly codedHeight: number;
|
|
362
|
+
readonly codedRect: DOMRectReadOnly | null;
|
|
363
|
+
readonly codedWidth: number;
|
|
364
|
+
readonly colorSpace: VideoColorSpace;
|
|
365
|
+
readonly displayHeight: number;
|
|
366
|
+
readonly displayWidth: number;
|
|
367
|
+
readonly duration: number | null;
|
|
368
|
+
readonly format: VideoPixelFormat | null;
|
|
369
|
+
readonly timestamp: number;
|
|
370
|
+
readonly visibleRect: DOMRectReadOnly | null;
|
|
371
|
+
allocationSize(options?: VideoFrameCopyToOptions): number;
|
|
372
|
+
clone(): VideoFrame;
|
|
373
|
+
close(): void;
|
|
374
|
+
copyTo(destination: AllowSharedBufferSource, options?: VideoFrameCopyToOptions): Promise<PlaneLayout[]>;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
declare var VideoFrame: {
|
|
378
|
+
prototype: VideoFrame;
|
|
379
|
+
new(source: CanvasImageSource, init?: VideoFrameInit): VideoFrame;
|
|
380
|
+
new(data: AllowSharedBufferSource, init: VideoFrameBufferInit): VideoFrame;
|
|
381
|
+
};
|
|
382
|
+
|
|
383
|
+
interface AudioDataOutputCallback {
|
|
384
|
+
(output: AudioData): void;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
interface EncodedAudioChunkOutputCallback {
|
|
388
|
+
(output: EncodedAudioChunk, metadata: EncodedAudioChunkMetadata): void;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
interface EncodedVideoChunkOutputCallback {
|
|
392
|
+
(chunk: EncodedVideoChunk, metadata: EncodedVideoChunkMetadata): void;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
interface VideoFrameOutputCallback {
|
|
396
|
+
(output: VideoFrame): void;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
interface WebCodecsErrorCallback {
|
|
400
|
+
(error: DOMException): void;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
// type AllowSharedBufferSource = ArrayBuffer | ArrayBufferView;
|
|
404
|
+
// type BitrateMode = "constant" | "variable";
|
|
405
|
+
type ImageBufferSource = ArrayBuffer | ArrayBufferView | ReadableStream;
|
|
406
|
+
// type AlphaOption = "discard" | "keep";
|
|
407
|
+
type AudioSampleFormat = "f32" | "f32-planar" | "s16" | "s16-planar" | "s32" | "s32-planar" | "u8" | "u8-planar";
|
|
408
|
+
// type AvcBitstreamFormat = "annexb" | "avc";
|
|
409
|
+
// type CodecState = "closed" | "configured" | "unconfigured";
|
|
410
|
+
type EncodedAudioChunkType = "delta" | "key";
|
|
411
|
+
// type EncodedVideoChunkType = "delta" | "key";
|
|
412
|
+
type HardwarePreference = "no-preference" | "prefer-hardware" | "prefer-software";
|
|
413
|
+
// type LatencyMode = "quality" | "realtime";
|
|
414
|
+
// type VideoColorPrimaries = "bt470bg" | "bt709" | "smpte170m";
|
|
415
|
+
// type VideoMatrixCoefficients = "bt470bg" | "bt709" | "rgb" | "smpte170m";
|
|
416
|
+
// type VideoPixelFormat = "BGRA" | "BGRX" | "I420" | "I420A" | "I422" | "I444" | "NV12" | "RGBA" | "RGBX";
|
|
417
|
+
// type VideoTransferCharacteristics = "bt709" | "iec61966-2-1" | "smpte170m";
|
|
@@ -34,6 +34,7 @@ export default class WebsocketChannel extends EventBase<CHANNEL_EVENT_TYPE, Chan
|
|
|
34
34
|
close(): Promise<void>;
|
|
35
35
|
sendMsg(msg: Msg.CloudLark.ToServerMessage): void;
|
|
36
36
|
sendBuffer(data: ArrayBuffer): void;
|
|
37
|
+
sendKeepAlive(): void;
|
|
37
38
|
isOpen(): boolean;
|
|
38
39
|
private startKeepAlive;
|
|
39
40
|
private stopKeepAlive;
|
|
@@ -21,6 +21,7 @@ export default class WebsocketProxy extends EventBase<PROXY_EVENT_TYPE, ProxyEve
|
|
|
21
21
|
private config;
|
|
22
22
|
private connection;
|
|
23
23
|
private keepAliveTimeout;
|
|
24
|
+
private timerWorker;
|
|
24
25
|
private larksr;
|
|
25
26
|
constructor(config: ProxyConfig, larksr: LarkSR);
|
|
26
27
|
/**
|
|
@@ -34,6 +35,7 @@ export default class WebsocketProxy extends EventBase<PROXY_EVENT_TYPE, ProxyEve
|
|
|
34
35
|
isOpen(): boolean;
|
|
35
36
|
sendMsg(msg: Msg.CloudLark.ToServerMessage): void;
|
|
36
37
|
sendBuffer(data: ArrayBuffer): void;
|
|
38
|
+
sendKeepAlive(): void;
|
|
37
39
|
private startKeepAlive;
|
|
38
40
|
private stopKeepAlive;
|
|
39
41
|
/**
|