@seastart/srtc-web-sdk 0.3.3 → 0.3.6
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/package.json +1 -1
- package/srtc.d.mts +91 -23
- package/srtc.d.ts +91 -23
- package/srtc.js +1 -1
- package/srtc.mjs +1 -1
package/package.json
CHANGED
package/srtc.d.mts
CHANGED
|
@@ -27,8 +27,9 @@ declare abstract class BaseSRTC {
|
|
|
27
27
|
/**
|
|
28
28
|
* 加入频道
|
|
29
29
|
* @param token 加入频道token
|
|
30
|
+
* @param options 加入频道选项
|
|
30
31
|
*/
|
|
31
|
-
join(token: string): Promise<BaseChannelInfo>;
|
|
32
|
+
join(token: string, options?: JoinOptions): Promise<BaseChannelInfo>;
|
|
32
33
|
/**
|
|
33
34
|
* 离开频道
|
|
34
35
|
*/
|
|
@@ -55,10 +56,10 @@ declare abstract class BaseSRTC {
|
|
|
55
56
|
getUsersInfo(map: true): Record<string, BaseUserInfo>;
|
|
56
57
|
getUsersInfo(map: false): BaseUserInfo[];
|
|
57
58
|
/**
|
|
58
|
-
*
|
|
59
|
-
* @param
|
|
59
|
+
* 订阅频道混音流
|
|
60
|
+
* @param filter 音频轨道过滤器,传递string[]时,根据uid过滤
|
|
60
61
|
*/
|
|
61
|
-
subscribeRemoteAudioMixTrack(
|
|
62
|
+
subscribeRemoteAudioMixTrack(filter?: ((track: BaseTrack) => boolean) | string[]): Promise<BaseTrack>;
|
|
62
63
|
/**
|
|
63
64
|
* 订阅远端用户音频流
|
|
64
65
|
* @param uid 用户id
|
|
@@ -127,6 +128,7 @@ declare abstract class BaseWebrtcTrack extends BaseTrack {
|
|
|
127
128
|
constructor(info: BaseTrackInfo, uid: string);
|
|
128
129
|
setMediaStreamTrack(mediaStreamTrack?: MediaStreamTrack): void;
|
|
129
130
|
getMediaStreamTrack(): MediaStreamTrack | undefined;
|
|
131
|
+
getMediaStream(): MediaStream;
|
|
130
132
|
}
|
|
131
133
|
declare class CommonChannelEventType {
|
|
132
134
|
/** 频道自定义props更新,对应data为ChannelInfo */
|
|
@@ -207,18 +209,6 @@ declare class SdkError {
|
|
|
207
209
|
msg: string;
|
|
208
210
|
};
|
|
209
211
|
}
|
|
210
|
-
declare enum Codec {
|
|
211
|
-
/** 未知编码类型 */
|
|
212
|
-
Unknown = 0,
|
|
213
|
-
/** h264编码 */
|
|
214
|
-
H264 = 27,
|
|
215
|
-
/** h265编码 */
|
|
216
|
-
H265 = 36,
|
|
217
|
-
/** AAC编码 */
|
|
218
|
-
AAC = 15,
|
|
219
|
-
/** OPUS编码 */
|
|
220
|
-
OPUS = 1398100047
|
|
221
|
-
}
|
|
222
212
|
declare function dateFormat(format: string, date?: Date): string;
|
|
223
213
|
declare function dct(t: string): any;
|
|
224
214
|
declare function genNonce(len?: number): string;
|
|
@@ -288,7 +278,7 @@ export declare class LocalCameraTrack extends LocalVideoTrack {
|
|
|
288
278
|
* 开始采集
|
|
289
279
|
* @param opt 采集参数
|
|
290
280
|
*/
|
|
291
|
-
startCapture(opt?: CameraCaptureOptions): Promise<void>;
|
|
281
|
+
startCapture(opt?: Partial<CameraCaptureOptions>): Promise<void>;
|
|
292
282
|
/**
|
|
293
283
|
* 停止采集
|
|
294
284
|
*/
|
|
@@ -314,7 +304,7 @@ export declare class LocalMicTrack extends LocalAudioTrack {
|
|
|
314
304
|
* 开始采集
|
|
315
305
|
* @param opt 采集参数
|
|
316
306
|
*/
|
|
317
|
-
startCapture(opt?: MicCaptureOptions): Promise<void>;
|
|
307
|
+
startCapture(opt?: Partial<MicCaptureOptions>): Promise<void>;
|
|
318
308
|
/**
|
|
319
309
|
* 停止采集
|
|
320
310
|
*/
|
|
@@ -349,7 +339,7 @@ export declare class LocalScreenTrack extends LocalVideoTrack {
|
|
|
349
339
|
* 开始采集
|
|
350
340
|
* @param opt 采集参数
|
|
351
341
|
*/
|
|
352
|
-
startCapture(opt?: ScreenCaptureOptions): Promise<void>;
|
|
342
|
+
startCapture(opt?: Partial<ScreenCaptureOptions>): Promise<void>;
|
|
353
343
|
/**
|
|
354
344
|
* 停止采集
|
|
355
345
|
*/
|
|
@@ -388,7 +378,7 @@ export declare class LocalVideoTrack extends BaseWebrtcTrack {
|
|
|
388
378
|
/**
|
|
389
379
|
* 远端混音流
|
|
390
380
|
*/
|
|
391
|
-
export declare class RemoteAudioMixTrack extends RemoteAudioTrack {
|
|
381
|
+
export declare class RemoteAudioMixTrack extends RemoteAudioTrack implements IRemoteAudioMixTrack {
|
|
392
382
|
constructor(info: BaseTrackInfo, filterUids?: string[]);
|
|
393
383
|
/**
|
|
394
384
|
* 混音流中过滤的uid
|
|
@@ -401,6 +391,10 @@ export declare class RemoteAudioMixTrack extends RemoteAudioTrack {
|
|
|
401
391
|
*/
|
|
402
392
|
export declare class RemoteAudioTrack extends BaseWebrtcTrack {
|
|
403
393
|
constructor(info: BaseTrackInfo, uid: string);
|
|
394
|
+
/**
|
|
395
|
+
* 是否正在播放
|
|
396
|
+
*/
|
|
397
|
+
isPlaying(): boolean;
|
|
404
398
|
/**
|
|
405
399
|
* 播放音频(可指定播放设备)
|
|
406
400
|
*/
|
|
@@ -493,8 +487,9 @@ export declare class SRTC extends BaseSRTC {
|
|
|
493
487
|
unpublishLocalTrack(track: LocalAudioTrack | LocalVideoTrack): Promise<void>;
|
|
494
488
|
/**
|
|
495
489
|
* 订阅远端频道混音流
|
|
490
|
+
* @param filter 音频轨道过滤器,传递string[]时,根据uid过滤
|
|
496
491
|
*/
|
|
497
|
-
subscribeRemoteAudioMixTrack(
|
|
492
|
+
subscribeRemoteAudioMixTrack(filter?: ((track: BaseTrack) => boolean) | string[]): Promise<RemoteAudioMixTrack>;
|
|
498
493
|
/**
|
|
499
494
|
* 订阅远端用户音频流
|
|
500
495
|
* @param uid 用户id
|
|
@@ -561,6 +556,25 @@ export declare const ScreenPresets: {
|
|
|
561
556
|
/** 分辨率1280*720,帧率10,码率1.5Mbps */
|
|
562
557
|
"720p": ScreenPreset;
|
|
563
558
|
};
|
|
559
|
+
/**
|
|
560
|
+
* 编码类型
|
|
561
|
+
*/
|
|
562
|
+
export declare enum Codec {
|
|
563
|
+
/** h264编码 */
|
|
564
|
+
H264 = 27,
|
|
565
|
+
/** h265编码 */
|
|
566
|
+
H265 = 36,
|
|
567
|
+
/** AAC编码 */
|
|
568
|
+
AAC = 15,
|
|
569
|
+
/** VP8编码 */
|
|
570
|
+
VP8 = 56,
|
|
571
|
+
/** VP9编码 */
|
|
572
|
+
VP9 = 57,
|
|
573
|
+
/** AV1编码 */
|
|
574
|
+
AV1 = 58,
|
|
575
|
+
/** OPUS编码 */
|
|
576
|
+
OPUS = 1398100047
|
|
577
|
+
}
|
|
564
578
|
/**
|
|
565
579
|
* 终端类型枚举
|
|
566
580
|
*/
|
|
@@ -655,6 +669,16 @@ export declare enum TrackKind {
|
|
|
655
669
|
Video = "video",
|
|
656
670
|
Audio = "audio"
|
|
657
671
|
}
|
|
672
|
+
/**
|
|
673
|
+
* 编码类型转字符串
|
|
674
|
+
* @param codec
|
|
675
|
+
* @returns
|
|
676
|
+
*/
|
|
677
|
+
export declare function codec2str(codec: Codec): string;
|
|
678
|
+
/**
|
|
679
|
+
* 创建混音后的音频轨
|
|
680
|
+
*/
|
|
681
|
+
export declare function createMixedAudioMediaStreamTrack(canvasContext?: CanvasRenderingContext2D): MixedAudioMediaStreamTrack;
|
|
658
682
|
export declare namespace __INNER__ {
|
|
659
683
|
const BaseSRTC_I: typeof BaseSRTC;
|
|
660
684
|
const CommonChannelEventType_I: typeof CommonChannelEventType;
|
|
@@ -865,6 +889,14 @@ export interface EnvWebInfo extends Bowser$1.Parser.ParsedResult {
|
|
|
865
889
|
*/
|
|
866
890
|
devicePixelRatio: number;
|
|
867
891
|
}
|
|
892
|
+
/** 远端混音流轨接口 */
|
|
893
|
+
export interface IRemoteAudioMixTrack {
|
|
894
|
+
readonly __type: "RemoteAudioMixTrack";
|
|
895
|
+
/**
|
|
896
|
+
* 获取过滤音频的用户id
|
|
897
|
+
*/
|
|
898
|
+
getFilterUids(): string[];
|
|
899
|
+
}
|
|
868
900
|
/**
|
|
869
901
|
* im强制断开事件data
|
|
870
902
|
*/
|
|
@@ -889,6 +921,27 @@ export interface ImMsgData {
|
|
|
889
921
|
/** 发送者昵称 */
|
|
890
922
|
name: string;
|
|
891
923
|
}
|
|
924
|
+
/**
|
|
925
|
+
* 加入频道选项
|
|
926
|
+
*/
|
|
927
|
+
export interface JoinOptions {
|
|
928
|
+
/**
|
|
929
|
+
* 是否自动订阅音频流
|
|
930
|
+
*/
|
|
931
|
+
autoSubscribeAudio?: boolean;
|
|
932
|
+
/**
|
|
933
|
+
* 是否自动订阅视频流
|
|
934
|
+
*/
|
|
935
|
+
autoSubscribeVideo?: boolean;
|
|
936
|
+
/**
|
|
937
|
+
* 希望的优先视频编码类型
|
|
938
|
+
*/
|
|
939
|
+
preferVideoCodec?: Codec;
|
|
940
|
+
/**
|
|
941
|
+
* 希望的优先音频编码类型
|
|
942
|
+
*/
|
|
943
|
+
preferAudioCodec?: Codec;
|
|
944
|
+
}
|
|
892
945
|
/**
|
|
893
946
|
* 麦克风采集配置
|
|
894
947
|
*/
|
|
@@ -933,6 +986,14 @@ export interface MicPreset {
|
|
|
933
986
|
capture: MicCaptureOptions;
|
|
934
987
|
publish: AudioPublishOptions;
|
|
935
988
|
}
|
|
989
|
+
/**
|
|
990
|
+
* 混音后的音频轨
|
|
991
|
+
*/
|
|
992
|
+
export interface MixedAudioMediaStreamTrack extends MediaStreamTrack {
|
|
993
|
+
context: AudioContext;
|
|
994
|
+
addTrack(track: MediaStreamTrack): void;
|
|
995
|
+
removeTrack(track: MediaStreamTrack): void;
|
|
996
|
+
}
|
|
936
997
|
/**
|
|
937
998
|
* 属性更改项
|
|
938
999
|
*/
|
|
@@ -972,6 +1033,11 @@ export interface ScreenCaptureOptions {
|
|
|
972
1033
|
* 帧率
|
|
973
1034
|
*/
|
|
974
1035
|
frameRate?: number;
|
|
1036
|
+
/**
|
|
1037
|
+
* specify the type of content, see: https://www.w3.org/TR/mst-content-hint/#video-content-hints
|
|
1038
|
+
* https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack/contentHint
|
|
1039
|
+
*/
|
|
1040
|
+
contentHint?: "detail" | "text" | "motion";
|
|
975
1041
|
/**
|
|
976
1042
|
* 是否显示鼠标
|
|
977
1043
|
*/
|
|
@@ -1036,8 +1102,8 @@ export interface VideoPublishOptions {
|
|
|
1036
1102
|
*/
|
|
1037
1103
|
priority?: RTCPriorityType;
|
|
1038
1104
|
/**
|
|
1039
|
-
* degradationPreference
|
|
1040
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/API/
|
|
1105
|
+
* degradationPreference 弱网降级策略
|
|
1106
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpSender/setParameters#degradationpreference
|
|
1041
1107
|
*/
|
|
1042
1108
|
degradationPreference?: RTCDegradationPreference;
|
|
1043
1109
|
/** 自定义属性 */
|
|
@@ -1091,6 +1157,8 @@ interface BaseTrackInfo {
|
|
|
1091
1157
|
bitrate: number;
|
|
1092
1158
|
/** 音频采样率 */
|
|
1093
1159
|
sample_rate: number;
|
|
1160
|
+
/** 音频声道数 */
|
|
1161
|
+
channel_count: number;
|
|
1094
1162
|
/** 流扩展属性 */
|
|
1095
1163
|
props?: Record<string, any>;
|
|
1096
1164
|
}
|
package/srtc.d.ts
CHANGED
|
@@ -27,8 +27,9 @@ declare abstract class BaseSRTC {
|
|
|
27
27
|
/**
|
|
28
28
|
* 加入频道
|
|
29
29
|
* @param token 加入频道token
|
|
30
|
+
* @param options 加入频道选项
|
|
30
31
|
*/
|
|
31
|
-
join(token: string): Promise<BaseChannelInfo>;
|
|
32
|
+
join(token: string, options?: JoinOptions): Promise<BaseChannelInfo>;
|
|
32
33
|
/**
|
|
33
34
|
* 离开频道
|
|
34
35
|
*/
|
|
@@ -55,10 +56,10 @@ declare abstract class BaseSRTC {
|
|
|
55
56
|
getUsersInfo(map: true): Record<string, BaseUserInfo>;
|
|
56
57
|
getUsersInfo(map: false): BaseUserInfo[];
|
|
57
58
|
/**
|
|
58
|
-
*
|
|
59
|
-
* @param
|
|
59
|
+
* 订阅频道混音流
|
|
60
|
+
* @param filter 音频轨道过滤器,传递string[]时,根据uid过滤
|
|
60
61
|
*/
|
|
61
|
-
subscribeRemoteAudioMixTrack(
|
|
62
|
+
subscribeRemoteAudioMixTrack(filter?: ((track: BaseTrack) => boolean) | string[]): Promise<BaseTrack>;
|
|
62
63
|
/**
|
|
63
64
|
* 订阅远端用户音频流
|
|
64
65
|
* @param uid 用户id
|
|
@@ -127,6 +128,7 @@ declare abstract class BaseWebrtcTrack extends BaseTrack {
|
|
|
127
128
|
constructor(info: BaseTrackInfo, uid: string);
|
|
128
129
|
setMediaStreamTrack(mediaStreamTrack?: MediaStreamTrack): void;
|
|
129
130
|
getMediaStreamTrack(): MediaStreamTrack | undefined;
|
|
131
|
+
getMediaStream(): MediaStream;
|
|
130
132
|
}
|
|
131
133
|
declare class CommonChannelEventType {
|
|
132
134
|
/** 频道自定义props更新,对应data为ChannelInfo */
|
|
@@ -207,18 +209,6 @@ declare class SdkError {
|
|
|
207
209
|
msg: string;
|
|
208
210
|
};
|
|
209
211
|
}
|
|
210
|
-
declare enum Codec {
|
|
211
|
-
/** 未知编码类型 */
|
|
212
|
-
Unknown = 0,
|
|
213
|
-
/** h264编码 */
|
|
214
|
-
H264 = 27,
|
|
215
|
-
/** h265编码 */
|
|
216
|
-
H265 = 36,
|
|
217
|
-
/** AAC编码 */
|
|
218
|
-
AAC = 15,
|
|
219
|
-
/** OPUS编码 */
|
|
220
|
-
OPUS = 1398100047
|
|
221
|
-
}
|
|
222
212
|
declare function dateFormat(format: string, date?: Date): string;
|
|
223
213
|
declare function dct(t: string): any;
|
|
224
214
|
declare function genNonce(len?: number): string;
|
|
@@ -288,7 +278,7 @@ export declare class LocalCameraTrack extends LocalVideoTrack {
|
|
|
288
278
|
* 开始采集
|
|
289
279
|
* @param opt 采集参数
|
|
290
280
|
*/
|
|
291
|
-
startCapture(opt?: CameraCaptureOptions): Promise<void>;
|
|
281
|
+
startCapture(opt?: Partial<CameraCaptureOptions>): Promise<void>;
|
|
292
282
|
/**
|
|
293
283
|
* 停止采集
|
|
294
284
|
*/
|
|
@@ -314,7 +304,7 @@ export declare class LocalMicTrack extends LocalAudioTrack {
|
|
|
314
304
|
* 开始采集
|
|
315
305
|
* @param opt 采集参数
|
|
316
306
|
*/
|
|
317
|
-
startCapture(opt?: MicCaptureOptions): Promise<void>;
|
|
307
|
+
startCapture(opt?: Partial<MicCaptureOptions>): Promise<void>;
|
|
318
308
|
/**
|
|
319
309
|
* 停止采集
|
|
320
310
|
*/
|
|
@@ -349,7 +339,7 @@ export declare class LocalScreenTrack extends LocalVideoTrack {
|
|
|
349
339
|
* 开始采集
|
|
350
340
|
* @param opt 采集参数
|
|
351
341
|
*/
|
|
352
|
-
startCapture(opt?: ScreenCaptureOptions): Promise<void>;
|
|
342
|
+
startCapture(opt?: Partial<ScreenCaptureOptions>): Promise<void>;
|
|
353
343
|
/**
|
|
354
344
|
* 停止采集
|
|
355
345
|
*/
|
|
@@ -388,7 +378,7 @@ export declare class LocalVideoTrack extends BaseWebrtcTrack {
|
|
|
388
378
|
/**
|
|
389
379
|
* 远端混音流
|
|
390
380
|
*/
|
|
391
|
-
export declare class RemoteAudioMixTrack extends RemoteAudioTrack {
|
|
381
|
+
export declare class RemoteAudioMixTrack extends RemoteAudioTrack implements IRemoteAudioMixTrack {
|
|
392
382
|
constructor(info: BaseTrackInfo, filterUids?: string[]);
|
|
393
383
|
/**
|
|
394
384
|
* 混音流中过滤的uid
|
|
@@ -401,6 +391,10 @@ export declare class RemoteAudioMixTrack extends RemoteAudioTrack {
|
|
|
401
391
|
*/
|
|
402
392
|
export declare class RemoteAudioTrack extends BaseWebrtcTrack {
|
|
403
393
|
constructor(info: BaseTrackInfo, uid: string);
|
|
394
|
+
/**
|
|
395
|
+
* 是否正在播放
|
|
396
|
+
*/
|
|
397
|
+
isPlaying(): boolean;
|
|
404
398
|
/**
|
|
405
399
|
* 播放音频(可指定播放设备)
|
|
406
400
|
*/
|
|
@@ -493,8 +487,9 @@ export declare class SRTC extends BaseSRTC {
|
|
|
493
487
|
unpublishLocalTrack(track: LocalAudioTrack | LocalVideoTrack): Promise<void>;
|
|
494
488
|
/**
|
|
495
489
|
* 订阅远端频道混音流
|
|
490
|
+
* @param filter 音频轨道过滤器,传递string[]时,根据uid过滤
|
|
496
491
|
*/
|
|
497
|
-
subscribeRemoteAudioMixTrack(
|
|
492
|
+
subscribeRemoteAudioMixTrack(filter?: ((track: BaseTrack) => boolean) | string[]): Promise<RemoteAudioMixTrack>;
|
|
498
493
|
/**
|
|
499
494
|
* 订阅远端用户音频流
|
|
500
495
|
* @param uid 用户id
|
|
@@ -561,6 +556,25 @@ export declare const ScreenPresets: {
|
|
|
561
556
|
/** 分辨率1280*720,帧率10,码率1.5Mbps */
|
|
562
557
|
"720p": ScreenPreset;
|
|
563
558
|
};
|
|
559
|
+
/**
|
|
560
|
+
* 编码类型
|
|
561
|
+
*/
|
|
562
|
+
export declare enum Codec {
|
|
563
|
+
/** h264编码 */
|
|
564
|
+
H264 = 27,
|
|
565
|
+
/** h265编码 */
|
|
566
|
+
H265 = 36,
|
|
567
|
+
/** AAC编码 */
|
|
568
|
+
AAC = 15,
|
|
569
|
+
/** VP8编码 */
|
|
570
|
+
VP8 = 56,
|
|
571
|
+
/** VP9编码 */
|
|
572
|
+
VP9 = 57,
|
|
573
|
+
/** AV1编码 */
|
|
574
|
+
AV1 = 58,
|
|
575
|
+
/** OPUS编码 */
|
|
576
|
+
OPUS = 1398100047
|
|
577
|
+
}
|
|
564
578
|
/**
|
|
565
579
|
* 终端类型枚举
|
|
566
580
|
*/
|
|
@@ -655,6 +669,16 @@ export declare enum TrackKind {
|
|
|
655
669
|
Video = "video",
|
|
656
670
|
Audio = "audio"
|
|
657
671
|
}
|
|
672
|
+
/**
|
|
673
|
+
* 编码类型转字符串
|
|
674
|
+
* @param codec
|
|
675
|
+
* @returns
|
|
676
|
+
*/
|
|
677
|
+
export declare function codec2str(codec: Codec): string;
|
|
678
|
+
/**
|
|
679
|
+
* 创建混音后的音频轨
|
|
680
|
+
*/
|
|
681
|
+
export declare function createMixedAudioMediaStreamTrack(canvasContext?: CanvasRenderingContext2D): MixedAudioMediaStreamTrack;
|
|
658
682
|
export declare namespace __INNER__ {
|
|
659
683
|
const BaseSRTC_I: typeof BaseSRTC;
|
|
660
684
|
const CommonChannelEventType_I: typeof CommonChannelEventType;
|
|
@@ -865,6 +889,14 @@ export interface EnvWebInfo extends Bowser$1.Parser.ParsedResult {
|
|
|
865
889
|
*/
|
|
866
890
|
devicePixelRatio: number;
|
|
867
891
|
}
|
|
892
|
+
/** 远端混音流轨接口 */
|
|
893
|
+
export interface IRemoteAudioMixTrack {
|
|
894
|
+
readonly __type: "RemoteAudioMixTrack";
|
|
895
|
+
/**
|
|
896
|
+
* 获取过滤音频的用户id
|
|
897
|
+
*/
|
|
898
|
+
getFilterUids(): string[];
|
|
899
|
+
}
|
|
868
900
|
/**
|
|
869
901
|
* im强制断开事件data
|
|
870
902
|
*/
|
|
@@ -889,6 +921,27 @@ export interface ImMsgData {
|
|
|
889
921
|
/** 发送者昵称 */
|
|
890
922
|
name: string;
|
|
891
923
|
}
|
|
924
|
+
/**
|
|
925
|
+
* 加入频道选项
|
|
926
|
+
*/
|
|
927
|
+
export interface JoinOptions {
|
|
928
|
+
/**
|
|
929
|
+
* 是否自动订阅音频流
|
|
930
|
+
*/
|
|
931
|
+
autoSubscribeAudio?: boolean;
|
|
932
|
+
/**
|
|
933
|
+
* 是否自动订阅视频流
|
|
934
|
+
*/
|
|
935
|
+
autoSubscribeVideo?: boolean;
|
|
936
|
+
/**
|
|
937
|
+
* 希望的优先视频编码类型
|
|
938
|
+
*/
|
|
939
|
+
preferVideoCodec?: Codec;
|
|
940
|
+
/**
|
|
941
|
+
* 希望的优先音频编码类型
|
|
942
|
+
*/
|
|
943
|
+
preferAudioCodec?: Codec;
|
|
944
|
+
}
|
|
892
945
|
/**
|
|
893
946
|
* 麦克风采集配置
|
|
894
947
|
*/
|
|
@@ -933,6 +986,14 @@ export interface MicPreset {
|
|
|
933
986
|
capture: MicCaptureOptions;
|
|
934
987
|
publish: AudioPublishOptions;
|
|
935
988
|
}
|
|
989
|
+
/**
|
|
990
|
+
* 混音后的音频轨
|
|
991
|
+
*/
|
|
992
|
+
export interface MixedAudioMediaStreamTrack extends MediaStreamTrack {
|
|
993
|
+
context: AudioContext;
|
|
994
|
+
addTrack(track: MediaStreamTrack): void;
|
|
995
|
+
removeTrack(track: MediaStreamTrack): void;
|
|
996
|
+
}
|
|
936
997
|
/**
|
|
937
998
|
* 属性更改项
|
|
938
999
|
*/
|
|
@@ -972,6 +1033,11 @@ export interface ScreenCaptureOptions {
|
|
|
972
1033
|
* 帧率
|
|
973
1034
|
*/
|
|
974
1035
|
frameRate?: number;
|
|
1036
|
+
/**
|
|
1037
|
+
* specify the type of content, see: https://www.w3.org/TR/mst-content-hint/#video-content-hints
|
|
1038
|
+
* https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack/contentHint
|
|
1039
|
+
*/
|
|
1040
|
+
contentHint?: "detail" | "text" | "motion";
|
|
975
1041
|
/**
|
|
976
1042
|
* 是否显示鼠标
|
|
977
1043
|
*/
|
|
@@ -1036,8 +1102,8 @@ export interface VideoPublishOptions {
|
|
|
1036
1102
|
*/
|
|
1037
1103
|
priority?: RTCPriorityType;
|
|
1038
1104
|
/**
|
|
1039
|
-
* degradationPreference
|
|
1040
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/API/
|
|
1105
|
+
* degradationPreference 弱网降级策略
|
|
1106
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpSender/setParameters#degradationpreference
|
|
1041
1107
|
*/
|
|
1042
1108
|
degradationPreference?: RTCDegradationPreference;
|
|
1043
1109
|
/** 自定义属性 */
|
|
@@ -1091,6 +1157,8 @@ interface BaseTrackInfo {
|
|
|
1091
1157
|
bitrate: number;
|
|
1092
1158
|
/** 音频采样率 */
|
|
1093
1159
|
sample_rate: number;
|
|
1160
|
+
/** 音频声道数 */
|
|
1161
|
+
channel_count: number;
|
|
1094
1162
|
/** 流扩展属性 */
|
|
1095
1163
|
props?: Record<string, any>;
|
|
1096
1164
|
}
|