larksr_websdk 3.2.332 → 3.2.334
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/config.md +5 -0
- package/dist/doc/functions.md +60 -1
- package/dist/doc/update.md +9 -0
- package/dist/larksr-web-sdk.min.js +1 -1
- package/dist/types/appli_params.d.ts +2 -0
- package/dist/types/lark/application.d.ts +37 -47
- package/dist/types/lark/media_share_interface.d.ts +44 -0
- package/dist/types/lark/peer_connection.d.ts +23 -16
- package/dist/types/lark/peer_connection_media_share.d.ts +20 -15
- package/dist/types/larksr.d.ts +124 -45
- package/package.json +1 -1
- package/types/appli_params.d.ts +2 -0
- package/types/lark/application.d.ts +37 -47
- package/types/lark/media_share_interface.d.ts +44 -0
- package/types/lark/peer_connection.d.ts +23 -16
- package/types/lark/peer_connection_media_share.d.ts +20 -15
- package/types/larksr.d.ts +124 -45
|
@@ -200,6 +200,7 @@ export interface IAppliParams {
|
|
|
200
200
|
videoInput: boolean;
|
|
201
201
|
videoInputAutoStart: boolean;
|
|
202
202
|
liveStreaming: boolean;
|
|
203
|
+
useSeparateMediaSharePeer: boolean;
|
|
203
204
|
}
|
|
204
205
|
export declare enum AppliType {
|
|
205
206
|
DESKTOP = 1,
|
|
@@ -266,6 +267,7 @@ export declare class AppliParams implements IAppliParams {
|
|
|
266
267
|
videoInput: boolean;
|
|
267
268
|
videoInputAutoStart: boolean;
|
|
268
269
|
liveStreaming: boolean;
|
|
270
|
+
useSeparateMediaSharePeer: boolean;
|
|
269
271
|
static copyAndCreate(params?: IAppliParams): AppliParams;
|
|
270
272
|
static setUpWithSDKConfig(params: IAppliParams, config: ILarkSRConfig): AppliParams;
|
|
271
273
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { EventBase, LocalEvent } from '../event/event_base';
|
|
2
2
|
import * as Msg from '../protobuf/cloudlark';
|
|
3
3
|
import WebSocektChannel from './websocket_channel';
|
|
4
|
-
import { RTCMediaTrackBinding } from './peer_connection';
|
|
5
4
|
import WebsocketProxy from './websocket_proxy';
|
|
6
5
|
import { LarkSR } from '../larksr';
|
|
7
6
|
import PixelStreamingWebsocketChannel from './test_pixel_streaming';
|
|
@@ -56,19 +55,16 @@ export default class Application extends EventBase<APP_EVENT_TYPE, AppEvent> {
|
|
|
56
55
|
private websocketProxy;
|
|
57
56
|
private testPixelStreaming;
|
|
58
57
|
private peerConnection;
|
|
59
|
-
private
|
|
58
|
+
private mediaSharePeerConnectionImp;
|
|
60
59
|
get peerConnectionCreated(): boolean;
|
|
61
60
|
get state(): APP_STATE;
|
|
62
61
|
set state(state: APP_STATE);
|
|
63
62
|
private _state;
|
|
64
|
-
get audioDeviceId(): string | undefined;
|
|
65
|
-
get audioTrack(): MediaStreamTrack |
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
get
|
|
69
|
-
get videoTrack(): MediaStreamTrack | {
|
|
70
|
-
enabled: boolean;
|
|
71
|
-
} | undefined;
|
|
63
|
+
get audioDeviceId(): string | null | undefined;
|
|
64
|
+
get audioTrack(): MediaStreamTrack | null | undefined;
|
|
65
|
+
get videoDeviceId(): string | null | undefined;
|
|
66
|
+
get videoTrack(): MediaStreamTrack | null | undefined;
|
|
67
|
+
private get sharePeerConnection();
|
|
72
68
|
private retryTime;
|
|
73
69
|
private larksr;
|
|
74
70
|
get voiceId(): number;
|
|
@@ -80,6 +76,7 @@ export default class Application extends EventBase<APP_EVENT_TYPE, AppEvent> {
|
|
|
80
76
|
initPc(): void;
|
|
81
77
|
releasePc(): void;
|
|
82
78
|
releaseSharePc(): void;
|
|
79
|
+
closeSharePc(): void;
|
|
83
80
|
clear(): void;
|
|
84
81
|
changeOperater(uid: number): void;
|
|
85
82
|
inputText(text: string): void;
|
|
@@ -128,44 +125,37 @@ export default class Application extends EventBase<APP_EVENT_TYPE, AppEvent> {
|
|
|
128
125
|
private onRtmpStreamingError;
|
|
129
126
|
private onIceStateChange;
|
|
130
127
|
retryPeerconnection(): void;
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
streams: MediaStream;
|
|
160
|
-
rtcRtpSenders: RTCMediaTrackBinding[];
|
|
161
|
-
} | undefined>;
|
|
162
|
-
openUserMeida(constraints?: MediaStreamConstraints, reset?: boolean): Promise<{
|
|
163
|
-
streams: MediaStream;
|
|
164
|
-
rtcRtpSenders: RTCMediaTrackBinding[];
|
|
165
|
-
} | undefined>;
|
|
128
|
+
private onShareMediaError;
|
|
129
|
+
private onShareMediaInfo;
|
|
130
|
+
private onShareMediaOffer;
|
|
131
|
+
private onShareMediaIce;
|
|
132
|
+
setAudioEnable(enable: boolean): any;
|
|
133
|
+
setVideoEnable(enable: boolean): any;
|
|
134
|
+
setShareEnable(enable: boolean): any;
|
|
135
|
+
stopLocalAudio(): any;
|
|
136
|
+
stopLocalVideo(): any;
|
|
137
|
+
stopLocalShare(): any;
|
|
138
|
+
pauseAudioSending(): any;
|
|
139
|
+
resumeAudioSending(): any;
|
|
140
|
+
pauseVideoSending(): any;
|
|
141
|
+
resumeVideoSending(): any;
|
|
142
|
+
closeAudio(): any;
|
|
143
|
+
closeVideo(): any;
|
|
144
|
+
closeShare(): any;
|
|
145
|
+
openAudio(deviceId?: string): Promise<any>;
|
|
146
|
+
openVideo(audio?: boolean, cameraId?: string, width?: number, height?: number): Promise<any>;
|
|
147
|
+
openDefaultMedia(video?: boolean, audio?: boolean): Promise<any>;
|
|
148
|
+
openShareMediaDevice(): Promise<any>;
|
|
149
|
+
getConnectedAudioinputDevices(): Promise<any>;
|
|
150
|
+
getConnectedAudioOutputDevices(): Promise<any>;
|
|
151
|
+
getConnectedVideoinputDevices(): Promise<any>;
|
|
152
|
+
getConnectedDevices(type: MediaDeviceKind): Promise<any>;
|
|
153
|
+
openAudioDevice(deviceId: string, kind?: "audioinput" | "audiooutput"): Promise<any>;
|
|
154
|
+
openCamera(cameraId: string, minWidth?: number, minHeight?: number): Promise<any>;
|
|
155
|
+
openUserMeida(constraints?: MediaStreamConstraints, reset?: boolean): Promise<any>;
|
|
166
156
|
addMediaTrack(track: MediaStreamTrack, ...streams: MediaStream[]): boolean | undefined;
|
|
167
|
-
removeMediaTrack(track: RTCRtpSender):
|
|
168
|
-
requestUserMediaPermission(constraints?: MediaStreamConstraints):
|
|
157
|
+
removeMediaTrack(track: RTCRtpSender): any;
|
|
158
|
+
requestUserMediaPermission(constraints?: MediaStreamConstraints): any;
|
|
169
159
|
StartCloudLiveStreaming(params: Msg.CloudLark.IRtmp_Start): Promise<void> | undefined;
|
|
170
160
|
StopLiveStreaming(): void | undefined;
|
|
171
161
|
private onPeerConnectionDisconnect;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export interface RTCMediaTrackBinding {
|
|
2
|
+
deviceId: string;
|
|
3
|
+
track: MediaStreamTrack;
|
|
4
|
+
sender: RTCRtpSender | undefined;
|
|
5
|
+
}
|
|
6
|
+
export interface RTCShareMediaTrackBinding {
|
|
7
|
+
deviceId: string;
|
|
8
|
+
track: MediaStreamTrack;
|
|
9
|
+
transceiver: RTCRtpTransceiver | undefined;
|
|
10
|
+
paused: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface MediaShareInterface {
|
|
13
|
+
audioDeviceId: string | undefined | null;
|
|
14
|
+
audioTrack: MediaStreamTrack | undefined | null;
|
|
15
|
+
videoDeviceId: string | undefined | null;
|
|
16
|
+
videoTrack: MediaStreamTrack | undefined | null;
|
|
17
|
+
setAudioEnable(enable: boolean): any;
|
|
18
|
+
setVideoEnable(enable: boolean): any;
|
|
19
|
+
setShareEnable(enable: boolean): any;
|
|
20
|
+
stopLocalAudio(): any;
|
|
21
|
+
stopLocalVideo(): any;
|
|
22
|
+
stopLocalShare(): any;
|
|
23
|
+
pauseAudioSending(): any;
|
|
24
|
+
resumeAudioSending(): any;
|
|
25
|
+
pauseVideoSending(): any;
|
|
26
|
+
resumeVideoSending(): any;
|
|
27
|
+
closeAudio(): any;
|
|
28
|
+
closeVideo(): any;
|
|
29
|
+
closeShare(): any;
|
|
30
|
+
openAudio(deviceId: string): Promise<any>;
|
|
31
|
+
openVideo(audio: boolean, cameraId: string, width: number, height: number): Promise<any>;
|
|
32
|
+
openDefaultMedia(video: boolean, audio: boolean): Promise<any>;
|
|
33
|
+
openShareMediaDevice(): Promise<any>;
|
|
34
|
+
getConnectedAudioinputDevices(): Promise<any>;
|
|
35
|
+
getConnectedAudioOutputDevices(): Promise<any>;
|
|
36
|
+
getConnectedVideoinputDevices(): Promise<any>;
|
|
37
|
+
getConnectedDevices(type: MediaDeviceKind): Promise<any>;
|
|
38
|
+
openAudioDevice(deviceId: string, kind: "audioinput" | "audiooutput"): Promise<any>;
|
|
39
|
+
openCamera(cameraId: string, minWidth: number, minHeight: number): Promise<any>;
|
|
40
|
+
openUserMeida(constraints?: MediaStreamConstraints, reset?: boolean): Promise<any>;
|
|
41
|
+
addMediaTrack(track: MediaStreamTrack, ...streams: MediaStream[]): boolean;
|
|
42
|
+
removeMediaTrack(track: RTCRtpSender): any;
|
|
43
|
+
requestUserMediaPermission(constraints?: MediaStreamConstraints): any;
|
|
44
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { EventBase, LocalEvent } from '../event/event_base';
|
|
2
2
|
import * as Input from '../protobuf/cloudlark';
|
|
3
3
|
import { LarkSR } from '../larksr';
|
|
4
|
+
import { MediaShareInterface, RTCMediaTrackBinding } from './media_share_interface';
|
|
4
5
|
export declare enum IceState {
|
|
5
6
|
DISCONNECT = 1,
|
|
6
7
|
BAD = 2,
|
|
@@ -80,12 +81,7 @@ export interface AggregatedStats {
|
|
|
80
81
|
currentRoundTripTime: number;
|
|
81
82
|
packetsLostPerc: number;
|
|
82
83
|
}
|
|
83
|
-
export
|
|
84
|
-
deviceId: string;
|
|
85
|
-
track: MediaStreamTrack;
|
|
86
|
-
sender: RTCRtpSender | undefined;
|
|
87
|
-
}
|
|
88
|
-
export default class PeerConnection extends EventBase<WEBRTC_EVENT_TYPE, WebRTCEvent> {
|
|
84
|
+
export default class PeerConnection extends EventBase<WEBRTC_EVENT_TYPE, WebRTCEvent> implements MediaShareInterface {
|
|
89
85
|
private config;
|
|
90
86
|
private pc;
|
|
91
87
|
private dataChannel;
|
|
@@ -103,9 +99,9 @@ export default class PeerConnection extends EventBase<WEBRTC_EVENT_TYPE, WebRTCE
|
|
|
103
99
|
get audioTrack(): MediaStreamTrack | undefined;
|
|
104
100
|
get videoDeviceId(): string | undefined;
|
|
105
101
|
get videoTrack(): MediaStreamTrack | undefined;
|
|
106
|
-
private
|
|
107
|
-
private
|
|
108
|
-
private
|
|
102
|
+
private audioBinding;
|
|
103
|
+
private videoBinding;
|
|
104
|
+
private readonly sendStream;
|
|
109
105
|
private sdpCreateSuccess;
|
|
110
106
|
constructor(larksr: LarkSR, config: WebRTCConfig);
|
|
111
107
|
create(streams?: MediaStream | undefined | null): Promise<void>;
|
|
@@ -114,19 +110,29 @@ export default class PeerConnection extends EventBase<WEBRTC_EVENT_TYPE, WebRTCE
|
|
|
114
110
|
setAudioEnable(enable: boolean): void;
|
|
115
111
|
setVideoEnable(enable: boolean): void;
|
|
116
112
|
setShareEnable(enable: boolean): void;
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
113
|
+
stopLocalAudio(): void;
|
|
114
|
+
stopLocalVideo(): void;
|
|
115
|
+
stopLocalShare(): void;
|
|
116
|
+
pauseAudioSending(): false | undefined;
|
|
117
|
+
resumeAudioSending(): false | undefined;
|
|
118
|
+
pauseVideoSending(): false | undefined;
|
|
119
|
+
resumeVideoSending(): false | undefined;
|
|
120
|
+
closeAudio(): false | undefined;
|
|
121
|
+
closeVideo(): false | undefined;
|
|
122
|
+
closeShare(): false | undefined;
|
|
120
123
|
private stopLocalTrackBing;
|
|
121
124
|
openAudio(deviceId?: string): Promise<{
|
|
122
125
|
streams: MediaStream;
|
|
123
126
|
rtcRtpSenders: RTCMediaTrackBinding[];
|
|
124
127
|
}>;
|
|
125
|
-
openVideo(audio?: boolean, cameraId?: string): Promise<{
|
|
128
|
+
openVideo(audio?: boolean, cameraId?: string, width?: number, height?: number): Promise<{
|
|
129
|
+
streams: MediaStream;
|
|
130
|
+
rtcRtpSenders: RTCMediaTrackBinding[];
|
|
131
|
+
}>;
|
|
132
|
+
openDefaultMedia(video?: boolean, audio?: boolean): Promise<{
|
|
126
133
|
streams: MediaStream;
|
|
127
134
|
rtcRtpSenders: RTCMediaTrackBinding[];
|
|
128
135
|
}>;
|
|
129
|
-
openDefaultMedia(video?: boolean, audio?: boolean): Promise<void>;
|
|
130
136
|
openShareMediaDevice(): Promise<void>;
|
|
131
137
|
getConnectedAudioinputDevices(): Promise<MediaDeviceInfo[]>;
|
|
132
138
|
getConnectedAudioOutputDevices(): Promise<MediaDeviceInfo[]>;
|
|
@@ -136,14 +142,15 @@ export default class PeerConnection extends EventBase<WEBRTC_EVENT_TYPE, WebRTCE
|
|
|
136
142
|
streams: MediaStream;
|
|
137
143
|
rtcRtpSenders: RTCMediaTrackBinding[];
|
|
138
144
|
}>;
|
|
139
|
-
openCamera(cameraId: string,
|
|
145
|
+
openCamera(cameraId: string, width?: number, height?: number, audio?: boolean): Promise<{
|
|
140
146
|
streams: MediaStream;
|
|
141
147
|
rtcRtpSenders: RTCMediaTrackBinding[];
|
|
142
148
|
}>;
|
|
143
|
-
openUserMeida(constraints?: MediaStreamConstraints): Promise<{
|
|
149
|
+
openUserMeida(constraints?: MediaStreamConstraints, reset?: boolean): Promise<{
|
|
144
150
|
streams: MediaStream;
|
|
145
151
|
rtcRtpSenders: RTCMediaTrackBinding[];
|
|
146
152
|
}>;
|
|
153
|
+
private resumeOrCreateBinding;
|
|
147
154
|
addMediaTrack(track: MediaStreamTrack, ...streams: MediaStream[]): boolean;
|
|
148
155
|
removeMediaTrack(track: RTCRtpSender): boolean;
|
|
149
156
|
requestUserMediaPermission(constraints?: MediaStreamConstraints): Promise<MediaStream>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EventBase, LocalEvent } from '../event/event_base';
|
|
2
2
|
import { LarkSR } from '../larksr';
|
|
3
|
-
import { RTCMediaTrackBinding } from './
|
|
3
|
+
import { MediaShareInterface, RTCMediaTrackBinding } from './media_share_interface';
|
|
4
4
|
export declare enum WEBRTC_MEDIA_SHARE_EVENT_TYPE {
|
|
5
5
|
RTC_SDP = 0,
|
|
6
6
|
RTC_ICECANDIDATE = 1,
|
|
@@ -15,21 +15,18 @@ export interface WebRTCConfig {
|
|
|
15
15
|
serverIP: string;
|
|
16
16
|
preferPubOutIp: string;
|
|
17
17
|
}
|
|
18
|
-
export default class PeerConnectionMediaShare extends EventBase<WEBRTC_MEDIA_SHARE_EVENT_TYPE, WebRTCMediaShareEvent> {
|
|
19
|
-
get audioDeviceId(): string;
|
|
20
|
-
get audioTrack(): MediaStreamTrack |
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
get videoDeviceId(): string;
|
|
24
|
-
get videoTrack(): MediaStreamTrack | {
|
|
25
|
-
enabled: boolean;
|
|
26
|
-
};
|
|
18
|
+
export default class PeerConnectionMediaShare extends EventBase<WEBRTC_MEDIA_SHARE_EVENT_TYPE, WebRTCMediaShareEvent> implements MediaShareInterface {
|
|
19
|
+
get audioDeviceId(): string | undefined;
|
|
20
|
+
get audioTrack(): MediaStreamTrack | undefined;
|
|
21
|
+
get videoDeviceId(): string | undefined;
|
|
22
|
+
get videoTrack(): MediaStreamTrack | undefined;
|
|
27
23
|
private larksr;
|
|
28
24
|
private offerOptions;
|
|
29
25
|
private pcConfig;
|
|
30
26
|
private pc;
|
|
31
|
-
private
|
|
32
|
-
private
|
|
27
|
+
private audioBinding;
|
|
28
|
+
private videoBinding;
|
|
29
|
+
private readonly sendStream;
|
|
33
30
|
constructor(larksr: LarkSR);
|
|
34
31
|
create(): Promise<void>;
|
|
35
32
|
createOffer(): void;
|
|
@@ -37,9 +34,16 @@ export default class PeerConnectionMediaShare extends EventBase<WEBRTC_MEDIA_SHA
|
|
|
37
34
|
setAudioEnable(enable: boolean): void;
|
|
38
35
|
setVideoEnable(enable: boolean): void;
|
|
39
36
|
setShareEnable(enable: boolean): void;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
stopLocalAudio(): void;
|
|
38
|
+
stopLocalVideo(): void;
|
|
39
|
+
stopLocalShare(): void;
|
|
40
|
+
pauseAudioSending(): false | undefined;
|
|
41
|
+
resumeAudioSending(): false | undefined;
|
|
42
|
+
pauseVideoSending(): false | undefined;
|
|
43
|
+
resumeVideoSending(): false | undefined;
|
|
44
|
+
closeAudio(): false | undefined;
|
|
45
|
+
closeVideo(): false | undefined;
|
|
46
|
+
closeShare(): false | undefined;
|
|
43
47
|
private stopLocalTrackBing;
|
|
44
48
|
openAudio(deviceId?: string): Promise<{
|
|
45
49
|
streams: MediaStream;
|
|
@@ -70,6 +74,7 @@ export default class PeerConnectionMediaShare extends EventBase<WEBRTC_MEDIA_SHA
|
|
|
70
74
|
streams: MediaStream;
|
|
71
75
|
rtcRtpSenders: RTCMediaTrackBinding[];
|
|
72
76
|
}>;
|
|
77
|
+
private resumeOrCreateBinding;
|
|
73
78
|
addMediaTrack(track: MediaStreamTrack, ...streams: MediaStream[]): boolean;
|
|
74
79
|
removeMediaTrack(track: RTCRtpSender): boolean;
|
|
75
80
|
requestUserMediaPermission(constraints?: MediaStreamConstraints): Promise<MediaStream>;
|
package/dist/types/larksr.d.ts
CHANGED
|
@@ -466,6 +466,11 @@ interface ILarkSRConfig {
|
|
|
466
466
|
* 默认 20S
|
|
467
467
|
*/
|
|
468
468
|
playTimeout?: number;
|
|
469
|
+
/**
|
|
470
|
+
* 是否使用新版摄像头/麦克风协议
|
|
471
|
+
* 单独上传流程要求渲染服务器版本大于3290)
|
|
472
|
+
*/
|
|
473
|
+
useSeparateMediaSharePeer?: boolean;
|
|
469
474
|
}
|
|
470
475
|
declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
|
|
471
476
|
/**
|
|
@@ -611,23 +616,19 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
|
|
|
611
616
|
/**
|
|
612
617
|
* 当前打开的音频设备 ID,如果打开时没指定为空
|
|
613
618
|
*/
|
|
614
|
-
get audioDeviceId(): string | undefined;
|
|
619
|
+
get audioDeviceId(): string | null | undefined;
|
|
615
620
|
/**
|
|
616
621
|
* 当前打开音频的track对象,未打开状态为空
|
|
617
622
|
*/
|
|
618
|
-
get audioTrack(): MediaStreamTrack |
|
|
619
|
-
enabled: boolean;
|
|
620
|
-
} | undefined;
|
|
623
|
+
get audioTrack(): MediaStreamTrack | null | undefined;
|
|
621
624
|
/**
|
|
622
625
|
* 当前打开视频设备 ID,如果打开时没指定特设备id为空
|
|
623
626
|
*/
|
|
624
|
-
get videoDeviceId(): string | undefined;
|
|
627
|
+
get videoDeviceId(): string | null | undefined;
|
|
625
628
|
/**
|
|
626
629
|
* 当前打开视频track对象,未打开状态为空
|
|
627
630
|
*/
|
|
628
|
-
get videoTrack(): MediaStreamTrack |
|
|
629
|
-
enabled: boolean;
|
|
630
|
-
} | undefined;
|
|
631
|
+
get videoTrack(): MediaStreamTrack | null | undefined;
|
|
631
632
|
/**
|
|
632
633
|
* LarkSR 客户端。所有操作和事件通过该类传递
|
|
633
634
|
* @param config 本地配置,优先级最高
|
|
@@ -996,40 +997,82 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
|
|
|
996
997
|
* @param enable 是否启用
|
|
997
998
|
* @returns
|
|
998
999
|
*/
|
|
999
|
-
setAudioEnable(enable: boolean):
|
|
1000
|
+
setAudioEnable(enable: boolean): any;
|
|
1000
1001
|
/**
|
|
1001
1002
|
* 设置当前已开启的视频track是否启用状态
|
|
1002
1003
|
* @param enable 是否启用
|
|
1003
1004
|
* @returns
|
|
1004
1005
|
*/
|
|
1005
|
-
setVideoEnable(enable: boolean):
|
|
1006
|
-
setShareEnable(enable: boolean):
|
|
1006
|
+
setVideoEnable(enable: boolean): any;
|
|
1007
|
+
setShareEnable(enable: boolean): any;
|
|
1008
|
+
/**
|
|
1009
|
+
* 停止本地音频轨道
|
|
1010
|
+
* @returns
|
|
1011
|
+
*/
|
|
1012
|
+
stopLocalAudio(): any;
|
|
1013
|
+
/**
|
|
1014
|
+
* 停止本地已打开的视频轨道
|
|
1015
|
+
* @returns
|
|
1016
|
+
*/
|
|
1017
|
+
stopLocalVideo(): any;
|
|
1018
|
+
/**
|
|
1019
|
+
* 停止本地共享轨道
|
|
1020
|
+
* @returns
|
|
1021
|
+
*/
|
|
1022
|
+
stopLocalShare(): any;
|
|
1023
|
+
/**
|
|
1024
|
+
* 暂停发送音频
|
|
1025
|
+
* @returns
|
|
1026
|
+
*/
|
|
1027
|
+
pauseAudioSending(): any;
|
|
1028
|
+
/**
|
|
1029
|
+
* 恢复发送音频
|
|
1030
|
+
* @returns
|
|
1031
|
+
*/
|
|
1032
|
+
resumeAudioSending(): any;
|
|
1033
|
+
/**
|
|
1034
|
+
* 暂停发送视频
|
|
1035
|
+
* @returns
|
|
1036
|
+
*/
|
|
1037
|
+
pauseVideoSending(): any;
|
|
1038
|
+
/**
|
|
1039
|
+
* 恢复发送视频
|
|
1040
|
+
* @returns
|
|
1041
|
+
*/
|
|
1042
|
+
resumeVideoSending(): any;
|
|
1007
1043
|
/**
|
|
1008
1044
|
* 关闭当前的音频设备
|
|
1009
1045
|
* @returns
|
|
1010
1046
|
*/
|
|
1011
|
-
closeAudio():
|
|
1012
|
-
|
|
1013
|
-
|
|
1047
|
+
closeAudio(): any;
|
|
1048
|
+
/**
|
|
1049
|
+
* 关闭当前已打开的视频设备
|
|
1050
|
+
* @returns
|
|
1051
|
+
*/
|
|
1052
|
+
closeVideo(): any;
|
|
1053
|
+
/**
|
|
1054
|
+
* 关闭当前已打开的共享设备如共享的标签页等
|
|
1055
|
+
* @returns
|
|
1056
|
+
*/
|
|
1057
|
+
closeShare(): any;
|
|
1058
|
+
/**
|
|
1059
|
+
* 关闭整个媒体上传连接。再次使用时重新打开。
|
|
1060
|
+
* @returns
|
|
1061
|
+
*/
|
|
1062
|
+
closeMediaChannel(): void;
|
|
1014
1063
|
/**
|
|
1015
1064
|
* 打开一个音频设备,要注意浏览器限制在 https 或者 localhost 下才能打开音频
|
|
1016
1065
|
* @param deviceId 音频设备id,如果不传将打开默认设备。@see getConnectedAudioinputDevices
|
|
1017
1066
|
* @returns Promise
|
|
1018
1067
|
*/
|
|
1019
|
-
openAudio(deviceId?: string): Promise<
|
|
1020
|
-
streams: MediaStream;
|
|
1021
|
-
rtcRtpSenders: import("./lark/peer_connection").RTCMediaTrackBinding[];
|
|
1022
|
-
} | undefined>;
|
|
1068
|
+
openAudio(deviceId?: string): Promise<any>;
|
|
1023
1069
|
/**
|
|
1024
1070
|
* 打开一个视频设备,要注意浏览器限制在 https 或者 localhost 下才能打开视频
|
|
1025
1071
|
* @param audio boolean 是否同时开启音频
|
|
1026
1072
|
* @param cameraId 视频设备id,如果不传将打开默认设备。@see getConnectedVideoinputDevices
|
|
1027
1073
|
* @returns Promise
|
|
1028
1074
|
*/
|
|
1029
|
-
openVideo(audio?: boolean, cameraId?: string, width?: number, height?: number): Promise<
|
|
1030
|
-
streams: MediaStream;
|
|
1031
|
-
rtcRtpSenders: import("./lark/peer_connection").RTCMediaTrackBinding[];
|
|
1032
|
-
} | undefined>;
|
|
1075
|
+
openVideo(audio?: boolean, cameraId?: string, width?: number, height?: number): Promise<any>;
|
|
1033
1076
|
/**
|
|
1034
1077
|
* 打开默认媒体设备,要注意浏览器限制在 https 或者 localhost 下
|
|
1035
1078
|
* 如果需要指定特殊的媒体设备请单独使用 @see openAudio @see openVideo
|
|
@@ -1037,38 +1080,74 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
|
|
|
1037
1080
|
* @param audio 是否包含音频
|
|
1038
1081
|
* @returns Promise
|
|
1039
1082
|
*/
|
|
1040
|
-
openDefaultMedia(video?: boolean, audio?: boolean): Promise<
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1083
|
+
openDefaultMedia(video?: boolean, audio?: boolean): Promise<any>;
|
|
1084
|
+
/**
|
|
1085
|
+
* 打开共享设备,浏览器可共享窗口,标签页等
|
|
1086
|
+
* @returns Promise
|
|
1087
|
+
*/
|
|
1088
|
+
openShareMediaDevice(): Promise<any>;
|
|
1045
1089
|
/**
|
|
1046
1090
|
* 返回已连接的音频设备列表,设备列表中的设备的 deviceId 可用来打开某个音频设备
|
|
1047
1091
|
* @returns Promise<MediaDeviceInfo[]>
|
|
1048
1092
|
*/
|
|
1049
|
-
getConnectedAudioinputDevices(): Promise<
|
|
1050
|
-
getConnectedAudioOutputDevices(): Promise<
|
|
1093
|
+
getConnectedAudioinputDevices(): Promise<any>;
|
|
1094
|
+
getConnectedAudioOutputDevices(): Promise<any>;
|
|
1051
1095
|
/**
|
|
1052
1096
|
* 返回已连接的视频设备
|
|
1053
1097
|
* @returns Promise<MediaDeviceInfo[]>
|
|
1054
1098
|
*/
|
|
1055
|
-
getConnectedVideoinputDevices(): Promise<
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1099
|
+
getConnectedVideoinputDevices(): Promise<any>;
|
|
1100
|
+
/**
|
|
1101
|
+
* 获取所有连接的摄像头麦克风设备信息
|
|
1102
|
+
* @param type *"audioinput" | "audiooutput" | "videoinput"*
|
|
1103
|
+
* @returns Promise<MediaDeviceInfo[]>
|
|
1104
|
+
*/
|
|
1105
|
+
getConnectedDevices(type: MediaDeviceKind): Promise<any>;
|
|
1106
|
+
/**
|
|
1107
|
+
* 打开麦克风设备
|
|
1108
|
+
* @param deviceId 麦克风设备 ID, @see getConnectedAudioOutputDevices
|
|
1109
|
+
* @param kind “audioinput”
|
|
1110
|
+
* @returns @see this.openUserMedia
|
|
1111
|
+
*/
|
|
1112
|
+
openAudioDevice(deviceId: string, kind?: "audioinput" | "audiooutput"): Promise<any>;
|
|
1113
|
+
/**
|
|
1114
|
+
* 打开摄像头设备
|
|
1115
|
+
* @param cameraId 摄像头设备ID,@see getConnectedVideoinputDevices
|
|
1116
|
+
* @param minWidth 限制打开设备的宽
|
|
1117
|
+
* @param minHeight 限制打开设备的高
|
|
1118
|
+
* @returns @see openUserMedia
|
|
1119
|
+
*/
|
|
1120
|
+
openCamera(cameraId: string, minWidth?: number, minHeight?: number): Promise<any>;
|
|
1121
|
+
/**
|
|
1122
|
+
* 请求浏览器打开媒体并且打开上传到服务器通道。
|
|
1123
|
+
* 要注意的是在服务器连接成功之后请求打开
|
|
1124
|
+
* @param constraints 参考 navigator.mediaDevices.getUserMedia(constraints)
|
|
1125
|
+
* @param reset 是否重制媒体通道。true 的情况下重制整个 peerconnection
|
|
1126
|
+
* @returns 打开的通道的绑定信息。管理媒体通道如关闭暂停或恢复使用。
|
|
1127
|
+
*/
|
|
1128
|
+
openUserMedia(constraints?: MediaStreamConstraints, reset?: boolean): Promise<any>;
|
|
1129
|
+
openUserMeida(constraints?: MediaStreamConstraints, reset?: boolean): Promise<any>;
|
|
1130
|
+
/**
|
|
1131
|
+
* 添加媒体轨道
|
|
1132
|
+
* 一般情况下使用 @see openUserMedia
|
|
1133
|
+
* @param track
|
|
1134
|
+
* @param streams
|
|
1135
|
+
* @returns
|
|
1136
|
+
*/
|
|
1069
1137
|
addMediaTrack(track: MediaStreamTrack, ...streams: MediaStream[]): boolean | undefined;
|
|
1070
|
-
|
|
1071
|
-
|
|
1138
|
+
/**
|
|
1139
|
+
* 移除某个媒体轨道。一般为 openUserMedia 打开的通道。
|
|
1140
|
+
* 一般使用 @see closeVideo closeAudio 或 @see pauseAudioSending pauseVideoSending
|
|
1141
|
+
* @param track @see openUserMedia 返回值
|
|
1142
|
+
* @returns
|
|
1143
|
+
*/
|
|
1144
|
+
removeMediaTrack(track: RTCRtpSender): any;
|
|
1145
|
+
/**
|
|
1146
|
+
* 请求媒体设备权限,相当于 navigator.mediaDevices.getUserMedia(constraints)
|
|
1147
|
+
* @param constraints
|
|
1148
|
+
* @returns
|
|
1149
|
+
*/
|
|
1150
|
+
requestUserMediaPermission(constraints?: MediaStreamConstraints): any;
|
|
1072
1151
|
/**
|
|
1073
1152
|
* 启动云端推流功能
|
|
1074
1153
|
* @param params {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "larksr_websdk",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.334",
|
|
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",
|
package/types/appli_params.d.ts
CHANGED
|
@@ -200,6 +200,7 @@ export interface IAppliParams {
|
|
|
200
200
|
videoInput: boolean;
|
|
201
201
|
videoInputAutoStart: boolean;
|
|
202
202
|
liveStreaming: boolean;
|
|
203
|
+
useSeparateMediaSharePeer: boolean;
|
|
203
204
|
}
|
|
204
205
|
export declare enum AppliType {
|
|
205
206
|
DESKTOP = 1,
|
|
@@ -266,6 +267,7 @@ export declare class AppliParams implements IAppliParams {
|
|
|
266
267
|
videoInput: boolean;
|
|
267
268
|
videoInputAutoStart: boolean;
|
|
268
269
|
liveStreaming: boolean;
|
|
270
|
+
useSeparateMediaSharePeer: boolean;
|
|
269
271
|
static copyAndCreate(params?: IAppliParams): AppliParams;
|
|
270
272
|
static setUpWithSDKConfig(params: IAppliParams, config: ILarkSRConfig): AppliParams;
|
|
271
273
|
}
|