trtc-electron-sdk 12.2.701 → 12.2.702

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/liteav/trtc.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /// <reference types="node" />
2
2
  import { EventEmitter } from 'events';
3
3
  import { TRTCConfig } from './Renderer/util';
4
- import { AudioMusicParam, Rect, TRTCAppScene, TRTCAudioEffectParam, TRTCAudioQuality, TRTCBeautyStyle, TRTCDeviceState, TRTCDeviceType, TRTCLogLevel, TRTCRenderParams, TRTCRoleType, TRTCSpeedTestResult, TRTCStatistics, TRTCSwitchRoomParam, TRTCVideoBufferType, TRTCVideoFillMode, TRTCAudioFrame, TRTCVideoPixelFormat, TRTCVideoRotation, TRTCVideoStreamType, TRTCVolumeInfo, TRTCWaterMarkSrcType, TRTCQualityInfo, TRTCPluginType, TRTCPluginInfo, TRTCVideoProcessPluginOptions, TRTCMediaEncryptDecryptPluginOptions, TRTCAudioRecordingParams, TRTCScreenCaptureSourceInfo, TRTCScreenCaptureProperty, TRTCSpeedTestParams, TRTCRecordType, TRTCDeviceInfo, TRTCCameraCaptureParams, TRTCImageBuffer, TRTCInitConfig, TRTCAudioParallelParams, TRTCVoiceReverbType, TRTCVoiceChangerType, TRTCMusicPlayObserver, TRTCAudioFrameCallback, TRTCAudioProcessPluginOptions } from './trtc_define';
4
+ import { AudioMusicParam, Rect, TRTCAppScene, TRTCAudioEffectParam, TRTCAudioQuality, TRTCBeautyStyle, TRTCDeviceState, TRTCDeviceType, TRTCLogLevel, TRTCRenderParams, TRTCRoleType, TRTCSpeedTestResult, TRTCStatistics, TRTCSwitchRoomParam, TRTCVideoBufferType, TRTCVideoFillMode, TRTCAudioFrame, TRTCVideoPixelFormat, TRTCVideoRotation, TRTCVideoStreamType, TRTCVolumeInfo, TRTCWaterMarkSrcType, TRTCQualityInfo, TRTCPluginType, TRTCPluginInfo, TRTCVideoProcessPluginOptions, TRTCMediaEncryptDecryptPluginOptions, TRTCAudioRecordingParams, TRTCScreenCaptureSourceInfo, TRTCScreenCaptureProperty, TRTCSpeedTestParams, TRTCRecordType, TRTCDeviceInfo, TRTCCameraCaptureParams, TRTCImageBuffer, TRTCInitConfig, TRTCAudioParallelParams, TRTCVoiceReverbType, TRTCVoiceChangerType, TRTCMusicPlayObserver, TRTCAudioFrameCallback, TRTCAudioProcessPluginOptions, TRTCPublishTarget, TRTCStreamEncoderParam, TRTCStreamMixingConfig } from './trtc_define';
5
5
  import TRTCMediaMixingManager from './extensions/MediaMixingManager';
6
6
  export * from './trtc_define';
7
7
  export * from './trtc_code';
