larksr_websdk 3.2.344 → 3.2.402
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/larksr-web-sdk.min.js +1 -1
- package/dist/types/api.d.ts +4 -3
- package/dist/types/appli_params.d.ts +8 -4
- package/dist/types/lark/application.d.ts +28 -1
- package/dist/types/lark/media_share_interface.d.ts +1 -0
- package/dist/types/lark/message.d.ts +2 -2
- package/dist/types/lark/peer_connection.d.ts +11 -2
- package/dist/types/lark/peer_connection_media_share.d.ts +63 -8
- package/dist/types/lark/sdp_util.d.ts +7 -4
- package/dist/types/larksr.d.ts +79 -5
- package/dist/types/localization/language.d.ts +2 -1
- package/dist/types/operation/operation.d.ts +5 -0
- package/dist/types/screen_state.d.ts +10 -2
- package/dist/types/utils/unit.d.ts +6 -0
- package/dist/types/utils/webgl_utils.d.ts +48 -0
- package/package.json +2 -2
- package/types/api.d.ts +4 -3
- package/types/appli_params.d.ts +8 -4
- package/types/lark/application.d.ts +28 -1
- package/types/lark/media_share_interface.d.ts +1 -0
- package/types/lark/message.d.ts +2 -2
- package/types/lark/peer_connection.d.ts +11 -2
- package/types/lark/peer_connection_media_share.d.ts +63 -8
- package/types/lark/sdp_util.d.ts +7 -4
- package/types/larksr.d.ts +79 -5
- package/types/localization/language.d.ts +2 -1
- package/types/operation/operation.d.ts +5 -0
- package/types/screen_state.d.ts +10 -2
- package/types/utils/unit.d.ts +6 -0
- package/types/utils/webgl_utils.d.ts +48 -0
- package/dist/doc/config.md +0 -228
- package/dist/doc/event_codes.md +0 -286
- package/dist/doc/events.md +0 -229
- package/dist/doc/functions.md +0 -603
- package/dist/doc/index.md +0 -83
- package/dist/doc/member_variables.md +0 -407
- package/dist/doc/sdkid_encryption.md +0 -40
- package/dist/doc/update.md +0 -462
package/dist/types/api.d.ts
CHANGED
|
@@ -72,11 +72,12 @@ export interface StartAppInfo {
|
|
|
72
72
|
rttLimitInterval: string;
|
|
73
73
|
playerMode?: number;
|
|
74
74
|
userType?: number;
|
|
75
|
-
|
|
75
|
+
authCode?: string;
|
|
76
76
|
nickName?: string;
|
|
77
77
|
nickname?: string;
|
|
78
78
|
appKey?: string;
|
|
79
79
|
groupId?: string;
|
|
80
|
+
initResolutionType?: number;
|
|
80
81
|
}
|
|
81
82
|
declare type HostAppliGetUrlReturnParams = {
|
|
82
83
|
appliId: string;
|
|
@@ -100,7 +101,7 @@ export default class API {
|
|
|
100
101
|
appliId: string;
|
|
101
102
|
playerMode?: number;
|
|
102
103
|
userType?: number;
|
|
103
|
-
|
|
104
|
+
authCode?: string;
|
|
104
105
|
taskId?: string;
|
|
105
106
|
}): Promise<{
|
|
106
107
|
host: string;
|
|
@@ -112,7 +113,7 @@ export default class API {
|
|
|
112
113
|
appliId: string;
|
|
113
114
|
playerMode?: number;
|
|
114
115
|
userType?: number;
|
|
115
|
-
|
|
116
|
+
authCode?: string;
|
|
116
117
|
taskId?: string;
|
|
117
118
|
clientMac?: string;
|
|
118
119
|
groupId?: string;
|
|
@@ -30,6 +30,7 @@ export interface IAppliParams {
|
|
|
30
30
|
* taskid
|
|
31
31
|
*/
|
|
32
32
|
taskid: string;
|
|
33
|
+
taskId: string;
|
|
33
34
|
/**
|
|
34
35
|
* 当前应用名称
|
|
35
36
|
*/
|
|
@@ -136,7 +137,7 @@ export interface IAppliParams {
|
|
|
136
137
|
/**
|
|
137
138
|
* 口令:8位唯一码,写入TaskInfo. 房间code,备用。
|
|
138
139
|
*/
|
|
139
|
-
|
|
140
|
+
authCode: string;
|
|
140
141
|
/**
|
|
141
142
|
* debug task. 跳过task检测
|
|
142
143
|
*/
|
|
@@ -176,7 +177,7 @@ export interface IAppliParams {
|
|
|
176
177
|
/**
|
|
177
178
|
* 优先使用的解码器
|
|
178
179
|
*/
|
|
179
|
-
preferDecoder: 'auto' | 'vp8' | 'vp9' | 'h264' | 'h265' | 'hevc' | 'av1x';
|
|
180
|
+
preferDecoder: 'auto' | 'vp8' | 'vp9' | 'h264' | 'h265' | 'hevc' | 'av1' | 'av1x';
|
|
180
181
|
/**
|
|
181
182
|
* 触摸操作对应的操作方式,触摸屏还是鼠标
|
|
182
183
|
*/
|
|
@@ -202,6 +203,7 @@ export interface IAppliParams {
|
|
|
202
203
|
liveStreaming: boolean;
|
|
203
204
|
useSeparateMediaSharePeer: boolean;
|
|
204
205
|
mobileKeyboardType: number;
|
|
206
|
+
initResolutionType: number;
|
|
205
207
|
}
|
|
206
208
|
export declare enum AppliType {
|
|
207
209
|
DESKTOP = 1,
|
|
@@ -222,6 +224,7 @@ export declare class AppliParams implements IAppliParams {
|
|
|
222
224
|
wsProxy: boolean;
|
|
223
225
|
preferPubOutIp: string;
|
|
224
226
|
taskid: string;
|
|
227
|
+
get taskId(): string;
|
|
225
228
|
appliName: string;
|
|
226
229
|
width: number;
|
|
227
230
|
height: number;
|
|
@@ -244,7 +247,7 @@ export declare class AppliParams implements IAppliParams {
|
|
|
244
247
|
playerMode: number;
|
|
245
248
|
userType: number;
|
|
246
249
|
nickname: string;
|
|
247
|
-
|
|
250
|
+
authCode: string;
|
|
248
251
|
debugTask: boolean;
|
|
249
252
|
debugWebServer: string;
|
|
250
253
|
loadingTimeout: number;
|
|
@@ -253,7 +256,7 @@ export declare class AppliParams implements IAppliParams {
|
|
|
253
256
|
mobileVirtualJoystick: boolean;
|
|
254
257
|
mouseZoomDirection: number;
|
|
255
258
|
showPlayerList: boolean;
|
|
256
|
-
preferDecoder: 'auto' | 'vp8' | 'vp9' | 'h264' | 'h265' | 'hevc' | 'av1x';
|
|
259
|
+
preferDecoder: 'auto' | 'vp8' | 'vp9' | 'h264' | 'h265' | 'hevc' | 'av1' | 'av1x';
|
|
257
260
|
touchOperateMode: 'touchScreen' | 'mouse';
|
|
258
261
|
appliId: string;
|
|
259
262
|
syncLocalToCloudClipboard: boolean;
|
|
@@ -270,6 +273,7 @@ export declare class AppliParams implements IAppliParams {
|
|
|
270
273
|
liveStreaming: boolean;
|
|
271
274
|
useSeparateMediaSharePeer: boolean;
|
|
272
275
|
mobileKeyboardType: number;
|
|
276
|
+
initResolutionType: number;
|
|
273
277
|
static copyAndCreate(params?: IAppliParams): AppliParams;
|
|
274
278
|
static setUpWithSDKConfig(params: IAppliParams, config: ILarkSRConfig): AppliParams;
|
|
275
279
|
}
|
|
@@ -5,6 +5,7 @@ import WebsocketProxy from './websocket_proxy';
|
|
|
5
5
|
import { LarkSR } from '../larksr';
|
|
6
6
|
import PixelStreamingWebsocketChannel from './test_pixel_streaming';
|
|
7
7
|
import { RECORDER_STATE } from './recoder';
|
|
8
|
+
import PeerConnectionMediaShare from './peer_connection_media_share';
|
|
8
9
|
export declare enum APP_STATE {
|
|
9
10
|
BEFORE_CREATE = 0,
|
|
10
11
|
INITED = 1,
|
|
@@ -45,17 +46,21 @@ export declare enum APP_EVENT_TYPE {
|
|
|
45
46
|
AI_VOICE_ERROR = 21,
|
|
46
47
|
RTMP_STREAM_STATE = 22,
|
|
47
48
|
RTMP_STREAM_ERROR = 23,
|
|
48
|
-
RTC_RETRY_SUCCESS = 24
|
|
49
|
+
RTC_RETRY_SUCCESS = 24,
|
|
50
|
+
AerialViewStatus = 25,
|
|
51
|
+
AerialViewScreen = 26
|
|
49
52
|
}
|
|
50
53
|
export interface AppEvent extends LocalEvent<APP_EVENT_TYPE> {
|
|
51
54
|
data?: any;
|
|
52
55
|
state: APP_STATE;
|
|
53
56
|
}
|
|
54
57
|
export default class Application extends EventBase<APP_EVENT_TYPE, AppEvent> {
|
|
58
|
+
MAX_MEDIA_SHARE_PEERCONNECTION: number;
|
|
55
59
|
private websocketChannel;
|
|
56
60
|
private websocketProxy;
|
|
57
61
|
private testPixelStreaming;
|
|
58
62
|
private peerConnection;
|
|
63
|
+
getMediaSharePeerConnection(index: number): PeerConnectionMediaShare;
|
|
59
64
|
private mediaSharePeerConnectionImp;
|
|
60
65
|
get peerConnectionCreated(): boolean;
|
|
61
66
|
get state(): APP_STATE;
|
|
@@ -68,6 +73,7 @@ export default class Application extends EventBase<APP_EVENT_TYPE, AppEvent> {
|
|
|
68
73
|
get audioPaused(): boolean | undefined;
|
|
69
74
|
get videoPaused(): boolean | undefined;
|
|
70
75
|
get serverFeatures(): Msg.CloudLark.INotifyFeatures | null | undefined;
|
|
76
|
+
get serverStatics(): Msg.CloudLark.IServerStatics | null | undefined;
|
|
71
77
|
private get sharePeerConnection();
|
|
72
78
|
private retryTime;
|
|
73
79
|
private larksr;
|
|
@@ -75,6 +81,7 @@ export default class Application extends EventBase<APP_EVENT_TYPE, AppEvent> {
|
|
|
75
81
|
get recodeState(): RECORDER_STATE;
|
|
76
82
|
private recoder;
|
|
77
83
|
private rtcConfig;
|
|
84
|
+
get currentAppSize(): Msg.CloudLark.IAppResize | null | undefined;
|
|
78
85
|
constructor(larksr: LarkSR);
|
|
79
86
|
init(): void;
|
|
80
87
|
initSharePc(): void;
|
|
@@ -87,6 +94,24 @@ export default class Application extends EventBase<APP_EVENT_TYPE, AppEvent> {
|
|
|
87
94
|
inputText(text: string): void;
|
|
88
95
|
sendTextToDataChannel(text: string): void;
|
|
89
96
|
sendBinaryToDataChannel(binary: Uint8Array): void;
|
|
97
|
+
sendReStartApplication(): void;
|
|
98
|
+
sendApplicationSize(width: number, height: number): void;
|
|
99
|
+
startAerialview(viewbox: {
|
|
100
|
+
x: number;
|
|
101
|
+
y: number;
|
|
102
|
+
width: number;
|
|
103
|
+
height: number;
|
|
104
|
+
}, interval: number | undefined, thumbnailWidth: 120, thumbnailHeight: 120): void;
|
|
105
|
+
updateAerialview(viewbox: {
|
|
106
|
+
x: number;
|
|
107
|
+
y: number;
|
|
108
|
+
width: number;
|
|
109
|
+
height: number;
|
|
110
|
+
}): void;
|
|
111
|
+
stopAerialview(): void;
|
|
112
|
+
sendShowDebugLayout(open: boolean): void;
|
|
113
|
+
sendVideoBitrateKbps(bitrateKbps: number): void;
|
|
114
|
+
sendVideoFps(fps: number): void;
|
|
90
115
|
aiDmTextInput(text: string): number;
|
|
91
116
|
startAiDmVoiceInput(): Promise<number>;
|
|
92
117
|
stopAiDmVoiceInput(): number;
|
|
@@ -130,6 +155,8 @@ export default class Application extends EventBase<APP_EVENT_TYPE, AppEvent> {
|
|
|
130
155
|
private onRtmpStreamingError;
|
|
131
156
|
private onIceStateChange;
|
|
132
157
|
retryPeerconnection(): void;
|
|
158
|
+
private onAerialViewStatus;
|
|
159
|
+
private onAerialViewScreen;
|
|
133
160
|
private onShareMediaError;
|
|
134
161
|
private onShareMediaInfo;
|
|
135
162
|
private onShareMediaOffer;
|
|
@@ -10,8 +10,8 @@ export default class Message {
|
|
|
10
10
|
static startMonitorStreamReqeuest(request: Msg.CloudLark.IVrMonitorRequest): Msg.CloudLark.ToServerMessage;
|
|
11
11
|
static rtcOfferMsg(type: string, sdp: string): Msg.CloudLark.ToServerMessage;
|
|
12
12
|
static iceMsg(sdpmid: string, sdpMlineindex: number, candidate: string, username: string | null | undefined): Msg.CloudLark.ToServerMessage;
|
|
13
|
-
static mediaShareRtcOfferMsg(type: string, sdp: string): Msg.CloudLark.ToServerMessage;
|
|
14
|
-
static mediaShareIceMsg(sdpmid: string, sdpMlineindex: number, candidate: string): Msg.CloudLark.ToServerMessage;
|
|
13
|
+
static mediaShareRtcOfferMsg(type: string, sdp: string, index: number): Msg.CloudLark.ToServerMessage;
|
|
14
|
+
static mediaShareIceMsg(sdpmid: string, sdpMlineindex: number, candidate: string, index: number): Msg.CloudLark.ToServerMessage;
|
|
15
15
|
static restartApp(): Msg.CloudLark.ToServerMessage;
|
|
16
16
|
static getTaskResponseMsg(ressponse: Msg.CloudLark.TaskResponse.Response): string;
|
|
17
17
|
static getStartStreamResponseMsg(ressponse: Msg.CloudLark.StartStreamResponse.Response): string;
|
|
@@ -34,7 +34,9 @@ export declare enum WEBRTC_EVENT_TYPE {
|
|
|
34
34
|
AI_VOICE_ERROR = 21,
|
|
35
35
|
RTMP_STREAM_STATE = 22,
|
|
36
36
|
RTMP_STREAM_ERROR = 23,
|
|
37
|
-
INFO = 24
|
|
37
|
+
INFO = 24,
|
|
38
|
+
AerialViewStatus = 25,
|
|
39
|
+
AerialViewScreen = 26
|
|
38
40
|
}
|
|
39
41
|
export interface GoogleBitRate {
|
|
40
42
|
start: number;
|
|
@@ -81,6 +83,9 @@ export interface AggregatedStats {
|
|
|
81
83
|
frameWidthStart: number;
|
|
82
84
|
currentRoundTripTime: number;
|
|
83
85
|
packetsLostPerc: number;
|
|
86
|
+
avgDecodeDelay: number;
|
|
87
|
+
avgProcessDelay: number;
|
|
88
|
+
serverStatics: Input.CloudLark.IServerStatics | null;
|
|
84
89
|
}
|
|
85
90
|
export default class PeerConnection extends EventBase<WEBRTC_EVENT_TYPE, WebRTCEvent> implements MediaShareInterface {
|
|
86
91
|
private config;
|
|
@@ -109,6 +114,10 @@ export default class PeerConnection extends EventBase<WEBRTC_EVENT_TYPE, WebRTCE
|
|
|
109
114
|
private canvasRender;
|
|
110
115
|
get serverFeatures(): CloudLark.INotifyFeatures | null;
|
|
111
116
|
private _serverFeatures;
|
|
117
|
+
get serverStatics(): CloudLark.IServerStatics | null;
|
|
118
|
+
private _serverStatics;
|
|
119
|
+
get currentAppSize(): CloudLark.IAppResize | null;
|
|
120
|
+
private _currentAppSize;
|
|
112
121
|
constructor(larksr: LarkSR, config: WebRTCConfig);
|
|
113
122
|
create(streams?: MediaStream | undefined | null, config?: CloudLark.IRTCConfiguration | null | undefined): Promise<void>;
|
|
114
123
|
createOffer(): void;
|
|
@@ -159,7 +168,7 @@ export default class PeerConnection extends EventBase<WEBRTC_EVENT_TYPE, WebRTCE
|
|
|
159
168
|
private resumeOrCreateBinding;
|
|
160
169
|
addMediaTrack(track: MediaStreamTrack, ...streams: MediaStream[]): boolean;
|
|
161
170
|
removeMediaTrack(track: RTCRtpSender): boolean;
|
|
162
|
-
requestUserMediaPermission(constraints?: MediaStreamConstraints): Promise<
|
|
171
|
+
requestUserMediaPermission(constraints?: MediaStreamConstraints): Promise<unknown>;
|
|
163
172
|
/**
|
|
164
173
|
* 接收到sdp
|
|
165
174
|
* @param des sdp
|
|
@@ -2,20 +2,46 @@ import { EventBase, LocalEvent } from '../event/event_base';
|
|
|
2
2
|
import { LarkSR } from '../larksr';
|
|
3
3
|
import { MediaShareInterface, RTCMediaTrackBinding } from './media_share_interface';
|
|
4
4
|
import { CloudLark } from '@/protobuf/cloudlark';
|
|
5
|
+
import CanvasRender from './canvas_render';
|
|
5
6
|
export declare enum WEBRTC_MEDIA_SHARE_EVENT_TYPE {
|
|
6
|
-
RTC_SDP =
|
|
7
|
-
RTC_ICECANDIDATE =
|
|
8
|
-
ICE_STATE_CHANGE =
|
|
9
|
-
ERROR =
|
|
10
|
-
INFO =
|
|
7
|
+
RTC_SDP = "rtc_sdp",
|
|
8
|
+
RTC_ICECANDIDATE = "rtc_icecandidate",
|
|
9
|
+
ICE_STATE_CHANGE = "rtc_state_change",
|
|
10
|
+
ERROR = "rtc_error",
|
|
11
|
+
INFO = "rtc_info"
|
|
11
12
|
}
|
|
12
13
|
export interface WebRTCMediaShareEvent extends LocalEvent<WEBRTC_MEDIA_SHARE_EVENT_TYPE> {
|
|
13
14
|
data?: any;
|
|
15
|
+
id: number;
|
|
14
16
|
}
|
|
15
17
|
export interface WebRTCConfig {
|
|
16
18
|
serverIP: string;
|
|
17
19
|
preferPubOutIp: string;
|
|
18
20
|
}
|
|
21
|
+
export interface AggregatedSendStats {
|
|
22
|
+
timestamp: number;
|
|
23
|
+
bytesSent: number;
|
|
24
|
+
framesEncoded: number;
|
|
25
|
+
packetsLost: number;
|
|
26
|
+
bytesSentStart: number;
|
|
27
|
+
framesEncodedStart: number;
|
|
28
|
+
timestampStart: number;
|
|
29
|
+
bitrate: number;
|
|
30
|
+
lowBitrate: number;
|
|
31
|
+
highBitrate: number;
|
|
32
|
+
avgBitrate: number;
|
|
33
|
+
framerate: number;
|
|
34
|
+
lowFramerate: number;
|
|
35
|
+
highFramerate: number;
|
|
36
|
+
avgframerate: number;
|
|
37
|
+
framesSent: number;
|
|
38
|
+
frameHeight: number;
|
|
39
|
+
frameWidth: number;
|
|
40
|
+
frameHeightStart: number;
|
|
41
|
+
frameWidthStart: number;
|
|
42
|
+
currentRoundTripTime: number;
|
|
43
|
+
packetsLostPerc: number;
|
|
44
|
+
}
|
|
19
45
|
export default class PeerConnectionMediaShare extends EventBase<WEBRTC_MEDIA_SHARE_EVENT_TYPE, WebRTCMediaShareEvent> implements MediaShareInterface {
|
|
20
46
|
get audioDeviceId(): string | undefined;
|
|
21
47
|
get audioTrack(): MediaStreamTrack | undefined;
|
|
@@ -33,11 +59,40 @@ export default class PeerConnectionMediaShare extends EventBase<WEBRTC_MEDIA_SHA
|
|
|
33
59
|
private videoBinding;
|
|
34
60
|
private sdpCreateSuccess;
|
|
35
61
|
private readonly sendStream;
|
|
36
|
-
|
|
37
|
-
|
|
62
|
+
get canvasRender(): CanvasRender;
|
|
63
|
+
private _canvasRender;
|
|
64
|
+
private netTestTimeout;
|
|
65
|
+
get aggregatedStats(): AggregatedSendStats | null;
|
|
66
|
+
private set aggregatedStats(value);
|
|
67
|
+
private _aggregatedStats;
|
|
68
|
+
private lastThrowBadNetork;
|
|
69
|
+
private lastPacktetsLost;
|
|
70
|
+
private lastPacktetsReceived;
|
|
71
|
+
set preferVideoCode(code: 'auto' | 'vp8' | 'vp9' | 'h264' | 'h265' | 'hevc' | 'av1x');
|
|
72
|
+
get preferVideoCode(): 'auto' | 'vp8' | 'vp9' | 'h264' | 'h265' | 'hevc' | 'av1x';
|
|
73
|
+
private _preferDecoder;
|
|
74
|
+
set codeRate(codeRate: {
|
|
75
|
+
start: number;
|
|
76
|
+
min: number;
|
|
77
|
+
max: number;
|
|
78
|
+
});
|
|
79
|
+
get codeRate(): {
|
|
80
|
+
start: number;
|
|
81
|
+
min: number;
|
|
82
|
+
max: number;
|
|
83
|
+
};
|
|
84
|
+
private _codeRate;
|
|
85
|
+
get id(): number;
|
|
86
|
+
private _id;
|
|
87
|
+
set forceRenderToCanvas(force: boolean);
|
|
88
|
+
get forceRenderToCanvas(): boolean;
|
|
89
|
+
private _forceRenderToCanvas;
|
|
90
|
+
constructor(larksr: LarkSR, id: number);
|
|
38
91
|
create(config?: CloudLark.IRTCConfiguration | null | undefined): Promise<void>;
|
|
39
92
|
createOffer(): void;
|
|
40
93
|
close(): void;
|
|
94
|
+
getStats(): Promise<AggregatedSendStats>;
|
|
95
|
+
getStateChrome(): Promise<AggregatedSendStats>;
|
|
41
96
|
setAudioEnable(enable: boolean): void;
|
|
42
97
|
setVideoEnable(enable: boolean): void;
|
|
43
98
|
setShareEnable(enable: boolean): void;
|
|
@@ -84,7 +139,7 @@ export default class PeerConnectionMediaShare extends EventBase<WEBRTC_MEDIA_SHA
|
|
|
84
139
|
private resumeOrCreateBinding;
|
|
85
140
|
addMediaTrack(track: MediaStreamTrack, ...streams: MediaStream[]): boolean;
|
|
86
141
|
removeMediaTrack(track: RTCRtpSender): boolean;
|
|
87
|
-
requestUserMediaPermission(constraints?: MediaStreamConstraints): Promise<
|
|
142
|
+
requestUserMediaPermission(constraints?: MediaStreamConstraints): Promise<unknown>;
|
|
88
143
|
/**
|
|
89
144
|
* 接收到sdp
|
|
90
145
|
* @param des sdp
|
|
@@ -3,32 +3,35 @@ export default class SdpUtil {
|
|
|
3
3
|
private static vp9;
|
|
4
4
|
private static h264;
|
|
5
5
|
private static av1x;
|
|
6
|
+
private static av1;
|
|
6
7
|
private static h265;
|
|
7
8
|
private static hevc;
|
|
8
9
|
private static svac;
|
|
9
10
|
private static tail;
|
|
10
11
|
private static config;
|
|
11
12
|
static isLoopIpAddress(ip: string): boolean;
|
|
12
|
-
static getRtpmapRegByMode(mode: 'VP8' | 'VP9' | 'H264' | 'AV1X' | 'H265' | 'HEVC' | 'SVAC'): RegExp;
|
|
13
|
+
static getRtpmapRegByMode(mode: 'VP8' | 'VP9' | 'H264' | 'AV1' | 'AV1X' | 'H265' | 'HEVC' | 'SVAC'): RegExp;
|
|
13
14
|
static hasVp8(sdp: string): boolean;
|
|
14
15
|
static hasVp9(sdp: string): boolean;
|
|
15
16
|
static hasH264(sdp: string): boolean;
|
|
17
|
+
static hasAV1(sdp: string): boolean;
|
|
16
18
|
static hasAV1X(sdp: string): boolean;
|
|
17
19
|
static hasH265(sdp: string): boolean;
|
|
18
20
|
static hasHEVC(sdp: string): boolean;
|
|
19
21
|
static hasSVAC(sdp: string): boolean;
|
|
20
|
-
static hasMode(sdp: string, mode: 'VP8' | 'VP9' | 'H264' | 'AV1X' | 'H265' | 'HEVC' | 'SVAC'): boolean;
|
|
22
|
+
static hasMode(sdp: string, mode: 'VP8' | 'VP9' | 'H264' | 'AV1' | 'AV1X' | 'H265' | 'HEVC' | 'SVAC'): boolean;
|
|
21
23
|
static setAudioBitrate(sdp: string, bitrate: number): string;
|
|
22
24
|
static setBitRate(sdp: string, startBitrate: number, maxBitrate: number, minBitrate: number): string;
|
|
23
|
-
static setModeBitRate(sdp: string, startBitrate: number, maxBitrate: number, minBitrate: number, mode: 'VP8' | 'VP9' | 'H264' | 'AV1X'): string;
|
|
25
|
+
static setModeBitRate(sdp: string, startBitrate: number, maxBitrate: number, minBitrate: number, mode: 'VP8' | 'VP9' | 'H264' | 'AV1' | 'AV1X'): string;
|
|
24
26
|
static removeVp8(sdp: string): string;
|
|
25
27
|
static removeVp9(sdp: string): string;
|
|
26
28
|
static removeH264(sdp: string): string;
|
|
29
|
+
static removeAV1(sdp: string): string;
|
|
27
30
|
static removeAV1X(sdp: string): string;
|
|
28
31
|
static removeH265(sdp: string): string;
|
|
29
32
|
static removeHEVC(sdp: string): string;
|
|
30
33
|
static removeSVAC(sdp: string): string;
|
|
31
|
-
static sdpFilter(sdp: string, mode: 'VP8' | 'VP9' | 'H264' | 'AV1X' | 'H265' | 'HEVC' | 'SVAC'): string;
|
|
34
|
+
static sdpFilter(sdp: string, mode: 'VP8' | 'VP9' | 'H264' | 'AV1' | 'AV1X' | 'H265' | 'HEVC' | 'SVAC'): string;
|
|
32
35
|
static sdpGooAttrLine(...attrs: string[]): string;
|
|
33
36
|
static sdpBlankAttrLine(...attrs: string[]): string;
|
|
34
37
|
static getBlankAttrs(sdpLine: string): string[];
|
package/dist/types/larksr.d.ts
CHANGED
|
@@ -241,7 +241,12 @@ declare enum LarkSRClientEvent {
|
|
|
241
241
|
* 服务端 3.2.7.0 添加
|
|
242
242
|
* rtmp 直播推流出错
|
|
243
243
|
*/
|
|
244
|
-
RTMP_STREAM_ERROR = "rtmpstreamerror"
|
|
244
|
+
RTMP_STREAM_ERROR = "rtmpstreamerror",
|
|
245
|
+
/**
|
|
246
|
+
* 服务端 3.2.2.x 添加
|
|
247
|
+
* 鸟瞰模式背景缩略图
|
|
248
|
+
*/
|
|
249
|
+
AERIAL_VIEW_SCREEN = "aerialviewscreen"
|
|
245
250
|
}
|
|
246
251
|
/**
|
|
247
252
|
* LarkSR 发出的事件
|
|
@@ -457,8 +462,8 @@ interface ILarkSRConfig {
|
|
|
457
462
|
showPlayButton?: boolean;
|
|
458
463
|
/**
|
|
459
464
|
* 可选项
|
|
460
|
-
*
|
|
461
|
-
* zh-CN
|
|
465
|
+
* 语言设置,目前支持中文简体、中文繁体、英文三种,默认中文简体
|
|
466
|
+
* zh-CN 中文简体 zh-TW 中文繁体 en 英文
|
|
462
467
|
*/
|
|
463
468
|
language?: string;
|
|
464
469
|
/**
|
|
@@ -475,11 +480,21 @@ interface ILarkSRConfig {
|
|
|
475
480
|
* 是否启用 canvas 渲染. 默认关闭
|
|
476
481
|
*/
|
|
477
482
|
enableCanvasRender?: boolean;
|
|
483
|
+
/**
|
|
484
|
+
* 强制使用canvs2d模式,默认优先使用 webgl
|
|
485
|
+
*/
|
|
486
|
+
forceCanvas2d?: boolean;
|
|
478
487
|
/**
|
|
479
488
|
* 可选项
|
|
480
489
|
* loading页载入Logo版本
|
|
481
490
|
*/
|
|
482
491
|
loadingLogoVersion?: string;
|
|
492
|
+
/**
|
|
493
|
+
* 初始化分辨率方式
|
|
494
|
+
* 1:适应客户端窗口】和【0:应用默认分辨率】,默认值:0
|
|
495
|
+
* 此处配置优先级大于管理后台配置
|
|
496
|
+
*/
|
|
497
|
+
initResolutionType?: number;
|
|
483
498
|
}
|
|
484
499
|
declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
|
|
485
500
|
/**
|
|
@@ -517,6 +532,7 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
|
|
|
517
532
|
get remoteScreenReady(): boolean;
|
|
518
533
|
set remoteScreenReady(ready: boolean);
|
|
519
534
|
private _remoteScreenReady;
|
|
535
|
+
onFirstAppsize(width: number, height: number): void;
|
|
520
536
|
/**
|
|
521
537
|
* 当前的屏幕状态
|
|
522
538
|
* @see ScreenState
|
|
@@ -656,10 +672,67 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
|
|
|
656
672
|
* 视频通道是否暂停
|
|
657
673
|
*/
|
|
658
674
|
get videoPaused(): boolean | undefined;
|
|
675
|
+
/**
|
|
676
|
+
* 获取媒体通道,后续可以调用媒体通道的相关接口,如打开摄像头等
|
|
677
|
+
* 原有 larksr 对象中的媒体通道相当于序号 0
|
|
678
|
+
* @param index 媒体上传通道序号 0 - 5
|
|
679
|
+
* @returns
|
|
680
|
+
*/
|
|
681
|
+
getMediaSharePeerConnection(index: number): import("./lark/peer_connection_media_share").default;
|
|
659
682
|
/**
|
|
660
683
|
* 服务器支持的功能列表
|
|
661
684
|
*/
|
|
662
685
|
get serverFeatures(): CloudLark.INotifyFeatures | null | undefined;
|
|
686
|
+
get serverStatics(): CloudLark.IServerStatics | null | undefined;
|
|
687
|
+
/**
|
|
688
|
+
* 动态设置码率 单位 kbps
|
|
689
|
+
* @param bitrateKbps
|
|
690
|
+
*/
|
|
691
|
+
setVideoBitrateKbps(bitrateKbps: number): void;
|
|
692
|
+
/**
|
|
693
|
+
* 动态设置帧率
|
|
694
|
+
*/
|
|
695
|
+
setVideoFps(fps: number): void;
|
|
696
|
+
/**
|
|
697
|
+
* 动态设置云端 debug 窗口
|
|
698
|
+
*/
|
|
699
|
+
setCloudDebugLayout(open: boolean): void;
|
|
700
|
+
/**
|
|
701
|
+
* 重启云端应用
|
|
702
|
+
*/
|
|
703
|
+
restartCloudApp(): void;
|
|
704
|
+
/**
|
|
705
|
+
* 设置云端应用大小
|
|
706
|
+
*/
|
|
707
|
+
setCloudAppSize(width: number, height: number): void;
|
|
708
|
+
/**
|
|
709
|
+
* 当前云端应用窗口大小
|
|
710
|
+
*/
|
|
711
|
+
get currentAppSize(): CloudLark.IAppResize | null | undefined;
|
|
712
|
+
/**
|
|
713
|
+
* 开始鸟瞰模式
|
|
714
|
+
*/
|
|
715
|
+
startAerialview(viewbox: {
|
|
716
|
+
x: number;
|
|
717
|
+
y: number;
|
|
718
|
+
width: number;
|
|
719
|
+
height: number;
|
|
720
|
+
}, interval: number | undefined, thumbnailWidth: 120, thumbnailHeight: 120): void;
|
|
721
|
+
/**
|
|
722
|
+
* 更新鸟瞰模式区域
|
|
723
|
+
*/
|
|
724
|
+
updateAerialview(viewbox: {
|
|
725
|
+
x: number;
|
|
726
|
+
y: number;
|
|
727
|
+
width: number;
|
|
728
|
+
height: number;
|
|
729
|
+
}): void;
|
|
730
|
+
/**
|
|
731
|
+
* 停止鸟瞰模式区域
|
|
732
|
+
*/
|
|
733
|
+
stopAerialview(): void;
|
|
734
|
+
get syncClientViewport(): boolean;
|
|
735
|
+
set syncClientViewport(sync: boolean);
|
|
663
736
|
/**
|
|
664
737
|
* LarkSR 客户端。所有操作和事件通过该类传递
|
|
665
738
|
* @param config 本地配置,优先级最高
|
|
@@ -687,7 +760,7 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
|
|
|
687
760
|
appliId: string;
|
|
688
761
|
playerMode?: number;
|
|
689
762
|
userType?: number;
|
|
690
|
-
|
|
763
|
+
authCode?: string;
|
|
691
764
|
taskId?: string;
|
|
692
765
|
regionId?: string;
|
|
693
766
|
groupId?: string;
|
|
@@ -725,7 +798,7 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
|
|
|
725
798
|
appliId: string;
|
|
726
799
|
playerMode?: number;
|
|
727
800
|
userType?: number;
|
|
728
|
-
|
|
801
|
+
authCode?: string;
|
|
729
802
|
taskId?: string;
|
|
730
803
|
clientMac?: string;
|
|
731
804
|
groupId?: string;
|
|
@@ -1236,5 +1309,6 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
|
|
|
1236
1309
|
private onDataChannelClose;
|
|
1237
1310
|
private onOperationTimeout;
|
|
1238
1311
|
private onOperationInput;
|
|
1312
|
+
private setCanvasMode;
|
|
1239
1313
|
}
|
|
1240
1314
|
export { LarkSR, ILarkSRConfig, PlayerModeType, UserType, LarkSREvent, LarkEventType, LarkSRClientEvent, AppliParams, AppliParamsUtils, LoadAppliParamsFromUrl, LoadAppliParamsStartAppInfo, EventBase, API, Operation, Capabilities, ScaleMode, VirtualKey, KEYMAP, CloudLark, FullScreen, LockPointer, Recorder, GESTURE_TYPE, };
|
|
@@ -61,6 +61,11 @@ export default class Operation extends EventBase<OPREATION_EVENT_TYPE, Operation
|
|
|
61
61
|
get lockPointer(): import("../larksr").LockPointer;
|
|
62
62
|
get mouseZoomDirection(): number;
|
|
63
63
|
set mouseZoomDirection(direction: number);
|
|
64
|
+
set aerialviewStatus(status: CloudLark.IAerialViewStatus | null);
|
|
65
|
+
get aerialviewStatus(): CloudLark.IAerialViewStatus | null;
|
|
66
|
+
_aerialviewStatus: CloudLark.IAerialViewStatus | null;
|
|
67
|
+
get aerialViewEnable(): boolean;
|
|
68
|
+
get aerialViewBox(): CloudLark.IAerialViewBox;
|
|
64
69
|
constructor(rootElement: HTMLElement, larksr: LarkSR);
|
|
65
70
|
setMouseEnable(enable: boolean): void;
|
|
66
71
|
setKeyboardEnable(enable: boolean): void;
|
|
@@ -42,7 +42,8 @@ export interface SyncCursorStyle {
|
|
|
42
42
|
customBase64: string;
|
|
43
43
|
}
|
|
44
44
|
export declare const enum SCREEN_EVENT_TYPE {
|
|
45
|
-
ReSize = 0
|
|
45
|
+
ReSize = 0,
|
|
46
|
+
ContainerResize = 1
|
|
46
47
|
}
|
|
47
48
|
export interface ScreenEvent extends LocalEvent<SCREEN_EVENT_TYPE> {
|
|
48
49
|
container: ContainerSize;
|
|
@@ -52,9 +53,16 @@ export default class ScreenState extends EventBase<SCREEN_EVENT_TYPE, ScreenEven
|
|
|
52
53
|
get appSize(): CloudLark.IAppResize;
|
|
53
54
|
set appSize(size: CloudLark.IAppResize);
|
|
54
55
|
private _appSize;
|
|
56
|
+
set originAppSize(viewport: ViewPort);
|
|
57
|
+
get originAppSize(): ViewPort;
|
|
58
|
+
private _originAppSize;
|
|
55
59
|
get viewPort(): ViewPort;
|
|
56
60
|
private _viewPort;
|
|
57
61
|
get viewPortStyle(): string;
|
|
62
|
+
get syncClientViewport(): {
|
|
63
|
+
width: number;
|
|
64
|
+
height: number;
|
|
65
|
+
};
|
|
58
66
|
get orientationIndexStyle(): {
|
|
59
67
|
width: string;
|
|
60
68
|
height: string;
|
|
@@ -116,5 +124,5 @@ export default class ScreenState extends EventBase<SCREEN_EVENT_TYPE, ScreenEven
|
|
|
116
124
|
constructor(rootElement: HTMLElement, params: IAppliParams, larksr: LarkSR, handleRootElementSize?: boolean, onlyHandleRootElementTransform?: boolean);
|
|
117
125
|
reset(params: IAppliParams): void;
|
|
118
126
|
setMobileForceLandScape(force: boolean): void;
|
|
119
|
-
resize(baseElementScale?: number): void;
|
|
127
|
+
resize(baseElementScale?: number, containerResize?: boolean): void;
|
|
120
128
|
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export interface WebGLBufferInfo {
|
|
2
|
+
position: WebGLBuffer | null;
|
|
3
|
+
textureCoord: WebGLBuffer | null;
|
|
4
|
+
indices: WebGLBuffer | null;
|
|
5
|
+
}
|
|
6
|
+
export default class WebGlUtils {
|
|
7
|
+
static fullScreenVertices: number[];
|
|
8
|
+
static fullscreenTextureCoords: number[];
|
|
9
|
+
static fullscreenIndices: number[];
|
|
10
|
+
static fullscreenVsSource: string;
|
|
11
|
+
static fullscreenFsSource: string;
|
|
12
|
+
static initfullScreenBuffers(gl: WebGLRenderingContext): WebGLBufferInfo;
|
|
13
|
+
static initTexture(gl: WebGLRenderingContext, source?: TexImageSource | null, width?: number, height?: number, internalFormat?: number): WebGLTexture | null;
|
|
14
|
+
static updateTexture(gl: WebGLRenderingContext, texture: WebGLTexture, video: TexImageSource): void;
|
|
15
|
+
static initShaderProgram(gl: WebGLRenderingContext, vsSource: string, fsSource: string): WebGLProgram;
|
|
16
|
+
static loadShader(gl: WebGLRenderingContext, type: number, source: string): WebGLShader;
|
|
17
|
+
static setPositionAttribute(gl: WebGLRenderingContext, positionBuffer: WebGLBuffer, vertexPositionAttr: number, numComponents?: number, stride?: number, offset?: number): void;
|
|
18
|
+
static setTextureAttribute(gl: WebGLRenderingContext, textureCoordBuffers: WebGLBuffer, textureCoordAttr: number, numComponents?: number, stride?: number, offset?: number): void;
|
|
19
|
+
}
|
|
20
|
+
export declare class FullScreenGlRender {
|
|
21
|
+
get inited(): boolean;
|
|
22
|
+
private _inited;
|
|
23
|
+
get canvas(): HTMLCanvasElement | null;
|
|
24
|
+
private _canvas;
|
|
25
|
+
get video(): HTMLVideoElement | null;
|
|
26
|
+
private _video;
|
|
27
|
+
get gl(): WebGLRenderingContext | null;
|
|
28
|
+
private _gl;
|
|
29
|
+
get shaderProgram(): WebGLProgram | null;
|
|
30
|
+
private _shaderProgram;
|
|
31
|
+
vertexPosition: number;
|
|
32
|
+
textureCoord: number;
|
|
33
|
+
uSampler: WebGLUniformLocation | null;
|
|
34
|
+
buffers: WebGLBufferInfo | null;
|
|
35
|
+
texture: WebGLTexture | null;
|
|
36
|
+
drawFrames: number;
|
|
37
|
+
playing: boolean;
|
|
38
|
+
timeupdate: boolean;
|
|
39
|
+
copyVideo: boolean;
|
|
40
|
+
startInternal: boolean;
|
|
41
|
+
constructor();
|
|
42
|
+
init(canvas: HTMLCanvasElement, video: HTMLVideoElement): boolean;
|
|
43
|
+
private checkReady;
|
|
44
|
+
startCanvasRender(): void;
|
|
45
|
+
stopCanvasRender(): void;
|
|
46
|
+
draw(viewportX?: number, viewportY?: number, viewportWidth?: number, viewPortHeight?: number): void;
|
|
47
|
+
updateVideo(video: HTMLVideoElement): void;
|
|
48
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "larksr_websdk",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.402",
|
|
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",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"build": "webpack --config webpack.config.js",
|
|
24
24
|
"build:typings": "tsc --build tsconfig.type.json",
|
|
25
25
|
"copy-dts": "copyfiles -u 1 \"src/**/*.d.ts\" dist/types/",
|
|
26
|
-
"dist": "webpack --config webpack.config.js && copyfiles -u 1 \"src/**/*.d.ts\" ./types/ && copyfiles -u 1 \"doc
|
|
26
|
+
"dist": "webpack --config webpack.config.js && copyfiles -u 1 \"src/**/*.d.ts\" ./types/ && copyfiles -u 1 \"doc/**/*\" dist/doc/ && copyfiles -u 1 \"types/**/*.d.ts\" ./dist/types/ && copyfiles -u 1 \"dist/*\" ./sample-plain-html/source/dist/"
|
|
27
27
|
},
|
|
28
28
|
"author": "fcx@pingxingyun.com",
|
|
29
29
|
"license": "ISC",
|