larksr_websdk 3.2.344 → 3.2.401
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/appli_params.d.ts +4 -2
- package/dist/types/lark/application.d.ts +5 -0
- package/dist/types/lark/custom.d.ts +7 -0
- 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 +5 -0
- package/dist/types/lark/peer_connection_media_share.d.ts +62 -7
- package/dist/types/lark/sdp_util.d.ts +7 -4
- package/dist/types/larksr.d.ts +13 -0
- package/dist/types/protobuf/cloudlark.d.ts +8578 -0
- package/dist/types/utils/ios-inner-height.d.ts +4 -0
- package/package.json +71 -71
- package/types/appli_params.d.ts +4 -2
- package/types/lark/application.d.ts +5 -0
- package/types/lark/custom.d.ts +7 -0
- 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 +5 -0
- package/types/lark/peer_connection_media_share.d.ts +62 -7
- package/types/lark/sdp_util.d.ts +7 -4
- package/types/larksr.d.ts +13 -0
- package/types/protobuf/cloudlark.d.ts +8578 -0
- package/types/utils/ios-inner-height.d.ts +4 -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
|
@@ -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
|
*/
|
|
@@ -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
|
*/
|
|
@@ -222,6 +223,7 @@ export declare class AppliParams implements IAppliParams {
|
|
|
222
223
|
wsProxy: boolean;
|
|
223
224
|
preferPubOutIp: string;
|
|
224
225
|
taskid: string;
|
|
226
|
+
get taskId(): string;
|
|
225
227
|
appliName: string;
|
|
226
228
|
width: number;
|
|
227
229
|
height: number;
|
|
@@ -253,7 +255,7 @@ export declare class AppliParams implements IAppliParams {
|
|
|
253
255
|
mobileVirtualJoystick: boolean;
|
|
254
256
|
mouseZoomDirection: number;
|
|
255
257
|
showPlayerList: boolean;
|
|
256
|
-
preferDecoder: 'auto' | 'vp8' | 'vp9' | 'h264' | 'h265' | 'hevc' | 'av1x';
|
|
258
|
+
preferDecoder: 'auto' | 'vp8' | 'vp9' | 'h264' | 'h265' | 'hevc' | 'av1' | 'av1x';
|
|
257
259
|
touchOperateMode: 'touchScreen' | 'mouse';
|
|
258
260
|
appliId: string;
|
|
259
261
|
syncLocalToCloudClipboard: boolean;
|
|
@@ -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,
|
|
@@ -52,10 +53,12 @@ export interface AppEvent extends LocalEvent<APP_EVENT_TYPE> {
|
|
|
52
53
|
state: APP_STATE;
|
|
53
54
|
}
|
|
54
55
|
export default class Application extends EventBase<APP_EVENT_TYPE, AppEvent> {
|
|
56
|
+
MAX_MEDIA_SHARE_PEERCONNECTION: number;
|
|
55
57
|
private websocketChannel;
|
|
56
58
|
private websocketProxy;
|
|
57
59
|
private testPixelStreaming;
|
|
58
60
|
private peerConnection;
|
|
61
|
+
getMediaSharePeerConnection(index: number): PeerConnectionMediaShare;
|
|
59
62
|
private mediaSharePeerConnectionImp;
|
|
60
63
|
get peerConnectionCreated(): boolean;
|
|
61
64
|
get state(): APP_STATE;
|
|
@@ -68,6 +71,7 @@ export default class Application extends EventBase<APP_EVENT_TYPE, AppEvent> {
|
|
|
68
71
|
get audioPaused(): boolean | undefined;
|
|
69
72
|
get videoPaused(): boolean | undefined;
|
|
70
73
|
get serverFeatures(): Msg.CloudLark.INotifyFeatures | null | undefined;
|
|
74
|
+
get serverStatics(): Msg.CloudLark.IServerStatics | null | undefined;
|
|
71
75
|
private get sharePeerConnection();
|
|
72
76
|
private retryTime;
|
|
73
77
|
private larksr;
|
|
@@ -87,6 +91,7 @@ export default class Application extends EventBase<APP_EVENT_TYPE, AppEvent> {
|
|
|
87
91
|
inputText(text: string): void;
|
|
88
92
|
sendTextToDataChannel(text: string): void;
|
|
89
93
|
sendBinaryToDataChannel(binary: Uint8Array): void;
|
|
94
|
+
sendVideoBitrateKbps(bitrateKbps: number): void;
|
|
90
95
|
aiDmTextInput(text: string): number;
|
|
91
96
|
startAiDmVoiceInput(): Promise<number>;
|
|
92
97
|
stopAiDmVoiceInput(): number;
|
|
@@ -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;
|
|
@@ -81,6 +81,9 @@ export interface AggregatedStats {
|
|
|
81
81
|
frameWidthStart: number;
|
|
82
82
|
currentRoundTripTime: number;
|
|
83
83
|
packetsLostPerc: number;
|
|
84
|
+
avgDecodeDelay: number;
|
|
85
|
+
avgProcessDelay: number;
|
|
86
|
+
serverStatics: Input.CloudLark.IServerStatics | null;
|
|
84
87
|
}
|
|
85
88
|
export default class PeerConnection extends EventBase<WEBRTC_EVENT_TYPE, WebRTCEvent> implements MediaShareInterface {
|
|
86
89
|
private config;
|
|
@@ -109,6 +112,8 @@ export default class PeerConnection extends EventBase<WEBRTC_EVENT_TYPE, WebRTCE
|
|
|
109
112
|
private canvasRender;
|
|
110
113
|
get serverFeatures(): CloudLark.INotifyFeatures | null;
|
|
111
114
|
private _serverFeatures;
|
|
115
|
+
get serverStatics(): CloudLark.IServerStatics | null;
|
|
116
|
+
private _serverStatics;
|
|
112
117
|
constructor(larksr: LarkSR, config: WebRTCConfig);
|
|
113
118
|
create(streams?: MediaStream | undefined | null, config?: CloudLark.IRTCConfiguration | null | undefined): Promise<void>;
|
|
114
119
|
createOffer(): void;
|
|
@@ -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;
|
|
@@ -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
|
@@ -656,10 +656,23 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
|
|
|
656
656
|
* 视频通道是否暂停
|
|
657
657
|
*/
|
|
658
658
|
get videoPaused(): boolean | undefined;
|
|
659
|
+
/**
|
|
660
|
+
* 获取媒体通道,后续可以调用媒体通道的相关接口,如打开摄像头等
|
|
661
|
+
* 原有 larksr 对象中的媒体通道相当于序号 0
|
|
662
|
+
* @param index 媒体上传通道序号 0 - 5
|
|
663
|
+
* @returns
|
|
664
|
+
*/
|
|
665
|
+
getMediaSharePeerConnection(index: number): import("./lark/peer_connection_media_share").default;
|
|
659
666
|
/**
|
|
660
667
|
* 服务器支持的功能列表
|
|
661
668
|
*/
|
|
662
669
|
get serverFeatures(): CloudLark.INotifyFeatures | null | undefined;
|
|
670
|
+
get serverStatics(): CloudLark.IServerStatics | null | undefined;
|
|
671
|
+
/**
|
|
672
|
+
* 动态设置码率 单位 kbps
|
|
673
|
+
* @param bitrateKbps
|
|
674
|
+
*/
|
|
675
|
+
setVideoBitrateKbps(bitrateKbps: number): void;
|
|
663
676
|
/**
|
|
664
677
|
* LarkSR 客户端。所有操作和事件通过该类传递
|
|
665
678
|
* @param config 本地配置,优先级最高
|