@@ -48,6 +48,10 @@ declare class TRTCCloud extends EventEmitter {
48
48
  private videoProcessPixelFormat;
49
49
  private videoRenderFPS;
50
50
  private localVideoRenderController;
51
+ private deviceManager;
52
+ private audioEffectManager;
53
+ private pluginManager;
54
+ private mediaMixingManager;
51
55
  private localRotation;
52
56
  private localMirrorType;
53
57
  private remoteMainStreamFillMode;
@@ -63,14 +67,18 @@ declare class TRTCCloud extends EventEmitter {
63
67
  private remoteVideoBufferMap;
64
68
  private localVideoBufferMap;
65
69
  /**
66
- * 构造函数
67
- * @param config {TRTCInitConfig} - 初始化参数,可选
68
- * @param config.networkProxy {Record<string, any>} - 网络代理参数,可选。为空时,默认不开启网络代理。
69
- * @param config.isIPCMode {Boolean} - 是否跨进程模式,跨进程模式支持本地混流且混流视频采用原生窗口渲染。默认:false,不开启。
70
+ * @param {TRTCInitConfig} [config] - 初始化参数,可选
71
+ * @param {Record<string, any>} [config.networkProxy] - 网络代理参数,可选。为空时,默认不开启网络代理。
72
+ * @param {Boolean} [config.isIPCMode] - 是否跨进程模式,跨进程模式支持本地混流且混流视频采用原生窗口渲染。默认:false,不开启。
70
73
  */
71
74
  constructor(config?: TRTCInitConfig);
72
75
  /**
73
76
  * 创建 TRTCCloud 主实例对象(单例模式)
77
+ *
78
+ * @param {TRTCInitConfig} [config] - 初始化参数,可选
79
+ * @param {Record<string, any>} [config.networkProxy] - 网络代理参数,可选。为空时,默认不开启网络代理。
80
+ * @param {Boolean} [config.isIPCMode] - 是否跨进程模式,跨进程模式支持本地混流且混流视频采用原生窗口渲染。默认:false,不开启。
81
+ *
74
82
  * @returns {TRTCCloud}
75
83
  */
76
84
  static getTRTCShareInstance(config?: TRTCInitConfig): TRTCCloud;
@@ -518,6 +526,7 @@ declare class TRTCCloud extends EventEmitter {
518
526
  * @event TRTCCallback#onStartPublishing
519
527
  * @param {Number} errCode - 0 表示成功,其余值表示失败
520
528
  * @param {String} errMsg - 具体错误原因
529
+ * @deprecated
521
530
  */
522
531
  handleOnStartPublishing(errCode: number, errMsg: string): void;
523
532
  /**
@@ -526,6 +535,7 @@ declare class TRTCCloud extends EventEmitter {
526
535
  * @event TRTCCallback#onStopPublishing
527
536
  * @param {Number} errCode - 0 表示成功,其余值表示失败
528
537
  * @param {String} errMsg - 具体错误原因
538
+ * @deprecated
529
539
  */
530
540
  handleOnStopPublishing(errCode: number, errMsg: string): void;
531
541
  /**
@@ -538,6 +548,7 @@ declare class TRTCCloud extends EventEmitter {
538
548
  * @event TRTCCallback#onStartPublishCDNStream
539
549
  * @param {Number} errCode - 错误码
540
550
  * @param {String} errMsg - 错误详细信息
551
+ * @deprecated
541
552
  */
542
553
  handleOnStartPublishCDNStream(errCode: number, errMsg: string): void;
543
554
  /**
@@ -548,6 +559,7 @@ declare class TRTCCloud extends EventEmitter {
548
559
  * @event TRTCCallback#onStopPublishCDNStream
549
560
  * @param {Number} errCode - 错误码
550
561
  * @param {String} errMsg - 错误详细信息
562
+ * @deprecated
551
563
  */
552
564
  handleOnStopPublishCDNStream(errCode: number, errMsg: string): void;
553
565
  /**
@@ -558,8 +570,59 @@ declare class TRTCCloud extends EventEmitter {
558
570
  * @event TRTCCallback#onSetMixTranscodingConfig
559
571
  * @param {Number} errCode - 错误码
560
572
  * @param {String} errMsg - 错误详细信息
573
+ * @deprecated
561
574
  */
562
575
  handleOnSetMixTranscodingConfig(errCode: number, errMsg: string): void;
576
+ /**
577
+ * 开始发布媒体流的事件回调
578
+ *
579
+ * 当您调用 [startPublishMediaStream]{@link TRTCCloud#startPublishMediaStream} 开始向 TRTC 后台服务发布媒体流时,SDK 会立刻将这一指令同步给云端服务器,随后 SDK 会收到来自云端服务器的处理结果,并将指令的执行结果通过本事件回调通知给您。
580
+ *
581
+ * @event TRTCCallback#onStartPublishMediaStream
582
+ * @param taskId {String} - 当请求成功时,TRTC 后台会在回调中提供给您这项任务的 taskId,后续您可以通过该 taskId 结合 [updatePublishMediaStream]{@link TRTCCloud#updatePublishMediaStream} 和 [stopPublishMediaStream]{@link TRTCCloud#stopPublishMediaStream} 进行更新和停止。
583
+ * @param code {Number} - 回调结果,0 表示成功,其余值表示失败。
584
+ * @param message {String} - 具体回调信息。
585
+ */
586
+ private handleOnStartPublishMediaStream;
587
+ /**
588
+ * 更新媒体流的事件回调
589
+ *
590
+ * 当您调用媒体流发布接口 ([updatePublishMediaStream]{@link TRTCCloud#updatePublishMediaStream}) 开始向 TRTC 后台服务更新媒体流时,SDK 会立刻将这一指令同步给云端服务器,随后 SDK 会收到来自云端服务器的处理结果,并将指令的执行结果通过本事件回调通知给您。
591
+ * @event TRTCCallback#onUpdatePublishMediaStream
592
+ * @param taskId {String} - 您调用媒体流发布接口 ([updatePublishMediaStream]{@link TRTCCloud#updatePublishMediaStream}) 时传入的 taskId,会通过此回调再带回给您,用于标识该回调属于哪一次更新请求。
593
+ * @param code {Number} - 回调结果,0 表示成功,其余值表示失败。
594
+ * @param message {String} - 具体回调信息。
595
+ */
596
+ private handleOnUpdatePublishMediaStream;
597
+ /**
598
+ * 停止媒体流的事件回调
599
+ *
600
+ * 当您调用停止发布媒体流 ([stopPublishMediaStream]{@link TRTCCloud#stopPublishMediaStream}) 开始向 TRTC 后台服务停止媒体流时,SDK 会立刻将这一指令同步给云端服务器,随后 SDK 会收到来自云端服务器的处理结果,并将指令的执行结果通过本事件回调通知给您。
601
+ * @event TRTCCallback#onStopPublishMediaStream
602
+ * @param taskId {String} - 您调用停止发布媒体流 ([stopPublishMediaStream]{@link TRTCCloud#stopPublishMediaStream}) 时传入的 taskId,会通过此回调再带回给您,用于标识该回调属于哪一次停止请求。
603
+ * @param code {Number} - 回调结果,0 表示成功,其余值表示失败。
604
+ * @param message {String} - 具体回调信息。
605
+ */
606
+ private handleOnStopPublishMediaStream;
607
+ /**
608
+ * RTMP/RTMPS 推流状态发生改变回调
609
+ *
610
+ * 当您调用 [startPublishMediaStream]{@link TRTCCloud#startPublishMediaStream} 开始向 TRTC 后台服务发布媒体流时,SDK 会立刻将这一指令同步给云端服务。
611
+ * 若您在目标推流配置 ([TRTCPublishTarget]{@link TRTCPublishTarget}) 设置了向腾讯或者第三方 CDN 上发布音视频流的 URL 配置,则具体 RTMP 或者 RTMPS 推流状态将通过此回调同步给您。
612
+ *
613
+ * @event TRTCCallback#onCdnStreamStateChanged
614
+ * @param cdnUrl {String} - 您调用 [startPublishMediaStream]{@link TRTCCloud#startPublishMediaStream} 时通过目标推流配置 ([TRTCPublishTarget]{@link TRTCPublishTarget}) 传入的 url,在推流状态变更时,会通过此回调同步给您。
615
+ * @param status {Number} - 推流状态。
616
+ * - 0:推流未开始或者已结束。在您调用 [stopPublishMediaStream]{@link TRTCCloud#stopPublishMediaStream} 时会返回该状态。
617
+ * - 1:正在连接 TRTC 服务器和 CDN 服务器。若无法立刻成功,TRTC 后台服务会多次重试尝试推流,并返回该状态(5s回调一次)。如成功进行推流,则进入状态 2;如服务器出错或 60 秒内未成功推流,则进入状态 4。
618
+ * - 2:CDN 推流正在进行。在成功推流后,会返回该状态。
619
+ * - 3:TRTC 服务器和 CDN 服务器推流中断,正在恢复。当 CDN 出现异常,或推流短暂中断时,TRTC 后台服务会自动尝试恢复推流,并返回该状态(5s回调一次)。如成功恢复推流,则进入状态 2;如服务器出错或 60 秒内未成功恢复,则进入状态 4。
620
+ * - 4:TRTC 服务器和 CDN 服务器推流中断,且恢复或连接超时。即此时推流失败,你可以再次调用 [updatePublishMediaStream]{@link TRTCCloud#updatePublishMediaStream} 尝试推流。
621
+ * - 5:正在断开 TRTC 服务器和 CDN 服务器。在您调用 [stopPublishMediaStream]{@link TRTCCloud#stopPublishMediaStream} 时,TRTC 后台服务会依次同步状态 5 和状态 0。
622
+ * @param code {Number} - 回调结果,0 表示成功,其余值表示失败。
623
+ * @param msg {String} - 具体回调信息。
624
+ */
625
+ private handleOnCdnStreamStateChanged;
563
626
  /**
564
627
  * 废弃事件: 播放音效结束回调
565
628
  *
@@ -797,6 +860,244 @@ declare class TRTCCloud extends EventEmitter {
797
860
  *
798
861
  */
799
862
  setDefaultStreamRecvMode(autoRecvAudio: boolean, autoRecvVideo: boolean): void;
863
+ /**
864
+ * 开始发布媒体流
865
+ *
866
+ * 该接口会向 TRTC 服务器发送指令,要求其将当前用户的音视频流转推/转码到直播 CDN 或者回推到 TRTC 房间中,您可以通过 [TRTCPublishTarget]{@link TRTCPublishTarget} 配置中的 [TRTCPublishMode]{@link TRTCPublishMode} 指定具体的发布模式。
867
+ *
868
+ * 注意:
869
+ * 1. SDK 会通过回调 [onStartPublishMediaStream]{@link TRTCCallback#event:onStartPublishMediaStream} 带给您后台启动的任务标识(即 taskId)。
870
+ * 2. 同一个任务(TRTCPublishMode 与 TRTCPublishCdnUrl 均相同)仅支持启动一次。若您后续需要更新或者停止该项任务,需要记录并使用返回的 taskId,通过 [updatePublishMediaStream]{@link TRTCCloud#updatePublishMediaStream} 或者 [stopPublishMediaStream]{@link TRTCCloud#stopPublishMediaStream} 来操作。
871
+ * 3. target 支持同时配置多个 CDN URL(最多同时 10 个)。若您的同一个转推/转码任务需要发布至多路 CDN,则仅需要在 target 中配置多个 CDN URL 即可。同一个转码任务即使有多个转推地址,对应的转码计费仍只收取一份。
872
+ * 4. 使用时需要注意不要多个任务同时往相同的 URL 地址推送,以免引起异常推流状态。一种推荐的方案是 URL 中使用 “sdkappid_roomid_userid_main” 作为区分标识,这种命名方式容易辨认且不会在您的多个应用中发生冲突。
873
+ *
874
+ * @example
875
+ * // Publish big stream(camera video) to CDN
876
+ * import TRTCCloud, { TRTCPublishMode } from 'trtc-electron-sdk';
877
+ * const trtcCloud = TRTCCloud.getTRTCShareInstance();
878
+ *
879
+ * let cdnTaskId = '';
880
+ * trtcCloud.on('onStartPublishMediaStream', (taskId: string, code: number, message: string) => {
881
+ * if (code === 0) {
882
+ * cdnTaskId = taskId;
883
+ * } else {
884
+ * console.log('startPublishMediaStream error:', code, message);
885
+ * }
886
+ * });
887
+ *
888
+ * trtc.startPublishMediaStream({
889
+ * mode: TRTCPublishMode.TRTCPublishBigStreamToCdn,
890
+ * cdnUrlList: [{
891
+ * rtmpUrl: 'rtmp://<Your RTMP URL>',
892
+ * isInternalLine: true
893
+ * }],
894
+ * mixStreamIdentity: null
895
+ * }, null, null);
896
+ *
897
+ * @example
898
+ * // Publish sub stream(screen sharing video) to CDN
899
+ * import TRTCCloud, { TRTCPublishMode } from 'trtc-electron-sdk';
900
+ * const trtcCloud = TRTCCloud.getTRTCShareInstance();
901
+ *
902
+ * let cdnTaskId = '';
903
+ * trtcCloud.on('onStartPublishMediaStream', (taskId: string, code: number, message: string) => {
904
+ * if (code === 0) {
905
+ * cdnTaskId = taskId;
906
+ * } else {
907
+ * console.log('startPublishMediaStream error:', code, message);
908
+ * }
909
+ * });
910
+ *
911
+ * trtc.startPublishMediaStream({
912
+ * mode: TRTCPublishMode.TRTCPublishSubStreamToCdn,
913
+ * cdnUrlList: [{
914
+ * rtmpUrl: 'rtmp://<Your RTMP URL>',
915
+ * isInternalLine: true
916
+ * }],
917
+ * mixStreamIdentity: null
918
+ * }, null, null);
919
+ *
920
+ * @example
921
+ * // Publish and mixing multi-user video and audio to CDN
922
+ * import TRTCCloud, { TRTCPublishMode } from 'trtc-electron-sdk';
923
+ * const trtcCloud = TRTCCloud.getTRTCShareInstance();
924
+ *
925
+ * let cdnTaskId = '';
926
+ * trtcCloud.on('onStartPublishMediaStream', (taskId: string, code: number, message: string) => {
927
+ * if (code === 0) {
928
+ * cdnTaskId = taskId;
929
+ * } else {
930
+ * console.log('startPublishMediaStream error:', code, message);
931
+ * }
932
+ * });
933
+ *
934
+ * trtc.startPublishMediaStream(
935
+ * {
936
+ * mode: TRTCPublishMode.TRTCPublishMixStreamToCdn,
937
+ * cdnUrlList: [{
938
+ * rtmpUrl: 'rtmp://<Your RTMP URL>',
939
+ * isInternalLine: true
940
+ * }],
941
+ * mixStreamIdentity: null
942
+ * },
943
+ * {
944
+ * audioEncodedChannelNum: 2,
945
+ * audioEncodedCodecType: 0,
946
+ * audioEncodedKbps: 128,
947
+ * audioEncodedSampleRate: 48000,
948
+ * videoEncodedCodecType: 0,
949
+ * videoEncodedFPS: 30,
950
+ * videoEncodedGOP: 1,
951
+ * videoEncodedWidth: 1280,
952
+ * videoEncodedHeight: 720,
953
+ * videoEncodedKbps: 2000,
954
+ * videoSeiParams: "",
955
+ * },
956
+ * {
957
+ * "backgroundColor": 14362921,
958
+ * "backgroundImage": "",
959
+ * "videoLayoutList": [
960
+ * {
961
+ * "rect": { "top": 0, "left": 0, "right": 960, "bottom": 540 },
962
+ * "zOrder": 1,
963
+ * "fillMode": 0,
964
+ * "backgroundColor": 14483711,
965
+ * "placeHolderImage": "",
966
+ * "fixedVideoUser": { "userId": "windev", "intRoomId": 5055005, "strRoomId": "" },
967
+ * "fixedVideoStreamType": 0
968
+ * },
969
+ * {
970
+ * "rect": { "top": 360, "left": 640, "right": 1280, "bottom": 720 },
971
+ * "zOrder": 2,
972
+ * "fillMode": 0,
973
+ * "backgroundColor": 14480000,
974
+ * "placeHolderImage": "",
975
+ * "fixedVideoUser": { "userId": "macdev", "intRoomId": 5055005, "strRoomId": "" },
976
+ * "fixedVideoStreamType": 0
977
+ * }
978
+ * ],
979
+ * "audioMixUserList": [
980
+ * { "userId": "windev", "intRoomId": 5055005, "strRoomId": "" },
981
+ * { "userId": "macdev", "intRoomId": 5055005, "strRoomId": "" }
982
+ * ],
983
+ * "watermarkList": [
984
+ * {
985
+ * "watermarkUrl": "https://<Your watermark image URL>",
986
+ * "rect": { "top": 540, "left": 0, "right": 320, "bottom": 640 },
987
+ * "zOrder": 3
988
+ * }
989
+ * ]
990
+ * }
991
+ * );
992
+ *
993
+ * @param target {TRTCPublishTarget} - 媒体流发布的目标地址,支持转推/转码到腾讯或者第三方 CDN,也支持转码回推到 TRTC 房间中。
994
+ * @param params {TRTCStreamEncoderParam|null} - 媒体流编码输出参数,转码和回推到 TRTC 房间中时为必填项,您需要指定您预期的转码输出参数。在转推时,为了更好的转推稳定性和 CDN 兼容性,也建议您进行配置。
995
+ * @param config {TRTCStreamMixingConfig|null} - 媒体流转码配置参数,转码和回推到 TRTC 房间中时为必填项,您需要指定您预期的转码配置参数。转推模式下则无效。
996
+ */
997
+ startPublishMediaStream(target: TRTCPublishTarget, params: TRTCStreamEncoderParam | null, config: TRTCStreamMixingConfig | null): void;
998
+ /**
999
+ * 更新发布媒体流
1000
+ *
1001
+ * 该接口会向 TRTC 服务器发送指令,更新通过 [startPublishMediaStream]{@link TRTCCloud#startPublishMediaStream} 启动的媒体流
1002
+ *
1003
+ * 注意:
1004
+ * 1. 您可以通过本接口来更新发布的 CDN URL(支持增删,最多同时 10 个),但您使用时需要注意不要多个任务同时往相同的 URL 地址推送,以免引起异常推流状态。
1005
+ * 2. 您可以通过 taskId 来更新调整转推/转码任务。例如在 pk 业务中,您可以先通过 [startPublishMediaStream]{@link startPublishMediaStream} 发起转推,接着在主播发起 pk 时,通过 taskId 和本接口将转推更新为转码任务。此时,CDN 播放将连续并且不会发生断流(您需要保持媒体流编码输出参数 `param` 一致)。
1006
+ * 3. 同一个任务不支持纯音频、音视频、纯视频之间的切换。
1007
+ *
1008
+ * @example
1009
+ * // Publish and mixing multi-user video and audio to TRTC Room
1010
+ * import TRTCCloud, { TRTCPublishMode } from 'trtc-electron-sdk';
1011
+ * const trtcCloud = TRTCCloud.getTRTCShareInstance();
1012
+ *
1013
+ * let cdnTaskId = '';
1014
+ * trtcCloud.on('onStartPublishMediaStream', (taskId: string, code: number, message: string) => {
1015
+ * if (code === 0) {
1016
+ * cdnTaskId = taskId;
1017
+ * } else {
1018
+ * console.log('startPublishMediaStream error:', code, message);
1019
+ * }
1020
+ * });
1021
+ *
1022
+ * trtc.updatePublishMediaStream(
1023
+ * cdnTaskId,
1024
+ * {
1025
+ * mode: TRTCPublishMode.TRTCPublishMixStreamToRoom,
1026
+ * cdnUrlList: [],
1027
+ * mixStreamIdentity: { // Publish to TRTC Room
1028
+ * "userId": "__robot__",
1029
+ * "intRoomId": 5055005,
1030
+ * "strRoomId": ""
1031
+ * }
1032
+ * },
1033
+ * {
1034
+ * audioEncodedChannelNum: 2,
1035
+ * audioEncodedCodecType: 0,
1036
+ * audioEncodedKbps: 128,
1037
+ * audioEncodedSampleRate: 48000,
1038
+ * videoEncodedCodecType: 0,
1039
+ * videoEncodedFPS: 30,
1040
+ * videoEncodedGOP: 1,
1041
+ * videoEncodedWidth: 1280,
1042
+ * videoEncodedHeight: 720,
1043
+ * videoEncodedKbps: 2000,
1044
+ * videoSeiParams: "",
1045
+ * },
1046
+ * {
1047
+ * "backgroundColor": 14362921,
1048
+ * "backgroundImage": "",
1049
+ * "videoLayoutList": [
1050
+ * {
1051
+ * "rect": { "top": 0, "left": 0, "right": 960, "bottom": 540 },
1052
+ * "zOrder": 1,
1053
+ * "fillMode": 0,
1054
+ * "backgroundColor": 14483711,
1055
+ * "placeHolderImage": "",
1056
+ * "fixedVideoUser": { "userId": "windev", "intRoomId": 5055005, "strRoomId": "" },
1057
+ * "fixedVideoStreamType": 0
1058
+ * },
1059
+ * {
1060
+ * "rect": { "top": 360, "left": 640, "right": 1280, "bottom": 720 },
1061
+ * "zOrder": 2,
1062
+ * "fillMode": 0,
1063
+ * "backgroundColor": 14480000,
1064
+ * "placeHolderImage": "",
1065
+ * "fixedVideoUser": { "userId": "macdev", "intRoomId": 5055005, "strRoomId": "" },
1066
+ * "fixedVideoStreamType": 0
1067
+ * }
1068
+ * ],
1069
+ * "audioMixUserList": [
1070
+ * { "userId": "windev", "intRoomId": 5055005, "strRoomId": "" },
1071
+ * { "userId": "macdev", "intRoomId": 5055005, "strRoomId": "" }
1072
+ * ],
1073
+ * "watermarkList": [
1074
+ * {
1075
+ * "watermarkUrl": "https://<Your watermark image URL>",
1076
+ * "rect": { "top": 540, "left": 0, "right": 320, "bottom": 640 },
1077
+ * "zOrder": 3
1078
+ * }
1079
+ * ]
1080
+ * }
1081
+ * );
1082
+ *
1083
+ * @param taskId {String} - 通过回调 [onStartPublishMediaStream]{@link TRTCCallback#event:onStartPublishMediaStream} 带给您后台启动的任务标识(即 taskId)
1084
+ * @param target {TRTCPublishTarget|null} - 媒体流发布的目标地址,支持转推/转码到腾讯或者第三方 CDN,也支持转码回推到 TRTC 房间中。
1085
+ * @param params {TRTCStreamEncoderParam|null} - 媒体流编码输出参数,转码和回推到 TRTC 房间中时为必填项,您需要指定您预期的转码输出参数。在转推时,为了更好的转推稳定性和 CDN 兼容性,也建议您进行配置。
1086
+ * @param config {TRTCStreamMixingConfig|null} - 媒体流转码配置参数,转码和回推到 TRTC 房间中时为必填项,您需要指定您预期的转码配置参数。转推模式下则无效。
1087
+ */
1088
+ updatePublishMediaStream(taskId: string, target: TRTCPublishTarget | null, params: TRTCStreamEncoderParam | null, config: TRTCStreamMixingConfig | null): void;
1089
+ /**
1090
+ * 停止发布媒体流
1091
+ *
1092
+ * 该接口会向 TRTC 服务器发送指令,停止通过 [startPublishMediaStream]{@link TRTCCloud#startPublishMediaStream} 启动的媒体流
1093
+ *
1094
+ * 注意:
1095
+ * 1. 若您的业务后台并没有保存该 taskId,在您的主播异常退房重进后,如果您需要重新获取 taskId,您可以再次调用 [startPublishMediaStream]{@link TRTCCloud#startPublishMediaStream} 启动任务。此时 TRTC 后台会返回任务启动失败,同时带给您上一次启动的 taskId
1096
+ * 2. 若 taskId 填空字符串,将会停止该用户所有通过 [startPublishMediaStream]{@link TRTCCloud#startPublishMediaStream} 启动的媒体流,如果您只启动了一个媒体流或者想停止所有通过您启动的媒体流,推荐使用这种方式。
1097
+ *
1098
+ * @param taskId {String} - 通过回调 [onStartPublishMediaStream]{@link TRTCCallback#event:onStartPublishMediaStream} 带给您后台启动的任务标识(即 taskId)
1099
+ */
1100
+ stopPublishMediaStream(taskId: string): void;
800
1101
  /**
801
1102
  * 开始向腾讯云的直播 CDN 推流
802
1103
  *
@@ -820,10 +1121,12 @@ declare class TRTCCloud extends EventEmitter {
820
1121
  *
821
1122
  * @param {String} streamId - 自定义流 ID。
822
1123
  * @param {TRTCVideoStreamType} type - 仅支持 TRTCVideoStreamTypeBig 和 TRTCVideoStreamTypeSub。
1124
+ * @deprecated
823
1125
  */
824
1126
  startPublishing(streamId: string, type: TRTCVideoStreamType): void;
825
1127
  /**
826
1128
  * 停止向腾讯云的直播 CDN 推流
1129
+ * @deprecated
827
1130
  */
828
1131
  stopPublishing(): void;
829
1132
  /**
@@ -840,10 +1143,12 @@ declare class TRTCCloud extends EventEmitter {
840
1143
  * @param {Number} param.bizId - 腾讯云直播服务的 bizid
841
1144
  * @param {String} param.url - 指定该路音视频流在第三方直播服务商的推流地址,推流 URL 必须为 RTMP 格式,必须符合您的目标直播服务商的规范要求,否则目标服务商会拒绝来自 TRTC 后台服务的推流请求。
842
1145
  * @param {String} param.streamId - 需要转推的 streamId,默认值:空值。如果不填写,则默认转推调用者的旁路流。
1146
+ * @deprecated
843
1147
  */
844
1148
  startPublishCDNStream(param: any): void;
845
1149
  /**
846
1150
  * 停止向非腾讯云的直播 CDN 推流
1151
+ * @deprecated
847
1152
  */
848
1153
  stopPublishCDNStream(): void;
849
1154
  /**
@@ -912,8 +1217,9 @@ declare class TRTCCloud extends EventEmitter {
912
1217
  * @param {Number} config.mixUsersArray[].renderMode - 该画面在输出时的显示模式。视频流默认为0。0为裁剪,1为缩放,2为缩放并显示黑底。
913
1218
  * @param {Number} config.mixUsersArray[].soundLevel - 该路音频参与混音时的音量等级(取值范围:0 - 100),默认值:100。
914
1219
  * @param {String} config.mixUsersArray[].image - 占位图是指当对应 userId 混流内容为纯音频时,混合后的画面中显示的是占位图片。水印图是指一张贴在混合后画面中的半透明图片,这张图片会一直覆盖于混合后的画面上。当指定 inputType 为 TRTCMixInputTypePureAudio 时,image 为占位图,此时需要您指定 userId。当指定 inputType 为 TRTCMixInputTypeWatermark 时,image 为水印图,此时不需要您指定 userId。
1220
+ * @deprecated
915
1221
  */
916
- setMixTranscodingConfig(config: any): void;
1222
+ setMixTranscodingConfig(config: Record<string, any>): void;
917
1223
  private _startLocalPreview;
918
1224
  /**
919
1225
  * 启动本地摄像头采集和预览
@@ -2606,25 +2912,29 @@ declare class TRTCCloud extends EventEmitter {
2606
2912
  private _setRemoteVideoBuffer;
2607
2913
  /**
2608
2914
  * 获取设备管理器
2609
- *
2915
+ * @private
2610
2916
  * @returns {TRTCDeviceManager}
2611
2917
  */
2612
2918
  private getDeviceManager;
2613
2919
  /**
2614
2920
  * 获取音效管理器
2615
- *
2921
+ * @private
2616
2922
  * @returns {TRTCAudioEffectManager}
2617
2923
  */
2618
2924
  private getAudioEffectManager;
2619
2925
  /**
2620
2926
  * 获取本地混流管理器
2621
2927
  *
2928
+ * 注意:<br/>
2929
+ * 1.目前仅支持 ``Windows`` 操作系统。<br/>
2930
+ * 2.本地混流管理器必须在 [getTRTCShareInstance]{@link TRTCCloud#getTRTCShareInstance} 创建 TRTCCloud 实例时传入 `isIPCMode` 为 `true` 才支持,否则返回 null。
2931
+ *
2622
2932
  * @returns {TRTCMediaMixingManager | null}
2623
2933
  */
2624
2934
  getMediaMixingManager(): TRTCMediaMixingManager | null;
2625
2935
  /**
2626
2936
  * 获取插件管理器
2627
- *
2937
+ * @private
2628
2938
  * @returns {TRTCPluginManager}
2629
2939
  */
2630
2940
  private getPluginManager;