aliyun-rtc-sdk 6.11.6-beta.1 → 6.11.7-beta.0
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/aliyun-rtc-sdk.js +41 -17
- package/dist/plugins/beautyPlugin.d.ts +8 -7
- package/dist/plugins/beautyPlugin.js +1 -1
- package/dist/types/index.d.ts +550 -553
- package/package.json +7 -3
package/dist/types/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/// <reference types="dom-mediacapture-transform" />
|
|
2
2
|
|
|
3
3
|
import { default as default_2 } from 'eventemitter3';
|
|
4
|
+
import { default as default_3 } from '@aliyun-sls/web-track-browser';
|
|
4
5
|
import { IAudioConstraints } from 'media-device';
|
|
5
6
|
import { IProfile } from 'aliyun-rts-sdk';
|
|
6
7
|
import { IStreamConfig } from 'aliyun-rts-sdk';
|
|
7
8
|
import { IVideoConstraints } from 'media-device';
|
|
8
9
|
import { LocalStream } from 'aliyun-rts-sdk';
|
|
9
|
-
import { LogReporter } from 'browser-log-reporter';
|
|
10
10
|
import { RemoteStream } from 'aliyun-rts-sdk';
|
|
11
11
|
|
|
12
12
|
declare interface AliEngineCameraCapturerConfiguration {
|
|
@@ -41,7 +41,7 @@ export declare interface AliRtcAuthInfo {
|
|
|
41
41
|
/** 令牌 */
|
|
42
42
|
token: string;
|
|
43
43
|
/** 会议id */
|
|
44
|
-
|
|
44
|
+
sessionId?: string;
|
|
45
45
|
/** 角色鉴权值 */
|
|
46
46
|
role?: AliRtcSdkTokenRole;
|
|
47
47
|
}
|
|
@@ -203,11 +203,10 @@ export declare class AliRtcEngine extends default_2<AliRtcEngineEventListener> {
|
|
|
203
203
|
protected channelProfile: AliRtcSdkChannelProfile;
|
|
204
204
|
protected clientRole: AliRtcSdkClientRole;
|
|
205
205
|
protected signalingManager: SignalingManager;
|
|
206
|
-
protected
|
|
206
|
+
protected bizControl: BizControl;
|
|
207
207
|
protected liveTranscoding: AliRtcLiveTranscoding;
|
|
208
208
|
protected maxSignalingConnectRetryCount?: number;
|
|
209
|
-
protected
|
|
210
|
-
protected webTrackingClient: WebTrackingClient;
|
|
209
|
+
protected slsReporter: SLSReporter;
|
|
211
210
|
protected connectState: AliRtcConnectionStatus;
|
|
212
211
|
protected networkError: boolean;
|
|
213
212
|
private audioMixerPlugin;
|
|
@@ -249,7 +248,7 @@ export declare class AliRtcEngine extends default_2<AliRtcEngineEventListener> {
|
|
|
249
248
|
/**
|
|
250
249
|
* 监听 UM 事件
|
|
251
250
|
*/
|
|
252
|
-
private
|
|
251
|
+
private addBizControlListeners;
|
|
253
252
|
/**
|
|
254
253
|
* 添加信令处理
|
|
255
254
|
* @returns {void}
|
|
@@ -1163,6 +1162,11 @@ declare interface AliRtcEngineEventListener {
|
|
|
1163
1162
|
* @note 应该在收到该回调时弹出弹窗引导用户点击页面进行播放,用户点击页面后 SDK 会自动尝试播放
|
|
1164
1163
|
*/
|
|
1165
1164
|
remoteVideoAutoPlayFail: (uid: string, videoTrack: AliRtcVideoTrack) => void;
|
|
1165
|
+
/**
|
|
1166
|
+
* rtc 传输数据统计
|
|
1167
|
+
* @param stats 统计信息
|
|
1168
|
+
*/
|
|
1169
|
+
rtcStats: (stats: any) => void;
|
|
1166
1170
|
/**
|
|
1167
1171
|
* 发布视频流的数据统计
|
|
1168
1172
|
* @param aliRtcStats 统计信息
|
|
@@ -1476,6 +1480,8 @@ export declare enum AliRtcErrorCode {
|
|
|
1476
1480
|
|
|
1477
1481
|
declare class AliRtcLiveTranscoding {
|
|
1478
1482
|
authInfo?: AliRtcAuthInfo;
|
|
1483
|
+
private slsReporter;
|
|
1484
|
+
constructor(slsReporter: SLSReporter);
|
|
1479
1485
|
private doRequest;
|
|
1480
1486
|
setAuthInfo(authInfo: AliRtcAuthInfo): void;
|
|
1481
1487
|
clear(): void;
|
|
@@ -1786,6 +1792,7 @@ export declare abstract class AliRtcPlugin extends default_2<AliRtcPluginListene
|
|
|
1786
1792
|
lastOutputAudioTrack?: MediaStreamTrack;
|
|
1787
1793
|
lastInputVideoTrack?: MediaStreamTrack;
|
|
1788
1794
|
lastOutputVideoTrack?: MediaStreamTrack;
|
|
1795
|
+
private _hasCleared;
|
|
1789
1796
|
constructor(name: string, streamType?: AliRtcRawDataStreamType, trackType?: AliRtcPluginTrackType);
|
|
1790
1797
|
get initOptions(): {};
|
|
1791
1798
|
getOptions(): any;
|
|
@@ -2097,6 +2104,182 @@ declare enum AudioStreamSource {
|
|
|
2097
2104
|
Mixed = 2
|
|
2098
2105
|
}
|
|
2099
2106
|
|
|
2107
|
+
declare class BizControl extends default_2<BizControlListener> {
|
|
2108
|
+
/**
|
|
2109
|
+
* @ignore
|
|
2110
|
+
*/
|
|
2111
|
+
static logName: string;
|
|
2112
|
+
protected self: LocalUser | undefined;
|
|
2113
|
+
protected userMap: RemoteUserMap;
|
|
2114
|
+
private usersViewMap;
|
|
2115
|
+
rtsManager: RtsManager;
|
|
2116
|
+
protected localStreamManager: LocalStreamManager;
|
|
2117
|
+
protected authInfo?: AliRtcAuthInfo;
|
|
2118
|
+
protected signalingManager: SignalingManager;
|
|
2119
|
+
pluginManager: PluginManager;
|
|
2120
|
+
protected slsReporter: SLSReporter;
|
|
2121
|
+
private statsMonitorId?;
|
|
2122
|
+
private autoSubAudio;
|
|
2123
|
+
private autoSubVideo;
|
|
2124
|
+
private autoSubScreen;
|
|
2125
|
+
private wantSubAudio;
|
|
2126
|
+
private wantSubVideo;
|
|
2127
|
+
private wantSubScreen;
|
|
2128
|
+
private defaultStreamType;
|
|
2129
|
+
private audioMuted;
|
|
2130
|
+
private playoutVolume;
|
|
2131
|
+
private audioVolumeIndicationInterval;
|
|
2132
|
+
private indicationTimer;
|
|
2133
|
+
constructor(config: BizControlConfig);
|
|
2134
|
+
private addSignalingManagerListener;
|
|
2135
|
+
isAutoSubAudio(): boolean;
|
|
2136
|
+
setAutoSubAudio(value: boolean): void;
|
|
2137
|
+
isAutoSubVideo(): boolean;
|
|
2138
|
+
setAutoSubVideo(value: boolean): void;
|
|
2139
|
+
isAutoSubScreen(): boolean;
|
|
2140
|
+
setAutoSubScreen(value: boolean): void;
|
|
2141
|
+
isWantSubAudio(): boolean;
|
|
2142
|
+
setWantSubAudio(value: boolean): void;
|
|
2143
|
+
isWantSubVideo(): boolean;
|
|
2144
|
+
setWantSubVideo(value: boolean): void;
|
|
2145
|
+
isWantSubScreen(): boolean;
|
|
2146
|
+
setWantSubScreen(value: boolean): void;
|
|
2147
|
+
setRemoteDefaultVideoStreamType(type: AliRtcVideoStreamType): void;
|
|
2148
|
+
setRemoteUserVideoStreamType(userId: string, type: AliRtcVideoStreamType): void;
|
|
2149
|
+
setAudioMuted(mute: boolean): void;
|
|
2150
|
+
setLocalViewConfig(view: AliRtcLocalView, track: AliRtcVideoTrack): void;
|
|
2151
|
+
setRemoteViewConfig(uid: string, view: AliRtcLocalView, track: AliRtcVideoTrack): void;
|
|
2152
|
+
get channel(): string | undefined;
|
|
2153
|
+
get userId(): string | undefined;
|
|
2154
|
+
get remoteUsers(): RemoteUser[];
|
|
2155
|
+
/**
|
|
2156
|
+
* 获取推流对象,只能是自己
|
|
2157
|
+
*/
|
|
2158
|
+
get publisher(): LocalUser | undefined;
|
|
2159
|
+
get isSubscribing(): boolean;
|
|
2160
|
+
/**
|
|
2161
|
+
* 处理远端用户推流状态变化
|
|
2162
|
+
* @param {string} userId
|
|
2163
|
+
* @param {string} displayname
|
|
2164
|
+
* @param {string} callid
|
|
2165
|
+
* @param {string} pullStreamUrl
|
|
2166
|
+
* @param {TrackInfo[]} tracks
|
|
2167
|
+
* @returns {void}
|
|
2168
|
+
*/
|
|
2169
|
+
onRemotePublishStateChange(publishInfo: PublishUser): void;
|
|
2170
|
+
/**
|
|
2171
|
+
* 登陆成功后初始化用户管理,创建自己
|
|
2172
|
+
* @param {AliRtcAuthInfo} authInfo
|
|
2173
|
+
* @param {string} pushStreamUrl
|
|
2174
|
+
* @returns {Promise<void>}
|
|
2175
|
+
*/
|
|
2176
|
+
init(authInfo: AliRtcAuthInfo, data: JoinResult): void;
|
|
2177
|
+
/**
|
|
2178
|
+
* 离会后清除所有数据
|
|
2179
|
+
* @returns {Promise<void>}
|
|
2180
|
+
*/
|
|
2181
|
+
clear(): Promise<void>;
|
|
2182
|
+
private startStatsMonitor;
|
|
2183
|
+
private stopStatsMonitor;
|
|
2184
|
+
/**
|
|
2185
|
+
* 添加远端用户
|
|
2186
|
+
* @param {string} userId
|
|
2187
|
+
* @param {string} displayName
|
|
2188
|
+
* @returns {void}
|
|
2189
|
+
*/
|
|
2190
|
+
addUser(userId: string, displayName: string, reason: SubscribeReason): RemoteUser;
|
|
2191
|
+
/**
|
|
2192
|
+
* 执行添加远端用户
|
|
2193
|
+
* @param {string} userId
|
|
2194
|
+
* @param {string} displayName
|
|
2195
|
+
* @returns {RemoteUser}
|
|
2196
|
+
*/
|
|
2197
|
+
private executeAddUser;
|
|
2198
|
+
/**
|
|
2199
|
+
* 远端用户设备状态变化
|
|
2200
|
+
* @param {DeviceStatusChangeType} event
|
|
2201
|
+
* @param {string} userId
|
|
2202
|
+
*/
|
|
2203
|
+
private onRemoteDeviceStatusChange;
|
|
2204
|
+
/**
|
|
2205
|
+
* 远端流数据采集上报
|
|
2206
|
+
* @param {any} stat
|
|
2207
|
+
*/
|
|
2208
|
+
private onRemoteStatReport;
|
|
2209
|
+
/**
|
|
2210
|
+
* rts 单 PC 订阅超限
|
|
2211
|
+
*/
|
|
2212
|
+
private onSubscribeExceeds;
|
|
2213
|
+
/**
|
|
2214
|
+
* 移除远端用户
|
|
2215
|
+
* @param {LeaveInfo} user
|
|
2216
|
+
* @returns {Promise<void>}
|
|
2217
|
+
*/
|
|
2218
|
+
removeLeftUser(user: LeaveInfo): Promise<void>;
|
|
2219
|
+
/**
|
|
2220
|
+
* 更新远端用户数据
|
|
2221
|
+
* @param {JoinInfo[]} users
|
|
2222
|
+
* @returns {{joinList: JoinInfo[], leaveList: LeaveInfo[], presentList: JoinInfo[]}}
|
|
2223
|
+
*/
|
|
2224
|
+
updateUsers(users: JoinInfo[]): {
|
|
2225
|
+
joinList: JoinInfo[];
|
|
2226
|
+
leaveList: LeaveInfo[];
|
|
2227
|
+
presentList: JoinInfo[];
|
|
2228
|
+
};
|
|
2229
|
+
/**
|
|
2230
|
+
* 根据 userId 获取 RemoteUser
|
|
2231
|
+
* @param {string} userId
|
|
2232
|
+
* @returns {RemoteUser | undefined}
|
|
2233
|
+
*/
|
|
2234
|
+
getRemoteUser(userId: string): RemoteUser | undefined;
|
|
2235
|
+
/**
|
|
2236
|
+
* 更新远端用户设备信息
|
|
2237
|
+
* @param {RemoteUserStatus} user
|
|
2238
|
+
* @returns {boolean} true: 用户状态改变 false: 用户状态没有改变
|
|
2239
|
+
*/
|
|
2240
|
+
updateRemoteUserDeviceStatus(user: RemoteUserStatus): void;
|
|
2241
|
+
updateAudioWant(uid: string, sub: boolean): void;
|
|
2242
|
+
updateVideoWant(uid: string, sub: boolean): void;
|
|
2243
|
+
updateScreenWant(uid: string, sub: boolean): void;
|
|
2244
|
+
private stopIndication;
|
|
2245
|
+
private startIndication;
|
|
2246
|
+
enableAudioVolumeIndication(interval: number): void;
|
|
2247
|
+
setPlayoutVolume(volume: number): void;
|
|
2248
|
+
refreshAuthInfo(authInfo: AliRtcRefreshAuthInfo): void;
|
|
2249
|
+
setEnableMediaExtensionMsg(enable: boolean): void;
|
|
2250
|
+
setAudioRedEnabled(enable: boolean): void;
|
|
2251
|
+
}
|
|
2252
|
+
|
|
2253
|
+
declare interface BizControlConfig {
|
|
2254
|
+
slsReporter: SLSReporter;
|
|
2255
|
+
signalingManager: SignalingManager;
|
|
2256
|
+
}
|
|
2257
|
+
|
|
2258
|
+
declare interface BizControlListener {
|
|
2259
|
+
[ClientEventType.RtsSubscribeExceeds]: (userId: string, options?: SubscribeOptions) => void;
|
|
2260
|
+
[DeviceStatusChange.Remote]: (event: DeviceStatusChangeType, userId: string) => void;
|
|
2261
|
+
[ClientEventType.PullStreamStats]: (userId: string, stat: any, pullStreamUrl: string) => void;
|
|
2262
|
+
remoteTrackAvailableChange: (uid: string, aliRtcAudioTrack: AliRtcAudioTrack, aliRtcVideoTrack: AliRtcVideoTrack) => void;
|
|
2263
|
+
audioSubscribeStateChanged: (uid: string, oldState: AliRtcSubscribeState, newState: AliRtcSubscribeState, elapseSinceLastState: number, channel: string) => void;
|
|
2264
|
+
videoSubscribeStateChanged: (uid: string, oldState: AliRtcSubscribeState, newState: AliRtcSubscribeState, elapseSinceLastState: number, channel: string) => void;
|
|
2265
|
+
screenSubscribeStateChanged: (uid: string, oldState: AliRtcSubscribeState, newState: AliRtcSubscribeState, elapseSinceLastState: number, channel: string) => void;
|
|
2266
|
+
userAudioMuted: (uid: string, isMute: boolean) => void;
|
|
2267
|
+
userVideoMuted: (uid: string, isMute: boolean) => void;
|
|
2268
|
+
userScreenMuted: (userId: string, isMute: boolean) => void;
|
|
2269
|
+
audioVolume: (speakers: {
|
|
2270
|
+
userId: string;
|
|
2271
|
+
volume: number;
|
|
2272
|
+
}[]) => void;
|
|
2273
|
+
rtcLocalVideoStats: (stats: AliRtcLocalVideoStats[]) => void;
|
|
2274
|
+
rtcLocalAudioStats: (stats: AliRtcLocalAudioStats[]) => void;
|
|
2275
|
+
rtcRemoteVideoStats: (stats: AliRtcRemoteVideoStats[]) => void;
|
|
2276
|
+
rtcRemoteAudioStats: (stats: AliRtcRemoteAudioStats[]) => void;
|
|
2277
|
+
rtcStats: (stats: any) => void;
|
|
2278
|
+
remoteAudioAutoPlayFail: (uid: string) => void;
|
|
2279
|
+
remoteVideoAutoPlayFail: (uid: string, track: AliRtcVideoTrack) => void;
|
|
2280
|
+
remoteSubscribeError: (error: AliRtcError) => void;
|
|
2281
|
+
}
|
|
2282
|
+
|
|
2100
2283
|
declare enum ClientEventType {
|
|
2101
2284
|
PullStreamStats = "remoteStat",
|
|
2102
2285
|
RtsSubscribeExceeds = "rtsSubscribeExceeds",
|
|
@@ -2153,16 +2336,6 @@ declare enum DisplayType {
|
|
|
2153
2336
|
WHEN_NO_VIDEO = 2
|
|
2154
2337
|
}
|
|
2155
2338
|
|
|
2156
|
-
declare enum EventId {
|
|
2157
|
-
JoinChannel = 70012,
|
|
2158
|
-
JoinChannelRes = 70013,
|
|
2159
|
-
LeaveChannel = 70015,
|
|
2160
|
-
EnvCheck = 100001,
|
|
2161
|
-
Push = 10030,
|
|
2162
|
-
Pull = 10050,
|
|
2163
|
-
SubscribeStats = 10080
|
|
2164
|
-
}
|
|
2165
|
-
|
|
2166
2339
|
declare interface ISignalingInterface {
|
|
2167
2340
|
join(authInfo: AliRtcAuthInfo, userName: string, connectRetryCount?: number): Promise<JoinResult>;
|
|
2168
2341
|
leave(): Promise<SignalingResult>;
|
|
@@ -2234,6 +2407,7 @@ declare class LocalStreamManager extends default_2<LocalStreamManagerListener> {
|
|
|
2234
2407
|
*/
|
|
2235
2408
|
static logName: string;
|
|
2236
2409
|
private pluginManager;
|
|
2410
|
+
private slsReporter;
|
|
2237
2411
|
private publishingCameraVideoStream;
|
|
2238
2412
|
private publishingScreenVideoStream;
|
|
2239
2413
|
cameraStreamInfo: AliRtcLocalStreamInfo;
|
|
@@ -2244,7 +2418,7 @@ declare class LocalStreamManager extends default_2<LocalStreamManagerListener> {
|
|
|
2244
2418
|
private _publishLocalAudioStreamEnabled;
|
|
2245
2419
|
private _publishLocalVideoStreamEnabled;
|
|
2246
2420
|
private _publishLocalScreenStreamEnabled;
|
|
2247
|
-
constructor(pluginManager: PluginManager);
|
|
2421
|
+
constructor(pluginManager: PluginManager, slsReporter: SLSReporter);
|
|
2248
2422
|
get hasCamera(): boolean;
|
|
2249
2423
|
get audioCaptureDisabled(): boolean;
|
|
2250
2424
|
set audioCaptureDisabled(closed: boolean);
|
|
@@ -2337,6 +2511,7 @@ declare class LocalUser extends User {
|
|
|
2337
2511
|
*/
|
|
2338
2512
|
static logName: string;
|
|
2339
2513
|
protected url: string;
|
|
2514
|
+
private joinTime;
|
|
2340
2515
|
private _isPublishing;
|
|
2341
2516
|
private publishPromise;
|
|
2342
2517
|
private previewElements;
|
|
@@ -2347,8 +2522,11 @@ declare class LocalUser extends User {
|
|
|
2347
2522
|
protected signalingManager: SignalingManager;
|
|
2348
2523
|
traceId: string;
|
|
2349
2524
|
private monitorTimerId?;
|
|
2350
|
-
|
|
2351
|
-
|
|
2525
|
+
private monitorDataCache;
|
|
2526
|
+
private trackTraceIdMap;
|
|
2527
|
+
private candidateDataCache;
|
|
2528
|
+
private pcMediaStatsMap;
|
|
2529
|
+
protected slsReporter: SLSReporter;
|
|
2352
2530
|
private audioPubState;
|
|
2353
2531
|
private videoPubState;
|
|
2354
2532
|
private videoSmallPubState;
|
|
@@ -2442,12 +2620,15 @@ declare class LocalUser extends User {
|
|
|
2442
2620
|
createLocalStream(params: LocalStreamConfig): Promise<LocalStream | undefined>;
|
|
2443
2621
|
stopLocalStream(options: PublishOptions): Promise<void>;
|
|
2444
2622
|
private compareAndPublish;
|
|
2623
|
+
private reportAudioProfile;
|
|
2624
|
+
private reportVideoProfile;
|
|
2625
|
+
private reportScreenProfile;
|
|
2445
2626
|
/**
|
|
2446
2627
|
* 开始推流
|
|
2447
2628
|
* @param isResume 是否是恢复推流
|
|
2448
2629
|
* @returns
|
|
2449
2630
|
*/
|
|
2450
|
-
startPublish(isResume?: boolean): Promise<void>;
|
|
2631
|
+
startPublish(isResume?: boolean, reason?: PublishReason): Promise<void>;
|
|
2451
2632
|
/**
|
|
2452
2633
|
* 对比本地流和正在推流,进行推流更新
|
|
2453
2634
|
* @param isResume 是否是恢复推流
|
|
@@ -2495,6 +2676,10 @@ declare class LocalUser extends User {
|
|
|
2495
2676
|
private onTrackEnd;
|
|
2496
2677
|
private resetPreviewElements;
|
|
2497
2678
|
private resetSecondayPreviewElements;
|
|
2679
|
+
getMediaStats(id: string): any;
|
|
2680
|
+
private reportPublishMonitor;
|
|
2681
|
+
private reportNetwork;
|
|
2682
|
+
private startStreamMonitor;
|
|
2498
2683
|
/**
|
|
2499
2684
|
* 停止本地流数据采集
|
|
2500
2685
|
*/
|
|
@@ -2519,14 +2704,14 @@ declare class LocalUser extends User {
|
|
|
2519
2704
|
getStats(): Promise<{
|
|
2520
2705
|
audio: AliRtcLocalAudioStats[];
|
|
2521
2706
|
video: AliRtcLocalVideoStats[];
|
|
2707
|
+
transport: any;
|
|
2522
2708
|
}>;
|
|
2523
2709
|
}
|
|
2524
2710
|
|
|
2525
2711
|
declare interface LocalUserConfig {
|
|
2526
2712
|
rtsManager: RtsManager;
|
|
2527
2713
|
localStreamManager: LocalStreamManager;
|
|
2528
|
-
|
|
2529
|
-
webTrackingClient: WebTrackingClient;
|
|
2714
|
+
slsReporter: SLSReporter;
|
|
2530
2715
|
signalingManager: SignalingManager;
|
|
2531
2716
|
pluginManager: PluginManager;
|
|
2532
2717
|
audioVolumeIndicationInterval: number;
|
|
@@ -2537,12 +2722,18 @@ declare interface LocalUserConfig {
|
|
|
2537
2722
|
* 在入会之前,会将埋点缓存,入会后以每200ms一条的速度将缓存的埋点按顺序上报
|
|
2538
2723
|
*/
|
|
2539
2724
|
declare class LogClient {
|
|
2540
|
-
protected
|
|
2725
|
+
protected tracker?: default_3;
|
|
2541
2726
|
protected param?: any;
|
|
2542
2727
|
protected msgCacheArr: any[];
|
|
2543
2728
|
protected index: number;
|
|
2729
|
+
protected stsOpt?: any;
|
|
2730
|
+
protected slsToken?: SLSSTSToken;
|
|
2731
|
+
protected ossToken?: OSSSTSToken;
|
|
2732
|
+
protected uaParserResult: UAParser.IResult;
|
|
2544
2733
|
constructor();
|
|
2734
|
+
private createTracker;
|
|
2545
2735
|
start(info: AliRtcAuthInfo): void;
|
|
2736
|
+
updateToken(slsToken: SLSSTSToken, ossToken?: OSSSTSToken): void;
|
|
2546
2737
|
/**
|
|
2547
2738
|
* 断开连接
|
|
2548
2739
|
*/
|
|
@@ -2556,11 +2747,10 @@ declare class LogClient {
|
|
|
2556
2747
|
* 初始化公共参数
|
|
2557
2748
|
*/
|
|
2558
2749
|
protected initParam(info: AliRtcAuthInfo): void;
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
protected realSendReport(log: any): void;
|
|
2750
|
+
}
|
|
2751
|
+
|
|
2752
|
+
declare interface LogInfo {
|
|
2753
|
+
[key: string]: string | number;
|
|
2564
2754
|
}
|
|
2565
2755
|
|
|
2566
2756
|
declare interface MediaTrackInfo {
|
|
@@ -2590,6 +2780,24 @@ declare enum MsidType {
|
|
|
2590
2780
|
Screen = "sophon_video_screen_share"
|
|
2591
2781
|
}
|
|
2592
2782
|
|
|
2783
|
+
declare interface OSSSTSToken {
|
|
2784
|
+
access_key_id: string;
|
|
2785
|
+
access_key_secret: string;
|
|
2786
|
+
security_token: string;
|
|
2787
|
+
region_endpoint: string;
|
|
2788
|
+
bucket_name: string;
|
|
2789
|
+
expiration: number;
|
|
2790
|
+
}
|
|
2791
|
+
|
|
2792
|
+
declare interface OSSToken {
|
|
2793
|
+
access_key_id: string;
|
|
2794
|
+
access_key_secret: string;
|
|
2795
|
+
security_token: string;
|
|
2796
|
+
region_endpoint: string;
|
|
2797
|
+
bucket_name: string;
|
|
2798
|
+
expiration: number;
|
|
2799
|
+
}
|
|
2800
|
+
|
|
2593
2801
|
declare class PluginManager extends default_2<PluginManagerListener> {
|
|
2594
2802
|
private plugins;
|
|
2595
2803
|
add(plugin: AliRtcPlugin, options: any): void;
|
|
@@ -2624,6 +2832,7 @@ declare interface PublishExtraParams {
|
|
|
2624
2832
|
}
|
|
2625
2833
|
|
|
2626
2834
|
declare interface PublishInfo {
|
|
2835
|
+
type: PublishType;
|
|
2627
2836
|
userid: string;
|
|
2628
2837
|
sessionid: string;
|
|
2629
2838
|
displayname: string;
|
|
@@ -2643,6 +2852,11 @@ declare type PublishOptions = StreamOptions & {
|
|
|
2643
2852
|
vMsid?: string;
|
|
2644
2853
|
};
|
|
2645
2854
|
|
|
2855
|
+
declare enum PublishReason {
|
|
2856
|
+
MANUAL = 0,
|
|
2857
|
+
JOINCHANNEL = 1
|
|
2858
|
+
}
|
|
2859
|
+
|
|
2646
2860
|
declare interface PublishStreamInfo {
|
|
2647
2861
|
audio?: LocalStream;
|
|
2648
2862
|
video?: LocalStream;
|
|
@@ -2652,6 +2866,14 @@ declare interface PublishStreamInfo {
|
|
|
2652
2866
|
screenProfile?: LocalProfileManager;
|
|
2653
2867
|
}
|
|
2654
2868
|
|
|
2869
|
+
declare enum PublishType {
|
|
2870
|
+
Add = "add",
|
|
2871
|
+
Delete = "delete",
|
|
2872
|
+
Replace = "replace",
|
|
2873
|
+
Stop = "stop",
|
|
2874
|
+
UnPublish = "unpublish"
|
|
2875
|
+
}
|
|
2876
|
+
|
|
2655
2877
|
declare interface PublishUser {
|
|
2656
2878
|
callid: string;
|
|
2657
2879
|
clientrole?: string;
|
|
@@ -2718,6 +2940,7 @@ declare class RemoteStreamInfo extends default_2<StreamListener> {
|
|
|
2718
2940
|
* @returns
|
|
2719
2941
|
*/
|
|
2720
2942
|
getScreenInfo(): RemoteMediaTrackInfo;
|
|
2943
|
+
get subscribingInfos(): RemoteMediaTrackInfo[];
|
|
2721
2944
|
/**
|
|
2722
2945
|
* 远端流是否包含音频轨道
|
|
2723
2946
|
* @returns
|
|
@@ -2795,7 +3018,7 @@ declare class RemoteUser extends User {
|
|
|
2795
3018
|
static logName: string;
|
|
2796
3019
|
remoteCallid: string;
|
|
2797
3020
|
remoteUserInfo: AliRtcRemoteUserInfo;
|
|
2798
|
-
protected
|
|
3021
|
+
protected localUser?: LocalUser;
|
|
2799
3022
|
protected lastPubId: string;
|
|
2800
3023
|
protected stream?: RemoteStream;
|
|
2801
3024
|
protected screenStream?: RemoteStream;
|
|
@@ -2807,13 +3030,13 @@ declare class RemoteUser extends User {
|
|
|
2807
3030
|
protected secondaryMediaStream?: MediaStream;
|
|
2808
3031
|
protected prevSubConfig?: SubConfig;
|
|
2809
3032
|
protected signalingManager: SignalingManager;
|
|
2810
|
-
protected
|
|
2811
|
-
protected webTrackingClient: WebTrackingClient;
|
|
3033
|
+
protected slsReporter: SLSReporter;
|
|
2812
3034
|
private wantSubAudio;
|
|
2813
3035
|
private wantSubVideo;
|
|
2814
3036
|
private wantSubScreen;
|
|
2815
3037
|
private defaultVideoStreamType;
|
|
2816
3038
|
private audioMuted;
|
|
3039
|
+
private playoutVolume;
|
|
2817
3040
|
private audioSubState;
|
|
2818
3041
|
private videoSubState;
|
|
2819
3042
|
private videoLargeSubState;
|
|
@@ -2821,7 +3044,9 @@ declare class RemoteUser extends User {
|
|
|
2821
3044
|
private screenSubState;
|
|
2822
3045
|
streamInfo: RemoteStreamInfo;
|
|
2823
3046
|
streamUrl: string;
|
|
2824
|
-
private
|
|
3047
|
+
private monitorTimerId?;
|
|
3048
|
+
private monitorDataCache;
|
|
3049
|
+
private trackTraceIdMap;
|
|
2825
3050
|
constructor(config: RemoteUserConfig);
|
|
2826
3051
|
isWantSubAudio(): boolean;
|
|
2827
3052
|
setWantSubAudio(value: boolean): void;
|
|
@@ -2874,7 +3099,7 @@ declare class RemoteUser extends User {
|
|
|
2874
3099
|
* @param {SubscribeOptions} options
|
|
2875
3100
|
* @returns {Promise<void>} 返回可播放的 MediaStream,可能为空。如果同时订阅了主流和辅流,只会返回主流对应的 MediaStream
|
|
2876
3101
|
*/
|
|
2877
|
-
subscribe(options?: SubscribeOptions): Promise<void>;
|
|
3102
|
+
subscribe(options?: SubscribeOptions, reason?: SubscribeReason, startTs?: number): Promise<void>;
|
|
2878
3103
|
/**
|
|
2879
3104
|
* 订阅远端流
|
|
2880
3105
|
* @param {SubscribeOptions} options 订阅配置
|
|
@@ -2922,7 +3147,7 @@ declare class RemoteUser extends User {
|
|
|
2922
3147
|
* 尝试更新订阅
|
|
2923
3148
|
* 1. 需要新增订阅的情况:想要订阅 & 没有正在订阅 & 远端有流
|
|
2924
3149
|
*/
|
|
2925
|
-
updateSubscribe(): {
|
|
3150
|
+
updateSubscribe(reason: SubscribeReason): {
|
|
2926
3151
|
addOption: SubscribeOptions;
|
|
2927
3152
|
deleteOption: SubscribeOptions;
|
|
2928
3153
|
};
|
|
@@ -2963,6 +3188,12 @@ declare class RemoteUser extends User {
|
|
|
2963
3188
|
* @param {number} interval 时间间隔
|
|
2964
3189
|
*/
|
|
2965
3190
|
enableAudioVolumeIndication(interval: number): void;
|
|
3191
|
+
private reportSubscribeMonitor;
|
|
3192
|
+
private startStreamMonitor;
|
|
3193
|
+
/**
|
|
3194
|
+
* 停止本地流数据采集
|
|
3195
|
+
*/
|
|
3196
|
+
private stopStreamMonitor;
|
|
2966
3197
|
}
|
|
2967
3198
|
|
|
2968
3199
|
declare interface RemoteUserConfig {
|
|
@@ -2972,10 +3203,9 @@ declare interface RemoteUserConfig {
|
|
|
2972
3203
|
usersViewMap: {
|
|
2973
3204
|
[key: string]: RemoteUserViewMap;
|
|
2974
3205
|
};
|
|
2975
|
-
|
|
2976
|
-
webTrackingClient: WebTrackingClient;
|
|
3206
|
+
slsReporter: SLSReporter;
|
|
2977
3207
|
signalingManager: SignalingManager;
|
|
2978
|
-
|
|
3208
|
+
localUser?: LocalUser;
|
|
2979
3209
|
audioVolumeIndicationInterval: number;
|
|
2980
3210
|
playoutVolume: number;
|
|
2981
3211
|
}
|
|
@@ -2995,242 +3225,71 @@ declare interface RemoteUserViewMap {
|
|
|
2995
3225
|
}
|
|
2996
3226
|
|
|
2997
3227
|
/**
|
|
2998
|
-
*
|
|
2999
|
-
* 每个埋点暴露对应的接口
|
|
3228
|
+
* RoomServerMessageCenter支持的事件
|
|
3000
3229
|
*/
|
|
3001
|
-
declare
|
|
3002
|
-
|
|
3003
|
-
|
|
3230
|
+
declare interface RoomServerListener {
|
|
3231
|
+
onJoinChannelResult: (data: any) => void;
|
|
3232
|
+
onPublishResult: (code: number, tid: string, description: string) => void;
|
|
3233
|
+
onNotifyJoin: (users: JoinInfo[]) => void;
|
|
3234
|
+
onNotifyStatus: (users: RemoteUserStatus[]) => void;
|
|
3235
|
+
onLeaveResult: (code: number, tid: string) => void;
|
|
3236
|
+
onRoleUpdateResult: (code: number, tid: string, description: string) => void;
|
|
3237
|
+
onRefreshUrlResult: (data: any) => void;
|
|
3238
|
+
onNotifyLeave: (users: LeaveInfo[]) => void;
|
|
3239
|
+
onNotifyPublish: (users: PublishUser[]) => void;
|
|
3240
|
+
onStatusReport: (code: number, tid: string, description: string) => void;
|
|
3241
|
+
onBye: (reason: AliRtcOnByeType, description: string) => void;
|
|
3242
|
+
onKeepAliveRsp: () => void;
|
|
3243
|
+
onConnectFail: (err: AliRtcError) => void;
|
|
3244
|
+
onNetworkError: (err: AliRtcError) => void;
|
|
3245
|
+
onAuthInvalid: () => void;
|
|
3246
|
+
onReconnectStart: () => void;
|
|
3247
|
+
onReconnectFail: (err: AliRtcError) => void;
|
|
3248
|
+
onReconnectSuccess: (users: JoinInfo[]) => void;
|
|
3249
|
+
onError: (err: AliRtcError) => void;
|
|
3250
|
+
}
|
|
3251
|
+
|
|
3252
|
+
declare class RtsManager extends default_2<RtsManagerEventListener> {
|
|
3004
3253
|
/**
|
|
3005
|
-
*
|
|
3006
|
-
* @param authInfo
|
|
3254
|
+
* @ignore
|
|
3007
3255
|
*/
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
|
|
3013
|
-
|
|
3014
|
-
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
/**
|
|
3046
|
-
* 推流事件上报
|
|
3047
|
-
* @param {string} callid
|
|
3048
|
-
* @param {boolean} isLargeVideo
|
|
3049
|
-
* @param {boolean} isSmallVideo
|
|
3050
|
-
* @param {boolean} isScreenShare
|
|
3051
|
-
* @param {boolean} isAudio
|
|
3052
|
-
* @param {number} result
|
|
3053
|
-
* @param {string} tid
|
|
3054
|
-
* @param {number} pubTime
|
|
3055
|
-
*/
|
|
3056
|
-
reportPublish(callid: string, isLargeVideo: boolean, isSmallVideo: boolean, isScreenShare: boolean, isAudio: boolean, result: number | undefined, tid: string, pubTime: number): void;
|
|
3057
|
-
/**
|
|
3058
|
-
* 调用 client.publish 推流上报事件及流轨道等信息
|
|
3059
|
-
* @param {boolean} [isLargeVideo] 是否推视频大流
|
|
3060
|
-
* @param {boolean} [isSmallVideo] 是否推视频小流
|
|
3061
|
-
* @param {boolean} [isScreenShare] 是否推屏幕流
|
|
3062
|
-
* @param {boolean} [isAudio] 是否推音频流
|
|
3063
|
-
*/
|
|
3064
|
-
reportPublishInvoked(isLargeVideo?: boolean, isSmallVideo?: boolean, isScreenShare?: boolean, isAudio?: boolean): void;
|
|
3065
|
-
/**
|
|
3066
|
-
* republish事件上报
|
|
3067
|
-
* @param callid
|
|
3068
|
-
* @param islarge 是否推大流
|
|
3069
|
-
* @param isScreenShare 是否推屏幕流
|
|
3070
|
-
* @param isAudio 是否推音频流
|
|
3071
|
-
* @param result 推流结果(0成功,非0失败)
|
|
3072
|
-
* @param tid tid
|
|
3073
|
-
* @param repubTime repub耗时
|
|
3074
|
-
* @param msg 详情描述
|
|
3075
|
-
*/
|
|
3076
|
-
reportRepublish(callid: string, isLarge: boolean, isScreen: boolean, isAudio: boolean, result: number, tid: string, repubTime: number, msg: string): void;
|
|
3077
|
-
/**
|
|
3078
|
-
* 用户调用LocalStream.addTrack 或者 LocalStream.removeTrack
|
|
3079
|
-
* @param callid
|
|
3080
|
-
* @param trackType
|
|
3081
|
-
* @param state -1: remove 0: replace 1: add
|
|
3082
|
-
*/
|
|
3083
|
-
reportRepublishInvoked(callid: string, trackType: string, state: 0 | 1 | -1): void;
|
|
3084
|
-
/**
|
|
3085
|
-
* 停止推流事件上报
|
|
3086
|
-
* @param {string} callid
|
|
3087
|
-
* @param {number} unpubTime
|
|
3088
|
-
* @param {number} result
|
|
3089
|
-
* @param {string} tid
|
|
3090
|
-
*/
|
|
3091
|
-
reportUnpublish(callid: string, unpubTime: number, result: number, tid: string): void;
|
|
3092
|
-
/**
|
|
3093
|
-
* 调用 client.unpublish 停止推流上报事件
|
|
3094
|
-
*/
|
|
3095
|
-
reportUnpublishInvoked(): void;
|
|
3096
|
-
/**
|
|
3097
|
-
* 订阅事件埋点
|
|
3098
|
-
* @param {string} callid
|
|
3099
|
-
* @param {string} remoteid
|
|
3100
|
-
* @param {boolean} isLargeVideo
|
|
3101
|
-
* @param {boolean} isSmallVideo
|
|
3102
|
-
* @param {boolean} isScreenShare
|
|
3103
|
-
* @param {boolean} isAudio
|
|
3104
|
-
* @param {number} result
|
|
3105
|
-
* @param {string} tid
|
|
3106
|
-
* @param {number} subTime
|
|
3107
|
-
*/
|
|
3108
|
-
reportSubscribe(callid: string, remoteid: string, isLargeVideo: boolean, isSmallVideo: boolean, isScreenShare: boolean, isAudio: boolean, result: number, tid: string, subTime: number, usrid: string): void;
|
|
3109
|
-
/**
|
|
3110
|
-
* 调用 client.subscribe 拉流上报事件及用户信息、流轨道等信息
|
|
3111
|
-
* @param {string} rmtid 远程流所属的用户id
|
|
3112
|
-
* @param {boolean} [isLargeVideo] 是否推视频大流
|
|
3113
|
-
* @param {boolean} [isSmallVideo] 是否推视频小流
|
|
3114
|
-
* @param {boolean} [isScreenShare] 是否推屏幕流
|
|
3115
|
-
* @param {boolean} [isAudio] 是否推音频流
|
|
3116
|
-
*/
|
|
3117
|
-
reportSubscribeInvoked(rmtid?: string, isLargeVideo?: boolean, isSmallVideo?: boolean, isScreenShare?: boolean, isAudio?: boolean): void;
|
|
3118
|
-
/**
|
|
3119
|
-
* 停止订阅事件埋点
|
|
3120
|
-
* @param {string} callid
|
|
3121
|
-
* @param {string} remoteid
|
|
3122
|
-
* @param {number} unsubTime
|
|
3123
|
-
* @param {number} result
|
|
3124
|
-
* @param {string} tid
|
|
3125
|
-
*/
|
|
3126
|
-
reportUnsubscribe(callid: string, remoteid: string, unsubTime: number, result: number, tid: string): void;
|
|
3127
|
-
/**
|
|
3128
|
-
* 调用 client.unsubscribe 停止拉流上报事件
|
|
3129
|
-
* @param {string} rmtid 远程流所属的用户id
|
|
3130
|
-
*/
|
|
3131
|
-
reportUnsubscribeInvoked(rmtid?: string): void;
|
|
3132
|
-
/**
|
|
3133
|
-
* 更新角色埋点
|
|
3134
|
-
* @param {string|undefined} or 旧的角色
|
|
3135
|
-
* @param {string} nr 新的角色
|
|
3136
|
-
* @param {number} ctm 耗时
|
|
3137
|
-
* @param {number} rslt 是否成功
|
|
3138
|
-
*/
|
|
3139
|
-
reportRoleUpdate(or: string | undefined, nr: string, ctm: number, rslt: number): void;
|
|
3140
|
-
/**
|
|
3141
|
-
* 调用 client.setClientRole 更新角色上报事件
|
|
3142
|
-
* @param {string} nr 新角色值
|
|
3143
|
-
*/
|
|
3144
|
-
reportRoleUpdateInvoked(nr: string): void;
|
|
3145
|
-
/**
|
|
3146
|
-
* 设置camera videoprofile
|
|
3147
|
-
*/
|
|
3148
|
-
reportVideoProfile(profile: string): void;
|
|
3149
|
-
/**
|
|
3150
|
-
* 设置screenshare videoprofile
|
|
3151
|
-
*/
|
|
3152
|
-
reportScreenProfile(profile: string): void;
|
|
3153
|
-
/**
|
|
3154
|
-
* 错误事件埋点
|
|
3155
|
-
* @param err
|
|
3156
|
-
*/
|
|
3157
|
-
reportError(err: any): void;
|
|
3158
|
-
/**
|
|
3159
|
-
* 日志埋点
|
|
3160
|
-
* 在埋点中增加tm字段,表示发生埋点的客户端本地时间
|
|
3161
|
-
* @param {any} param 埋点内容
|
|
3162
|
-
*/
|
|
3163
|
-
protected log(param: any): void;
|
|
3164
|
-
/**
|
|
3165
|
-
* 将Object转换成string
|
|
3166
|
-
* @param {any} data
|
|
3167
|
-
* @returns {string}
|
|
3168
|
-
*/
|
|
3169
|
-
protected data2String(data: any): string;
|
|
3170
|
-
}
|
|
3171
|
-
|
|
3172
|
-
/**
|
|
3173
|
-
* RoomServerMessageCenter支持的事件
|
|
3174
|
-
*/
|
|
3175
|
-
declare interface RoomServerListener {
|
|
3176
|
-
onJoinChannelResult: (data: any) => void;
|
|
3177
|
-
onPublishResult: (code: number, tid: string, description: string) => void;
|
|
3178
|
-
onNotifyJoin: (users: JoinInfo[]) => void;
|
|
3179
|
-
onNotifyStatus: (users: RemoteUserStatus[]) => void;
|
|
3180
|
-
onLeaveResult: (code: number, tid: string) => void;
|
|
3181
|
-
onRoleUpdateResult: (code: number, tid: string, description: string) => void;
|
|
3182
|
-
onRefreshUrlResult: (data: any) => void;
|
|
3183
|
-
onNotifyLeave: (users: LeaveInfo[]) => void;
|
|
3184
|
-
onNotifyPublish: (users: PublishUser[]) => void;
|
|
3185
|
-
onStatusReport: (code: number, tid: string, description: string) => void;
|
|
3186
|
-
onBye: (reason: AliRtcOnByeType, description: string) => void;
|
|
3187
|
-
onKeepAliveRsp: () => void;
|
|
3188
|
-
onConnectFail: (err: AliRtcError) => void;
|
|
3189
|
-
onNetworkError: (err: AliRtcError) => void;
|
|
3190
|
-
onAuthInvalid: () => void;
|
|
3191
|
-
onReconnectStart: () => void;
|
|
3192
|
-
onReconnectFail: (err: AliRtcError) => void;
|
|
3193
|
-
onReconnectSuccess: (users: JoinInfo[]) => void;
|
|
3194
|
-
onError: (err: AliRtcError) => void;
|
|
3195
|
-
}
|
|
3196
|
-
|
|
3197
|
-
declare class RtsManager extends default_2<RtsManagerEventListener> {
|
|
3198
|
-
/**
|
|
3199
|
-
* @ignore
|
|
3200
|
-
*/
|
|
3201
|
-
static logName: string;
|
|
3202
|
-
private rts;
|
|
3203
|
-
private encodedInsertableStreams;
|
|
3204
|
-
private audioRedEnabled;
|
|
3205
|
-
private localStreamManager;
|
|
3206
|
-
private connecting;
|
|
3207
|
-
private connected;
|
|
3208
|
-
private connectionResolve?;
|
|
3209
|
-
connectingPromise?: Promise<unknown>;
|
|
3210
|
-
private dcResolve?;
|
|
3211
|
-
dcConnectingPromise?: Promise<unknown>;
|
|
3212
|
-
private _publishingTracks;
|
|
3213
|
-
constructor(localStreamManager: LocalStreamManager);
|
|
3214
|
-
setEncodedInsertableStreams(enable: boolean): void;
|
|
3215
|
-
setAudioRedEnabled(enable: boolean): void;
|
|
3216
|
-
destroy(): void;
|
|
3217
|
-
private startConnect;
|
|
3218
|
-
private setConnected;
|
|
3219
|
-
get isConnecting(): boolean;
|
|
3220
|
-
get isConnected(): boolean;
|
|
3221
|
-
get publishingTracks(): TrackInfo[];
|
|
3222
|
-
private getPubMsid;
|
|
3223
|
-
private updatePublishingTracks;
|
|
3224
|
-
private httpPublish;
|
|
3225
|
-
private waitPublishSender;
|
|
3226
|
-
private checkSubscribeStats;
|
|
3227
|
-
getPublishVideoStats(streamUrl: string, msid?: string): Promise<unknown>;
|
|
3228
|
-
getPublishAudioStats(streamUrl: string, msid?: string): Promise<unknown>;
|
|
3229
|
-
publishAdd(streamUrl: string, stream: LocalStream, extra?: PublishExtraParams, isResume?: boolean, retryTimes?: number, waitSender?: boolean): Promise<string>;
|
|
3230
|
-
publishDelete(streamUrl: string, options: PublishOptions): Promise<string>;
|
|
3231
|
-
publishReplace(streamUrl: string, stream: LocalStream, extra?: PublishExtraParams): Promise<string>;
|
|
3232
|
-
publishStop(streamUrl: string): Promise<string>;
|
|
3233
|
-
unpublish(): Promise<void>;
|
|
3256
|
+
static logName: string;
|
|
3257
|
+
private rts;
|
|
3258
|
+
private encodedInsertableStreams;
|
|
3259
|
+
private audioRedEnabled;
|
|
3260
|
+
private localStreamManager;
|
|
3261
|
+
private slsReporter;
|
|
3262
|
+
private connecting;
|
|
3263
|
+
private connected;
|
|
3264
|
+
private _pcTraceId;
|
|
3265
|
+
private _localJoinTime;
|
|
3266
|
+
private connectionResolve?;
|
|
3267
|
+
connectingPromise?: Promise<unknown>;
|
|
3268
|
+
private dcResolve?;
|
|
3269
|
+
dcConnectingPromise?: Promise<unknown>;
|
|
3270
|
+
private _publishingTracks;
|
|
3271
|
+
constructor(localStreamManager: LocalStreamManager, slsReporter: SLSReporter);
|
|
3272
|
+
get pcTraceId(): string;
|
|
3273
|
+
set localJoinTime(time: number);
|
|
3274
|
+
setEncodedInsertableStreams(enable: boolean): void;
|
|
3275
|
+
setAudioRedEnabled(enable: boolean): void;
|
|
3276
|
+
destroy(): void;
|
|
3277
|
+
private startConnect;
|
|
3278
|
+
private setConnected;
|
|
3279
|
+
get isConnecting(): boolean;
|
|
3280
|
+
get isConnected(): boolean;
|
|
3281
|
+
get publishingTracks(): TrackInfo[];
|
|
3282
|
+
private getPubMsid;
|
|
3283
|
+
private updatePublishingTracks;
|
|
3284
|
+
private httpPublish;
|
|
3285
|
+
private waitPublishSender;
|
|
3286
|
+
getPublishVideoStats(streamUrl: string, msid?: string): Promise<unknown>;
|
|
3287
|
+
getPublishAudioStats(streamUrl: string, msid?: string): Promise<unknown>;
|
|
3288
|
+
publishAdd(streamUrl: string, stream: LocalStream, callId: string, extra?: PublishExtraParams, isResume?: boolean, retryTimes?: number, waitSender?: boolean, reason?: PublishReason): Promise<string>;
|
|
3289
|
+
publishDelete(streamUrl: string, options: PublishOptions): Promise<string>;
|
|
3290
|
+
publishReplace(streamUrl: string, stream: LocalStream, extra?: PublishExtraParams): Promise<string>;
|
|
3291
|
+
publishStop(streamUrl: string): Promise<string>;
|
|
3292
|
+
unpublish(): Promise<void>;
|
|
3234
3293
|
/**
|
|
3235
3294
|
* 获取 sub/subAdd config
|
|
3236
3295
|
* @param {ISubscribeConfig | ISubConfigItem} options
|
|
@@ -3244,17 +3303,12 @@ declare class RtsManager extends default_2<RtsManagerEventListener> {
|
|
|
3244
3303
|
stream: any;
|
|
3245
3304
|
} | undefined>;
|
|
3246
3305
|
subscibeStop(streamUrl: string): Promise<void>;
|
|
3247
|
-
publish(streamUrl: string, isResume?: boolean): Promise<string>;
|
|
3248
|
-
subscribe(remoteSubscribeOptions: RemoteSubscribeOptions): Promise<
|
|
3249
|
-
traceId: string;
|
|
3250
|
-
stream: RemoteStream;
|
|
3251
|
-
} | {
|
|
3252
|
-
url: string;
|
|
3253
|
-
stream: RemoteStream;
|
|
3254
|
-
traceId?: string | undefined;
|
|
3255
|
-
} | null>;
|
|
3306
|
+
publish(streamUrl: string, callId: string, isResume?: boolean, reason?: PublishReason): Promise<string>;
|
|
3307
|
+
subscribe(remoteSubscribeOptions: RemoteSubscribeOptions, reason: SubscribeReason, callId: string, remoteCallId: string, startTs: number): Promise<any>;
|
|
3256
3308
|
getSubscribeVideoStats(streamUrl: string, msid?: string): Promise<unknown>;
|
|
3257
3309
|
getSubscribeAudioStats(streamUrl: string, msid?: string): Promise<unknown>;
|
|
3310
|
+
getStreamByMsid(config: any): LocalStream | RemoteStream;
|
|
3311
|
+
getPCStats(): Promise<any>;
|
|
3258
3312
|
sendSEI(streamUrl: string, data: ArrayBuffer, repeatCount: number, payloadType: number): Promise<void>;
|
|
3259
3313
|
}
|
|
3260
3314
|
|
|
@@ -3274,14 +3328,16 @@ declare class SignalingManager extends default_2<RoomServerListener> {
|
|
|
3274
3328
|
protected clientRole: AliRtcSdkClientRole;
|
|
3275
3329
|
protected env: AliRtcEnv;
|
|
3276
3330
|
protected maxConnectRetryCount?: number;
|
|
3277
|
-
|
|
3331
|
+
stsManager: StsManager;
|
|
3332
|
+
private slsReporter;
|
|
3333
|
+
constructor(channelProfile: AliRtcSdkChannelProfile, clientRole: AliRtcSdkClientRole, slsReporter: SLSReporter, env?: AliRtcEnv);
|
|
3278
3334
|
reset(): void;
|
|
3279
3335
|
/**
|
|
3280
3336
|
* 向业务信令发送入会
|
|
3281
3337
|
* @param {AliRtcAuthInfo} authInfo
|
|
3282
3338
|
* @returns
|
|
3283
3339
|
*/
|
|
3284
|
-
join(authInfo: AliRtcAuthInfo, userName?: string, maxConnectRetryCount?: number): Promise<JoinResult>;
|
|
3340
|
+
join(authInfo: AliRtcAuthInfo, userName?: string, maxConnectRetryCount?: number, timeRecorder?: TimeRecorder): Promise<JoinResult>;
|
|
3285
3341
|
retryJoin(): void;
|
|
3286
3342
|
/**
|
|
3287
3343
|
* 向业务信令发送离会
|
|
@@ -3390,6 +3446,186 @@ declare interface SignalingResult {
|
|
|
3390
3446
|
message?: string;
|
|
3391
3447
|
}
|
|
3392
3448
|
|
|
3449
|
+
/**
|
|
3450
|
+
* 日志埋点类
|
|
3451
|
+
* 每个埋点暴露对应的接口
|
|
3452
|
+
*/
|
|
3453
|
+
declare class SLSReporter {
|
|
3454
|
+
private engine;
|
|
3455
|
+
protected logClient: LogClient;
|
|
3456
|
+
protected authInfo?: AliRtcAuthInfo;
|
|
3457
|
+
private static staticClient;
|
|
3458
|
+
private static getLogClient;
|
|
3459
|
+
static reportOSSUpload(sessionId: string, date: string, responseCode?: number): void;
|
|
3460
|
+
constructor(engine: AliRtcEngine);
|
|
3461
|
+
/**
|
|
3462
|
+
* 开始建立连接
|
|
3463
|
+
* @param authInfo
|
|
3464
|
+
*/
|
|
3465
|
+
start(info: AliRtcAuthInfo): void;
|
|
3466
|
+
updateToken(token: SLSSTSToken, ossToken?: OSSSTSToken): void;
|
|
3467
|
+
/**
|
|
3468
|
+
* 断开连接
|
|
3469
|
+
*/
|
|
3470
|
+
stop(): void;
|
|
3471
|
+
reportPublishMonitor(callId: string, traceId: string, trackInfo: TrackInfo, track: MediaStreamTrack | undefined, stats: any[]): void;
|
|
3472
|
+
reportSubscribeMonitor(callId: string, remoteId: string, traceId: string, trackInfo: RemoteMediaTrackInfo, stats: any[]): void;
|
|
3473
|
+
reportNetworkMonitor(candidates: any[]): void;
|
|
3474
|
+
/**
|
|
3475
|
+
* 加入房间成功埋点
|
|
3476
|
+
* @param {number} joinTime
|
|
3477
|
+
* @param {number} result
|
|
3478
|
+
* @param {string} tid
|
|
3479
|
+
*/
|
|
3480
|
+
reportJoin(result: number, timeRecord: TimeRecorder, tid?: string): void;
|
|
3481
|
+
/**
|
|
3482
|
+
* Join 链接细节
|
|
3483
|
+
*/
|
|
3484
|
+
reportJoinConnection(logInfo: LogInfo): void;
|
|
3485
|
+
/**
|
|
3486
|
+
* 用户离开频道事件埋点
|
|
3487
|
+
* @param {number} leaveTime
|
|
3488
|
+
* @param {number} result
|
|
3489
|
+
* @param {string} tid
|
|
3490
|
+
*/
|
|
3491
|
+
reportLeave(leaveTime: number, result: number, tid: string): void;
|
|
3492
|
+
/**
|
|
3493
|
+
* 推流事件上报
|
|
3494
|
+
* @param {string} callid
|
|
3495
|
+
* @param {boolean} isLargeVideo
|
|
3496
|
+
* @param {boolean} isSmallVideo
|
|
3497
|
+
* @param {boolean} isScreenShare
|
|
3498
|
+
* @param {boolean} isAudio
|
|
3499
|
+
* @param {number} result
|
|
3500
|
+
* @param {string} tid
|
|
3501
|
+
* @param {number} pubTime
|
|
3502
|
+
*/
|
|
3503
|
+
reportPublish(isRepublish: boolean, url: string, callid: string, isLargeVideo: boolean, isSmallVideo: boolean, isScreenShare: boolean, isAudio: boolean, result: number | undefined, pcTraceId: string, traceId: string, startTime: number): void;
|
|
3504
|
+
/**
|
|
3505
|
+
* 首包上报
|
|
3506
|
+
* @param {string} callid
|
|
3507
|
+
* @param {number} startTime
|
|
3508
|
+
* @param {number} publishTime
|
|
3509
|
+
* @param {number} joinTime
|
|
3510
|
+
* @param {string} tckid
|
|
3511
|
+
* @param {string} pcTraceId
|
|
3512
|
+
* @param {string} traceId
|
|
3513
|
+
* @param {PublishReason} reason
|
|
3514
|
+
*/
|
|
3515
|
+
reportPublishFirstPacket(isRepublish: boolean, callid: string, startTime: number, publishTime: number, joinTime: number, tckid: string, pcTraceId: string, traceId: string, reason: PublishReason): void;
|
|
3516
|
+
/**
|
|
3517
|
+
* 停止推流事件上报
|
|
3518
|
+
* @param {string} callid
|
|
3519
|
+
* @param {number} unpubTime
|
|
3520
|
+
* @param {number} result
|
|
3521
|
+
* @param {string} tid
|
|
3522
|
+
*/
|
|
3523
|
+
reportUnpublish(callid: string, unpubTime: number, result: number, tid: string): void;
|
|
3524
|
+
/**
|
|
3525
|
+
* 订阅事件埋点
|
|
3526
|
+
* @param {string} callid
|
|
3527
|
+
* @param {string} remoteid
|
|
3528
|
+
* @param {boolean} isLargeVideo
|
|
3529
|
+
* @param {boolean} isSmallVideo
|
|
3530
|
+
* @param {boolean} isScreenShare
|
|
3531
|
+
* @param {boolean} isAudio
|
|
3532
|
+
* @param {number} result
|
|
3533
|
+
* @param {string} tid
|
|
3534
|
+
* @param {number} subTime
|
|
3535
|
+
*/
|
|
3536
|
+
reportSubscribe(callid: string, remoteid: string, isLargeVideo: boolean, isSmallVideo: boolean, isScreenShare: boolean, isAudio: boolean, result: number, tid: string, subTime: number, logInfo: LogInfo): void;
|
|
3537
|
+
reportSubscribeFirstPacket(isResume: boolean, callid: string, remoteid: string, trackId: string, logInfo: LogInfo): void;
|
|
3538
|
+
reportSubscribeFirstFrame(isResume: boolean, callid: string, remoteid: string, trackId: string, logInfo: LogInfo): void;
|
|
3539
|
+
/**
|
|
3540
|
+
* 停止订阅事件埋点
|
|
3541
|
+
* @param {string} callid
|
|
3542
|
+
* @param {string} remoteid
|
|
3543
|
+
* @param {number} unsubTime
|
|
3544
|
+
* @param {number} result
|
|
3545
|
+
* @param {string} tid
|
|
3546
|
+
*/
|
|
3547
|
+
reportUnsubscribe(callid: string, remoteid: string, unsubTime: number, result: number, tid: string): void;
|
|
3548
|
+
reportMute(callid: string, enable: boolean, type: 'audio' | 'video' | 'screen'): void;
|
|
3549
|
+
/**
|
|
3550
|
+
* 更新角色埋点
|
|
3551
|
+
* @param {string|undefined} or 旧的角色
|
|
3552
|
+
* @param {string} nr 新的角色
|
|
3553
|
+
*/
|
|
3554
|
+
reportRoleUpdate(or: string | undefined, nr: string): void;
|
|
3555
|
+
/**
|
|
3556
|
+
* 更新角色埋点
|
|
3557
|
+
* @param {string|undefined} or 旧的角色
|
|
3558
|
+
* @param {string} nr 新的角色
|
|
3559
|
+
*/
|
|
3560
|
+
reportRoleUpdateResult(or: string | undefined, nr: string, ctm: number, result: number): void;
|
|
3561
|
+
/**
|
|
3562
|
+
* 设置camera videoprofile
|
|
3563
|
+
*/
|
|
3564
|
+
reportVideoProfile(profile: string): void;
|
|
3565
|
+
/**
|
|
3566
|
+
* 设置screenshare videoprofile
|
|
3567
|
+
*/
|
|
3568
|
+
reportScreenProfile(profile: string): void;
|
|
3569
|
+
/**
|
|
3570
|
+
* 错误事件埋点
|
|
3571
|
+
* @param err
|
|
3572
|
+
*/
|
|
3573
|
+
reportError(err: any): void;
|
|
3574
|
+
/**
|
|
3575
|
+
* 错误事件埋点
|
|
3576
|
+
* @param err
|
|
3577
|
+
*/
|
|
3578
|
+
reportWarning(msg: string): void;
|
|
3579
|
+
reportRoomServerEvent(isRequest: boolean, type: string, requestId: string, content: any): void;
|
|
3580
|
+
reportTranscodingError(result: number, taskid: string): void;
|
|
3581
|
+
reportBye(result: number): void;
|
|
3582
|
+
reportAudio(error: any, cost: number, deviceName: string): void;
|
|
3583
|
+
reportScreen(error: any, cost: number): void;
|
|
3584
|
+
reportScreenStop(error: any): void;
|
|
3585
|
+
reportSwitchCamera(deviceId: string): void;
|
|
3586
|
+
reportPublishProfile(trackId: string, logInfo: LogInfo): void;
|
|
3587
|
+
reportSDKCreated(startTs: number): void;
|
|
3588
|
+
reportJoinInvoked(authInfo: AliRtcAuthInfo): void;
|
|
3589
|
+
reportJoinResult(error: any): void;
|
|
3590
|
+
reportSTSResult(code: number): void;
|
|
3591
|
+
reportLeaveInvoked(): void;
|
|
3592
|
+
reportSEIMessage(payloadType: number, length: number, repeatCount: number, delay: number, isKey: boolean): void;
|
|
3593
|
+
/**
|
|
3594
|
+
* 日志埋点
|
|
3595
|
+
* 在埋点中增加tm字段,表示发生埋点的客户端本地时间
|
|
3596
|
+
* @param {any} param 埋点内容
|
|
3597
|
+
*/
|
|
3598
|
+
protected log(param: any): void;
|
|
3599
|
+
/**
|
|
3600
|
+
* 将Object转换成string
|
|
3601
|
+
* @param {any} data
|
|
3602
|
+
* @returns {string}
|
|
3603
|
+
*/
|
|
3604
|
+
protected data2String(data: any): string;
|
|
3605
|
+
}
|
|
3606
|
+
|
|
3607
|
+
declare interface SLSSTSToken {
|
|
3608
|
+
access_key_id: string;
|
|
3609
|
+
access_key_secret: string;
|
|
3610
|
+
expiration: number;
|
|
3611
|
+
log_store_debug: string;
|
|
3612
|
+
log_store_stats: string;
|
|
3613
|
+
project: string;
|
|
3614
|
+
region_endpoint: string;
|
|
3615
|
+
security_token: string;
|
|
3616
|
+
}
|
|
3617
|
+
|
|
3618
|
+
declare interface SLSToken {
|
|
3619
|
+
access_key_id: string;
|
|
3620
|
+
access_key_secret: string;
|
|
3621
|
+
security_token: string;
|
|
3622
|
+
region_endpoint: string;
|
|
3623
|
+
project: string;
|
|
3624
|
+
log_store_stats: string;
|
|
3625
|
+
log_store_debug: string;
|
|
3626
|
+
expiration: number;
|
|
3627
|
+
}
|
|
3628
|
+
|
|
3393
3629
|
declare interface StopPreviewConfig {
|
|
3394
3630
|
videoElement?: HTMLVideoElement;
|
|
3395
3631
|
primary?: boolean;
|
|
@@ -3409,6 +3645,23 @@ declare interface StreamOptions {
|
|
|
3409
3645
|
screen?: boolean;
|
|
3410
3646
|
}
|
|
3411
3647
|
|
|
3648
|
+
declare class StsManager extends default_2<StsManagerListener> {
|
|
3649
|
+
static logName: string;
|
|
3650
|
+
private env;
|
|
3651
|
+
private authInfo?;
|
|
3652
|
+
private timer?;
|
|
3653
|
+
private slsReporter;
|
|
3654
|
+
constructor(slsReporter: SLSReporter, env: AliRtcEnv);
|
|
3655
|
+
refreshAuthInfo(authInfo: AliRtcAuthInfo): void;
|
|
3656
|
+
private requestToken;
|
|
3657
|
+
startSTSUpdate(authInfo: AliRtcAuthInfo): void;
|
|
3658
|
+
clear(): void;
|
|
3659
|
+
}
|
|
3660
|
+
|
|
3661
|
+
declare interface StsManagerListener {
|
|
3662
|
+
onTokenUpdate: (ossToken: OSSToken, slsToken: SLSToken) => void;
|
|
3663
|
+
}
|
|
3664
|
+
|
|
3412
3665
|
declare interface SubConfig {
|
|
3413
3666
|
isAudioSubscribing: boolean;
|
|
3414
3667
|
isVideoSubscribing: boolean;
|
|
@@ -3422,6 +3675,19 @@ declare type SubscribeOptions = StreamOptions & {
|
|
|
3422
3675
|
vMsid?: string;
|
|
3423
3676
|
};
|
|
3424
3677
|
|
|
3678
|
+
declare enum SubscribeReason {
|
|
3679
|
+
InRoom = "inRoom",
|
|
3680
|
+
Join = "join",
|
|
3681
|
+
Publish = "publish",
|
|
3682
|
+
User = "user",
|
|
3683
|
+
Resume = "resume"
|
|
3684
|
+
}
|
|
3685
|
+
|
|
3686
|
+
declare interface TimeRecorder {
|
|
3687
|
+
start: number;
|
|
3688
|
+
[key: string]: number;
|
|
3689
|
+
}
|
|
3690
|
+
|
|
3425
3691
|
declare enum TrackEvent_2 {
|
|
3426
3692
|
VideoTrackEnded = "videoTrackEnded",
|
|
3427
3693
|
AudioTrackEnded = "audioTrackEnded",
|
|
@@ -3450,12 +3716,13 @@ declare class User extends default_2<UserListener> {
|
|
|
3450
3716
|
protected uid: string;
|
|
3451
3717
|
protected name: string;
|
|
3452
3718
|
protected rtsManager: RtsManager;
|
|
3453
|
-
|
|
3719
|
+
callId: string;
|
|
3454
3720
|
protected audioLevelMonitor: AudioLevelMonitor;
|
|
3455
3721
|
protected audioVolumeIndicationInterval: number;
|
|
3456
3722
|
constructor(userId: string, displayname: string, rtsManager: RtsManager, interval: number);
|
|
3457
3723
|
get userId(): string;
|
|
3458
3724
|
get displayname(): string;
|
|
3725
|
+
protected createCallId(): void;
|
|
3459
3726
|
setUserInfo(uid: string, displayName: string): void;
|
|
3460
3727
|
refreshUserInfo(uid: string): void;
|
|
3461
3728
|
/**
|
|
@@ -3491,190 +3758,6 @@ declare interface UserListener {
|
|
|
3491
3758
|
remoteSubscribeError: (error: AliRtcError) => void;
|
|
3492
3759
|
}
|
|
3493
3760
|
|
|
3494
|
-
declare class UserManager extends default_2<UserManagerListener> {
|
|
3495
|
-
/**
|
|
3496
|
-
* @ignore
|
|
3497
|
-
*/
|
|
3498
|
-
static logName: string;
|
|
3499
|
-
protected self: LocalUser | undefined;
|
|
3500
|
-
protected userMap: RemoteUserMap;
|
|
3501
|
-
private usersViewMap;
|
|
3502
|
-
rtsManager: RtsManager;
|
|
3503
|
-
protected localStreamManager: LocalStreamManager;
|
|
3504
|
-
protected authInfo?: AliRtcAuthInfo;
|
|
3505
|
-
protected signalingManager: SignalingManager;
|
|
3506
|
-
pluginManager: PluginManager;
|
|
3507
|
-
protected reporter: Reporter;
|
|
3508
|
-
protected webTrackingClient: WebTrackingClient;
|
|
3509
|
-
private statsMonitorId?;
|
|
3510
|
-
private autoSubAudio;
|
|
3511
|
-
private autoSubVideo;
|
|
3512
|
-
private autoSubScreen;
|
|
3513
|
-
private wantSubAudio;
|
|
3514
|
-
private wantSubVideo;
|
|
3515
|
-
private wantSubScreen;
|
|
3516
|
-
private defaultStreamType;
|
|
3517
|
-
private audioMuted;
|
|
3518
|
-
private playoutVolume;
|
|
3519
|
-
private audioVolumeIndicationInterval;
|
|
3520
|
-
private indicationTimer;
|
|
3521
|
-
constructor(config: UserManagerConfig);
|
|
3522
|
-
private addSignalingManagerListener;
|
|
3523
|
-
isAutoSubAudio(): boolean;
|
|
3524
|
-
setAutoSubAudio(value: boolean): void;
|
|
3525
|
-
isAutoSubVideo(): boolean;
|
|
3526
|
-
setAutoSubVideo(value: boolean): void;
|
|
3527
|
-
isAutoSubScreen(): boolean;
|
|
3528
|
-
setAutoSubScreen(value: boolean): void;
|
|
3529
|
-
isWantSubAudio(): boolean;
|
|
3530
|
-
setWantSubAudio(value: boolean): void;
|
|
3531
|
-
isWantSubVideo(): boolean;
|
|
3532
|
-
setWantSubVideo(value: boolean): void;
|
|
3533
|
-
isWantSubScreen(): boolean;
|
|
3534
|
-
setWantSubScreen(value: boolean): void;
|
|
3535
|
-
setRemoteDefaultVideoStreamType(type: AliRtcVideoStreamType): void;
|
|
3536
|
-
setRemoteUserVideoStreamType(userId: string, type: AliRtcVideoStreamType): void;
|
|
3537
|
-
setAudioMuted(mute: boolean): void;
|
|
3538
|
-
setLocalViewConfig(view: AliRtcLocalView, track: AliRtcVideoTrack): void;
|
|
3539
|
-
setRemoteViewConfig(uid: string, view: AliRtcLocalView, track: AliRtcVideoTrack): void;
|
|
3540
|
-
get channel(): string | undefined;
|
|
3541
|
-
get userId(): string | undefined;
|
|
3542
|
-
get remoteUsers(): RemoteUser[];
|
|
3543
|
-
/**
|
|
3544
|
-
* 获取推流对象,只能是自己
|
|
3545
|
-
*/
|
|
3546
|
-
get publisher(): LocalUser | undefined;
|
|
3547
|
-
get isSubscribing(): boolean;
|
|
3548
|
-
/**
|
|
3549
|
-
* 处理远端用户推流状态变化
|
|
3550
|
-
* @param {string} userId
|
|
3551
|
-
* @param {string} displayname
|
|
3552
|
-
* @param {string} callid
|
|
3553
|
-
* @param {string} pullStreamUrl
|
|
3554
|
-
* @param {TrackInfo[]} tracks
|
|
3555
|
-
* @returns {void}
|
|
3556
|
-
*/
|
|
3557
|
-
onRemotePublishStateChange(publishInfo: PublishUser): void;
|
|
3558
|
-
/**
|
|
3559
|
-
* 登陆成功后初始化用户管理,创建自己
|
|
3560
|
-
* @param {AliRtcAuthInfo} authInfo
|
|
3561
|
-
* @param {string} pushStreamUrl
|
|
3562
|
-
* @returns {Promise<void>}
|
|
3563
|
-
*/
|
|
3564
|
-
init(authInfo: AliRtcAuthInfo, data: JoinResult): void;
|
|
3565
|
-
/**
|
|
3566
|
-
* 离会后清除所有数据
|
|
3567
|
-
* @returns {Promise<void>}
|
|
3568
|
-
*/
|
|
3569
|
-
clear(): Promise<void>;
|
|
3570
|
-
private startStatsMonitor;
|
|
3571
|
-
private stopStatsMonitor;
|
|
3572
|
-
/**
|
|
3573
|
-
* 根据userId获取RemoteUser
|
|
3574
|
-
* @param {string} userId
|
|
3575
|
-
* @param {string} displayname
|
|
3576
|
-
* @returns {RemoteUser}
|
|
3577
|
-
*/
|
|
3578
|
-
getUser(userId: string, displayname: string): RemoteUser;
|
|
3579
|
-
/**
|
|
3580
|
-
* 添加远端用户
|
|
3581
|
-
* @param {string} userId
|
|
3582
|
-
* @param {string} displayName
|
|
3583
|
-
* @returns {void}
|
|
3584
|
-
*/
|
|
3585
|
-
addUser(userId: string, displayName: string): RemoteUser;
|
|
3586
|
-
/**
|
|
3587
|
-
* 执行添加远端用户
|
|
3588
|
-
* @param {string} userId
|
|
3589
|
-
* @param {string} displayName
|
|
3590
|
-
* @returns {RemoteUser}
|
|
3591
|
-
*/
|
|
3592
|
-
private executeAddUser;
|
|
3593
|
-
/**
|
|
3594
|
-
* 远端用户设备状态变化
|
|
3595
|
-
* @param {DeviceStatusChangeType} event
|
|
3596
|
-
* @param {string} userId
|
|
3597
|
-
*/
|
|
3598
|
-
private onRemoteDeviceStatusChange;
|
|
3599
|
-
/**
|
|
3600
|
-
* 远端流数据采集上报
|
|
3601
|
-
* @param {any} stat
|
|
3602
|
-
*/
|
|
3603
|
-
private onRemoteStatReport;
|
|
3604
|
-
/**
|
|
3605
|
-
* rts 单 PC 订阅超限
|
|
3606
|
-
*/
|
|
3607
|
-
private onSubscribeExceeds;
|
|
3608
|
-
/**
|
|
3609
|
-
* 移除远端用户
|
|
3610
|
-
* @param {LeaveInfo} user
|
|
3611
|
-
* @returns {Promise<void>}
|
|
3612
|
-
*/
|
|
3613
|
-
removeLeftUser(user: LeaveInfo): Promise<void>;
|
|
3614
|
-
/**
|
|
3615
|
-
* 更新远端用户数据
|
|
3616
|
-
* @param {JoinInfo[]} users
|
|
3617
|
-
* @returns {{joinList: JoinInfo[], leaveList: LeaveInfo[], presentList: JoinInfo[]}}
|
|
3618
|
-
*/
|
|
3619
|
-
updateUsers(users: JoinInfo[]): {
|
|
3620
|
-
joinList: JoinInfo[];
|
|
3621
|
-
leaveList: LeaveInfo[];
|
|
3622
|
-
presentList: JoinInfo[];
|
|
3623
|
-
};
|
|
3624
|
-
/**
|
|
3625
|
-
* 根据 userId 获取 RemoteUser
|
|
3626
|
-
* @param {string} userId
|
|
3627
|
-
* @returns {RemoteUser | undefined}
|
|
3628
|
-
*/
|
|
3629
|
-
getRemoteUser(userId: string): RemoteUser | undefined;
|
|
3630
|
-
/**
|
|
3631
|
-
* 更新远端用户设备信息
|
|
3632
|
-
* @param {RemoteUserStatus} user
|
|
3633
|
-
* @returns {boolean} true: 用户状态改变 false: 用户状态没有改变
|
|
3634
|
-
*/
|
|
3635
|
-
updateRemoteUserDeviceStatus(user: RemoteUserStatus): void;
|
|
3636
|
-
updateAudioWant(uid: string, sub: boolean): void;
|
|
3637
|
-
updateVideoWant(uid: string, sub: boolean): void;
|
|
3638
|
-
updateScreenWant(uid: string, sub: boolean): void;
|
|
3639
|
-
private stopIndication;
|
|
3640
|
-
private startIndication;
|
|
3641
|
-
enableAudioVolumeIndication(interval: number): void;
|
|
3642
|
-
setPlayoutVolume(volume: number): void;
|
|
3643
|
-
refreshAuthInfo(authInfo: AliRtcRefreshAuthInfo): void;
|
|
3644
|
-
setEnableMediaExtensionMsg(enable: boolean): void;
|
|
3645
|
-
setAudioRedEnabled(enable: boolean): void;
|
|
3646
|
-
}
|
|
3647
|
-
|
|
3648
|
-
declare interface UserManagerConfig {
|
|
3649
|
-
reporter: Reporter;
|
|
3650
|
-
webTrackingClient: WebTrackingClient;
|
|
3651
|
-
signalingManager: SignalingManager;
|
|
3652
|
-
}
|
|
3653
|
-
|
|
3654
|
-
declare interface UserManagerListener {
|
|
3655
|
-
[ClientEventType.RtsSubscribeExceeds]: (userId: string, options?: SubscribeOptions) => void;
|
|
3656
|
-
[DeviceStatusChange.Remote]: (event: DeviceStatusChangeType, userId: string) => void;
|
|
3657
|
-
[ClientEventType.PullStreamStats]: (userId: string, stat: any, pullStreamUrl: string) => void;
|
|
3658
|
-
remoteTrackAvailableChange: (uid: string, aliRtcAudioTrack: AliRtcAudioTrack, aliRtcVideoTrack: AliRtcVideoTrack) => void;
|
|
3659
|
-
audioSubscribeStateChanged: (uid: string, oldState: AliRtcSubscribeState, newState: AliRtcSubscribeState, elapseSinceLastState: number, channel: string) => void;
|
|
3660
|
-
videoSubscribeStateChanged: (uid: string, oldState: AliRtcSubscribeState, newState: AliRtcSubscribeState, elapseSinceLastState: number, channel: string) => void;
|
|
3661
|
-
screenSubscribeStateChanged: (uid: string, oldState: AliRtcSubscribeState, newState: AliRtcSubscribeState, elapseSinceLastState: number, channel: string) => void;
|
|
3662
|
-
userAudioMuted: (uid: string, isMute: boolean) => void;
|
|
3663
|
-
userVideoMuted: (uid: string, isMute: boolean) => void;
|
|
3664
|
-
userScreenMuted: (userId: string, isMute: boolean) => void;
|
|
3665
|
-
audioVolume: (speakers: {
|
|
3666
|
-
userId: string;
|
|
3667
|
-
volume: number;
|
|
3668
|
-
}[]) => void;
|
|
3669
|
-
rtcLocalVideoStats: (stats: AliRtcLocalVideoStats[]) => void;
|
|
3670
|
-
rtcLocalAudioStats: (stats: AliRtcLocalAudioStats[]) => void;
|
|
3671
|
-
rtcRemoteVideoStats: (stats: AliRtcRemoteVideoStats[]) => void;
|
|
3672
|
-
rtcRemoteAudioStats: (stats: AliRtcRemoteAudioStats[]) => void;
|
|
3673
|
-
remoteAudioAutoPlayFail: (uid: string) => void;
|
|
3674
|
-
remoteVideoAutoPlayFail: (uid: string, track: AliRtcVideoTrack) => void;
|
|
3675
|
-
remoteSubscribeError: (error: AliRtcError) => void;
|
|
3676
|
-
}
|
|
3677
|
-
|
|
3678
3761
|
declare interface VideoScaler {
|
|
3679
3762
|
getVideoTrack: () => MediaStreamTrack;
|
|
3680
3763
|
updateOptions: (options: VideoScalerOptions) => void;
|
|
@@ -3704,90 +3787,4 @@ declare enum VideoStreamSource {
|
|
|
3704
3787
|
Image = 2
|
|
3705
3788
|
}
|
|
3706
3789
|
|
|
3707
|
-
|
|
3708
|
-
biz: string;
|
|
3709
|
-
extraParams?: string;
|
|
3710
|
-
}
|
|
3711
|
-
|
|
3712
|
-
declare class WebTrackingClient {
|
|
3713
|
-
protected index: number;
|
|
3714
|
-
private tracker?;
|
|
3715
|
-
private enable;
|
|
3716
|
-
private commonParams;
|
|
3717
|
-
constructor(config?: WebTrackConfig | boolean);
|
|
3718
|
-
updateAuthInfo(info: AliRtcAuthInfo): void;
|
|
3719
|
-
/**
|
|
3720
|
-
* 调用加入房间API事件
|
|
3721
|
-
* @param {AliRtcAuthInfo} authInfo 鉴权信息
|
|
3722
|
-
*/
|
|
3723
|
-
reportJoinChannel(authInfo: AliRtcAuthInfo): void;
|
|
3724
|
-
/**
|
|
3725
|
-
* @method: 调用加入房间结果
|
|
3726
|
-
* @param { rslt: 执行结果 code,0为成功,错误返回其他错误码 }
|
|
3727
|
-
* @param { message: 执行结果,成功返回 success,失败返回失败 message }
|
|
3728
|
-
* @param { ct: 耗时 }
|
|
3729
|
-
* @return {*}
|
|
3730
|
-
*/
|
|
3731
|
-
reportJoinChannelRes(rslt: number, message: string, ct: number): void;
|
|
3732
|
-
/**
|
|
3733
|
-
* 离会调用通知
|
|
3734
|
-
*/
|
|
3735
|
-
reportLeaveChannel(): void;
|
|
3736
|
-
/**
|
|
3737
|
-
* 推流成功
|
|
3738
|
-
* @param {string} calid(失败时为空)
|
|
3739
|
-
* @param {boolean} isvl 是否推大流
|
|
3740
|
-
* @param {boolean} isvs 是否推小流
|
|
3741
|
-
* @param {boolean} isvss 是否推屏幕共享流
|
|
3742
|
-
* @param {boolean} isaudio 是否推音频流
|
|
3743
|
-
* @param {number} rslt 推流结果:成功0,失败错误码
|
|
3744
|
-
* @param {string} tid 房间信令 tid
|
|
3745
|
-
* @param {number} pubtm 执行推流到推流结束信令通知结束的耗时
|
|
3746
|
-
* @param {number} est 开始时间
|
|
3747
|
-
* @param {string} dctid 使用 datachannel 的 traceId
|
|
3748
|
-
* @param {string} httptid 使用 http 建连的 traceId
|
|
3749
|
-
* @param {string} url 推流地址
|
|
3750
|
-
*/
|
|
3751
|
-
reportPush(calid: string, isvl: boolean, isvs: boolean, isvss: boolean, isaudio: boolean, rslt: number, tid: string, pubtm: number, est: number, dctid: string, httptid: string, url: string): void;
|
|
3752
|
-
/**
|
|
3753
|
-
* 拉流成功
|
|
3754
|
-
* @param {string} calid 鉴权 callid (失败为空)
|
|
3755
|
-
* @param {string} rmtid 远端用户 userId
|
|
3756
|
-
* @param {boolean} isvl 是否拉视频大流
|
|
3757
|
-
* @param {boolean} isvs 是否拉视频小流
|
|
3758
|
-
* @param {boolean} isvss 是否拉屏幕分享流
|
|
3759
|
-
* @param {boolean} isaudio 是否拉音频流
|
|
3760
|
-
* @param {number} rslt 拉流结果:成功0,失败错误码
|
|
3761
|
-
* @param {number} subtm 订阅耗时
|
|
3762
|
-
* @param {string} dctid 使用 datachannel 的 traceId
|
|
3763
|
-
* @param {string} httptid 使用 http 建连的 traceId
|
|
3764
|
-
* @param {string} url 拉流地址
|
|
3765
|
-
* @param {number} est 开始时间
|
|
3766
|
-
*/
|
|
3767
|
-
reportPull(calid: string, rmtid: string, isvl: boolean, isvs: boolean, isvss: boolean, isaudio: boolean, rslt: number, subtm: number, dctid: string, httptid: string, url: string, est: number): void;
|
|
3768
|
-
/**
|
|
3769
|
-
* 上报订阅流的音频数据
|
|
3770
|
-
* @param {string} rmtid 远端用户 userId
|
|
3771
|
-
* @param {any} stats 流数据
|
|
3772
|
-
*/
|
|
3773
|
-
reportSubscribeAudioStats(rmtid: string, stats: any): void;
|
|
3774
|
-
/**
|
|
3775
|
-
* 上报订阅流的视频数据
|
|
3776
|
-
* @param {string} rmtid 远端用户 userId
|
|
3777
|
-
* @param {any} stats 流数据
|
|
3778
|
-
*/
|
|
3779
|
-
reportSubscribeVideoStats(rmtid: string, stats: any): void;
|
|
3780
|
-
/**
|
|
3781
|
-
* webTracking 埋点上报
|
|
3782
|
-
* @param {string | number} msgId 事件标识
|
|
3783
|
-
* @param {Record<string, any>} args 事件携带参数
|
|
3784
|
-
* @param {Record<string, any>} params 单个打点携带的其他参数
|
|
3785
|
-
*/
|
|
3786
|
-
protected report(msgId: string | number | EventId, args?: Record<string, any>, params?: Record<string, any>): void;
|
|
3787
|
-
/**
|
|
3788
|
-
* 上报环境监测的结果
|
|
3789
|
-
*/
|
|
3790
|
-
static reportCheck(result: any, biz?: string): void;
|
|
3791
|
-
}
|
|
3792
|
-
|
|
3793
|
-
export { }
|
|
3790
|
+
export { }
|