dingrtc 3.9.7-4 → 3.9.7-7
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/index.d.ts +59 -26
- package/dist/index.esm.js +2 -2
- package/dist/index.js +1 -1
- package/dist/index.umd.js +2 -2
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1666,10 +1666,11 @@ declare class MixedLocalAudioTrack extends EventEmitter<ITrackEvent> {
|
|
|
1666
1666
|
private _screenAudioTrack;
|
|
1667
1667
|
private mixedAudioTrackResult;
|
|
1668
1668
|
private publication;
|
|
1669
|
+
private serviceManager;
|
|
1669
1670
|
private _trackId;
|
|
1670
1671
|
private logger;
|
|
1671
1672
|
trackMediaType: string;
|
|
1672
|
-
constructor(
|
|
1673
|
+
constructor(serviceManager: ServiceManager);
|
|
1673
1674
|
getTrackId(): string;
|
|
1674
1675
|
getScreenAudioTrack(): LocalAudioTrack;
|
|
1675
1676
|
setScreenAudioTrack(newScreenAudioTrack: LocalAudioTrack): void;
|
|
@@ -1678,7 +1679,17 @@ declare class MixedLocalAudioTrack extends EventEmitter<ITrackEvent> {
|
|
|
1678
1679
|
isPublished: () => boolean;
|
|
1679
1680
|
setPublication: (publication?: Publication) => void;
|
|
1680
1681
|
getPublication: () => Publication;
|
|
1681
|
-
private
|
|
1682
|
+
private micTrackEventHandler;
|
|
1683
|
+
private screenAudioTrackEventHandler;
|
|
1684
|
+
private _audioTrackInnerEventHandler;
|
|
1685
|
+
private notifyMicDeviceMuted;
|
|
1686
|
+
/**
|
|
1687
|
+
* 跟mic状态含义和逻辑略有不同。
|
|
1688
|
+
* 通知其他人本端音频媒体中是否有屏幕共享的音频
|
|
1689
|
+
* @param enabled
|
|
1690
|
+
* @returns
|
|
1691
|
+
*/
|
|
1692
|
+
private notifyScreenAudioEnabled;
|
|
1682
1693
|
updateMixedAudioTrackToPub: () => void;
|
|
1683
1694
|
private mixAudioTracks;
|
|
1684
1695
|
clear: () => void;
|
|
@@ -1716,6 +1727,10 @@ declare class Publication extends EventEmitter<IPublishEvents> {
|
|
|
1716
1727
|
logger: ILogger;
|
|
1717
1728
|
mid: string;
|
|
1718
1729
|
encodings: SenderEncoding[];
|
|
1730
|
+
/**
|
|
1731
|
+
* 记录本地的rtc stream control的状态,防止重复发送消息
|
|
1732
|
+
*/
|
|
1733
|
+
private rtcStreamMuted;
|
|
1719
1734
|
private feedbackIndex;
|
|
1720
1735
|
private monitor;
|
|
1721
1736
|
constructor(options: PublicationOptions);
|
|
@@ -1751,7 +1766,8 @@ declare class SessionManager extends EventEmitter<SessionManagerEvent> {
|
|
|
1751
1766
|
reporter: Reporter;
|
|
1752
1767
|
logger: ILogger;
|
|
1753
1768
|
mixedLocalAudioTrack: MixedLocalAudioTrack;
|
|
1754
|
-
|
|
1769
|
+
republishPromise: Promise<void>;
|
|
1770
|
+
resubscribePromise: Promise<void>;
|
|
1755
1771
|
constructor(client: DingRTCClient, serviceManager: ServiceManager);
|
|
1756
1772
|
private getOrCreatePeerConnection;
|
|
1757
1773
|
/**
|
|
@@ -1766,6 +1782,7 @@ declare class SessionManager extends EventEmitter<SessionManagerEvent> {
|
|
|
1766
1782
|
*/
|
|
1767
1783
|
handleStuckResubscribe(sessions: Subscription[]): Promise<void>;
|
|
1768
1784
|
private handleResubscribe;
|
|
1785
|
+
private _handleResubscribe;
|
|
1769
1786
|
getSessionByStreamId(id: string): Subscription;
|
|
1770
1787
|
private handleResubSuccess;
|
|
1771
1788
|
private handleServerFailover;
|
|
@@ -1802,10 +1819,9 @@ interface PeerConnectionProps {
|
|
|
1802
1819
|
*/
|
|
1803
1820
|
declare class PeerConnection extends EventEmitter<IPeerConnectionEvents> {
|
|
1804
1821
|
pc: RTCPeerConnection;
|
|
1805
|
-
private pendingTask;
|
|
1806
1822
|
rtcSignaling: RtcSignaling;
|
|
1807
1823
|
state: PeerConnectionState;
|
|
1808
|
-
private
|
|
1824
|
+
private processingExchangeSdp;
|
|
1809
1825
|
monitor: PeerConnectionMonitor;
|
|
1810
1826
|
peerConnectionTimer: number;
|
|
1811
1827
|
createPeerConnectionPromise: PromiseLikeObject;
|
|
@@ -1832,7 +1848,6 @@ declare class PeerConnection extends EventEmitter<IPeerConnectionEvents> {
|
|
|
1832
1848
|
constructor(props: PeerConnectionProps);
|
|
1833
1849
|
startSinglePC: (isFailover?: boolean) => Promise<void>;
|
|
1834
1850
|
private stopSinglePC;
|
|
1835
|
-
reset(): void;
|
|
1836
1851
|
closePeerConnection(): void;
|
|
1837
1852
|
private onTrack;
|
|
1838
1853
|
fireEndedEvent(): void;
|
|
@@ -1848,10 +1863,10 @@ declare class PeerConnection extends EventEmitter<IPeerConnectionEvents> {
|
|
|
1848
1863
|
private detachEvents;
|
|
1849
1864
|
private onIceGatheringStateChange;
|
|
1850
1865
|
/**
|
|
1851
|
-
*
|
|
1852
|
-
* @
|
|
1866
|
+
*
|
|
1867
|
+
* @param isSinglePCFailover
|
|
1868
|
+
* @returns 正常返回即成功,如果异常则失败
|
|
1853
1869
|
*/
|
|
1854
|
-
startTask(): Promise<unknown>;
|
|
1855
1870
|
private exchangeSDP;
|
|
1856
1871
|
reoffer(): Promise<void>;
|
|
1857
1872
|
handleHighProfileFallback(): void;
|
|
@@ -1878,6 +1893,7 @@ interface SubscriptionOptions {
|
|
|
1878
1893
|
*/
|
|
1879
1894
|
userConfigResolution?: ResolutionInfo$1;
|
|
1880
1895
|
uid?: string;
|
|
1896
|
+
targetMediaType: TrackMediaType;
|
|
1881
1897
|
}
|
|
1882
1898
|
/**
|
|
1883
1899
|
* @internal
|
|
@@ -1905,6 +1921,7 @@ declare class Subscription extends EventEmitter<ISubscribeEvents> {
|
|
|
1905
1921
|
videoStatsMap: Map<string, RemoteVideoStates>;
|
|
1906
1922
|
transceiver: RTCRtpTransceiver;
|
|
1907
1923
|
transceivers?: RTCRtpTransceiver[];
|
|
1924
|
+
targetMediaType: TrackMediaType;
|
|
1908
1925
|
constructor(options: SubscriptionOptions);
|
|
1909
1926
|
private logTrackEnded;
|
|
1910
1927
|
private logTrackUnmute;
|
|
@@ -2018,7 +2035,7 @@ declare class User extends EventEmitter {
|
|
|
2018
2035
|
/**
|
|
2019
2036
|
* @internal
|
|
2020
2037
|
*/
|
|
2021
|
-
|
|
2038
|
+
updateSubbedVideoTrack(session: Subscription, auxiliary?: boolean): RemoteVideoTrack;
|
|
2022
2039
|
toJSON: () => {
|
|
2023
2040
|
userId: string;
|
|
2024
2041
|
userName: string;
|
|
@@ -2060,6 +2077,14 @@ interface IClientEvents {
|
|
|
2060
2077
|
* 在大部分情况下,你只需要监听 user-published 和 user-unpublished 就可以完成订阅、取消订阅、展示远端用户是否打开了摄像头和麦克风等工作,无需特别关注实际用户状态的变化,SDK 会自动处理用户状态变化。
|
|
2061
2078
|
*/
|
|
2062
2079
|
'user-info-updated': (uid: string, msg: 'mute-audio' | 'mute-video' | 'unmute-audio' | 'unmute-video') => void;
|
|
2080
|
+
/**
|
|
2081
|
+
* 用户的麦克风采集数据是否设置静音
|
|
2082
|
+
*/
|
|
2083
|
+
'user-mic-audio-muted': (uid: string, muted: boolean) => void;
|
|
2084
|
+
/**
|
|
2085
|
+
* 用户的屏幕共享音频数据是否混入音频流进行发布
|
|
2086
|
+
*/
|
|
2087
|
+
'user-screencast-audio-mixed': (uid: string, mixed: boolean) => void;
|
|
2063
2088
|
/**
|
|
2064
2089
|
* 提示频道内正在说话的远端用户列表,三人及以上时自动开启。
|
|
2065
2090
|
* @param uids 正在说话人的uid,第一个为音量最高的人,列表为空时代表无人在说话。
|
|
@@ -2245,7 +2270,7 @@ declare class DingRTCClient extends EventEmitter<IClientEvents> {
|
|
|
2245
2270
|
* @param {SubscribeParam[]} batchSubscribeParam
|
|
2246
2271
|
* @returns void
|
|
2247
2272
|
*/
|
|
2248
|
-
batchSubscribe(batchSubscribeParam: SubscribeParam
|
|
2273
|
+
batchSubscribe(batchSubscribeParam: SubscribeParam[]): Promise<SubscribeResult[]>;
|
|
2249
2274
|
/**
|
|
2250
2275
|
* 取消订阅远端用户的音视频轨道。
|
|
2251
2276
|
* @param uid 远端用户id。
|
|
@@ -2418,6 +2443,7 @@ declare class RtcUserManager extends EventEmitter<UserManagerEvent> {
|
|
|
2418
2443
|
clear(): void;
|
|
2419
2444
|
private handleEvent;
|
|
2420
2445
|
setParticipantProperties(stats: string): Promise<signal_msg.IResponse>;
|
|
2446
|
+
notifyParticipantProperties(propertiesJsonStr: string): Promise<signal_msg.IResponse>;
|
|
2421
2447
|
}
|
|
2422
2448
|
|
|
2423
2449
|
/**
|
|
@@ -2451,7 +2477,7 @@ declare class ServiceManager extends EventEmitter<ChannelEvens> {
|
|
|
2451
2477
|
handleStreamEvent(action: StreamEventAction, payload: StreamEventPlayload): void;
|
|
2452
2478
|
handleGroupEvent(action: GroupEventAction, group: Group | string, extraPayload?: GroupUser | signal_msg.IGroupProperty | string | signal_msg.IGroupAudioInfo): void;
|
|
2453
2479
|
handleUserEvent(action: UserEventAction, payload: User): void;
|
|
2454
|
-
getStream(param:
|
|
2480
|
+
getStream(param: InternalSubscribeParam): signal_msg.IStream;
|
|
2455
2481
|
private handleSubscribeParam;
|
|
2456
2482
|
private checkUnsubParam;
|
|
2457
2483
|
join(joinInfo: JoinParam): Promise<ISignal_msg.IJoinResponse>;
|
|
@@ -2465,9 +2491,15 @@ declare class ServiceManager extends EventEmitter<ChannelEvens> {
|
|
|
2465
2491
|
*/
|
|
2466
2492
|
publish(tracks: LocalTrack[]): Promise<void>;
|
|
2467
2493
|
unpublish(tracks: LocalTrack[]): Promise<void>;
|
|
2468
|
-
private
|
|
2469
|
-
batchSubscribe(batchSubscribeParams:
|
|
2470
|
-
batchUnsubscribe(batchUnsubscribeParam:
|
|
2494
|
+
private updateSubbedRemoteTrack;
|
|
2495
|
+
batchSubscribe(batchSubscribeParams: InternalSubscribeParam[]): Promise<SubscribeResult[]>;
|
|
2496
|
+
batchUnsubscribe(batchUnsubscribeParam: InternalSubscribeParam[]): Promise<void | IBatchSubscribeResult[]>;
|
|
2497
|
+
/**
|
|
2498
|
+
* TODO: 这里的事件很奇怪,似乎是专门给asr sdk使用的
|
|
2499
|
+
* resub 过程如何处理?
|
|
2500
|
+
* @param subscribed
|
|
2501
|
+
* @param streamId
|
|
2502
|
+
*/
|
|
2471
2503
|
private updateSubscribedAudioStream;
|
|
2472
2504
|
subscribeGroup(groupId: string): Promise<RemoteAudioTrack>;
|
|
2473
2505
|
unsubscribeGroup(groupId: string): Promise<void>;
|
|
@@ -3009,7 +3041,7 @@ type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'none';
|
|
|
3009
3041
|
* @required mediaType 订阅的轨道媒体类型
|
|
3010
3042
|
* @optional auxiliary 如果订阅视频轨道,是否订阅共享视频流
|
|
3011
3043
|
*/
|
|
3012
|
-
interface SubscribeParam
|
|
3044
|
+
interface SubscribeParam {
|
|
3013
3045
|
uid: string;
|
|
3014
3046
|
mediaType: TrackMediaType;
|
|
3015
3047
|
auxiliary?: boolean;
|
|
@@ -3415,6 +3447,7 @@ interface IBatchSubscribeParam {
|
|
|
3415
3447
|
track?: RemoteTrack;
|
|
3416
3448
|
error?: DingRTCError;
|
|
3417
3449
|
streamType?: RemoteStreamType;
|
|
3450
|
+
targetMediaType: TrackMediaType;
|
|
3418
3451
|
uid?: string;
|
|
3419
3452
|
session?: Subscription;
|
|
3420
3453
|
profileFallback?: boolean;
|
|
@@ -3450,7 +3483,7 @@ interface SenderEncoding {
|
|
|
3450
3483
|
targetHeight?: number;
|
|
3451
3484
|
priority?: string;
|
|
3452
3485
|
}
|
|
3453
|
-
interface
|
|
3486
|
+
interface InternalSubscribeParam {
|
|
3454
3487
|
uid?: string;
|
|
3455
3488
|
groupId?: string;
|
|
3456
3489
|
auxiliary?: boolean;
|
|
@@ -3499,9 +3532,10 @@ declare class LocalTrack extends Track {
|
|
|
3499
3532
|
protected setMediaStreamTrack(track: MediaStreamTrack): void;
|
|
3500
3533
|
play(mediaWrapperElement?: string | HTMLElement, config?: VideoPlayerConfig): void;
|
|
3501
3534
|
/**
|
|
3502
|
-
*
|
|
3535
|
+
* 启用/禁用该轨道。禁用时销毁媒体流,如果流来自mic和cam设备,将不再占用设备,启用后重新请求特定的媒体流
|
|
3536
|
+
* 如果该track已经发布,通知其他用户 rtc 流已经unmute,参考setMuted操作
|
|
3503
3537
|
*
|
|
3504
|
-
*
|
|
3538
|
+
* 轨道禁用后,播放将停止,通知其他用户 rtc 流已经mute。
|
|
3505
3539
|
*
|
|
3506
3540
|
* @param enabled 是否启用该轨道
|
|
3507
3541
|
* - true: 启用该轨道。
|
|
@@ -3515,12 +3549,11 @@ declare class LocalTrack extends Track {
|
|
|
3515
3549
|
*/
|
|
3516
3550
|
close(): void;
|
|
3517
3551
|
/**
|
|
3518
|
-
*
|
|
3519
|
-
*
|
|
3520
|
-
*
|
|
3521
|
-
*
|
|
3522
|
-
*
|
|
3523
|
-
* - false: 暂停发送媒体数据
|
|
3552
|
+
* 把音频源mute,如果当前track已经被发布出去,如果当前track是video类型,那么其他用户会收到 video-mute 或者video-unmute事件。
|
|
3553
|
+
* 如果当前track是来自麦克风或者屏幕共享的音频流,且是最后一个被mute的音频源,那么其他用户会收到 audio-mute 或者audio-unmute事件,
|
|
3554
|
+
* 如果不是最后一个被mute/unmute操作的音频源,那么其他用户不会收到 audio-mute 或者audio-unmute事件
|
|
3555
|
+
* 支持发布之前调用,在publish之后会补mute动作
|
|
3556
|
+
* @param muted 是否mute
|
|
3524
3557
|
*/
|
|
3525
3558
|
setMuted(muted: boolean): Promise<void>;
|
|
3526
3559
|
private getAudioTrack;
|
|
@@ -3852,4 +3885,4 @@ declare class DingRTC extends EventEmitter<IGlobalEvent> {
|
|
|
3852
3885
|
declare const _default: DingRTC;
|
|
3853
3886
|
|
|
3854
3887
|
export { AudioSourceInfo, AudioSourceState, CameraVideoTrack, DingRTCClient, FALLBACK_SUB_VIDEO_PROFILE, LocalAudioTrack, LocalTrack, LocalVideoTrack, MicrophoneAudioTrack, RemoteAudioTrack, RemoteTrack, User as RemoteUser, RemoteVideoTrack, Track, VideoSourceInfo, _default as default };
|
|
3855
|
-
export type { BufferSourceAudioTrackConfig, CameraVideoTrackConfig, ChannelEvens, ConnectionState, CustomAudioTrackConfig, CustomVideoTrackConfig, DeviceInfo, DisconnectedReason, GlobalClientConfigInfo, Group, GroupAudioRoute, GroupPropertyUpdateTypes, GroupUser, IClientEvents, ICommonExceptionEvent, IGlobalEvent, ISharedChannelInstance, JoinGroupConfig, JoinParam, LeaveGroupConfig, LocalAudioStates, LocalVideoStates, LocalVideoStatesMap, LogLevel, MicrophoneAudioTrackConfig, NetworkQuality, OptimizationMode, RemoteAudioStates, RemoteStreamType, RemoteVideoStates, RemoteVideoStatesMap, ScreenVideoTrackConfig, SubscribeParam
|
|
3888
|
+
export type { BufferSourceAudioTrackConfig, CameraVideoTrackConfig, ChannelEvens, ConnectionState, CustomAudioTrackConfig, CustomVideoTrackConfig, DeviceInfo, DisconnectedReason, GlobalClientConfigInfo, Group, GroupAudioRoute, GroupPropertyUpdateTypes, GroupUser, IClientEvents, ICommonExceptionEvent, IGlobalEvent, ISharedChannelInstance, JoinGroupConfig, JoinParam, LeaveGroupConfig, LocalAudioStates, LocalVideoStates, LocalVideoStatesMap, LogLevel, MicrophoneAudioTrackConfig, NetworkQuality, OptimizationMode, RemoteAudioStates, RemoteStreamType, RemoteVideoStates, RemoteVideoStatesMap, ScreenVideoTrackConfig, SubscribeParam, SubscribeResult, TrackMediaType, UnsubscribeParam, VideoDimension, VideoEncoderConfiguration, VideoPlayerConfig };
|