trtc-sdk-v5 5.2.0-beta.2 → 5.2.0-beta.8
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/index.d.ts +16 -15
- package/package.json +1 -1
- package/trtc.esm.js +17 -17
- package/trtc.js +1 -1
package/index.d.ts
CHANGED
|
@@ -871,10 +871,10 @@
|
|
|
871
871
|
* - 一个 trtc 实例只能开启一路麦克风,若您需要在已经开启一路麦克风的情况下,再开启一路麦克风用于测试,可以创建多个 trtc 实例实现。
|
|
872
872
|
*
|
|
873
873
|
* @param {object} [config] - 配置项
|
|
874
|
-
* @param {boolean} [config.publish] - 是否将本地音频发布到房间中,默认为true。若在进房前调用该接口,并且 publish = true,则在进房后 SDK
|
|
874
|
+
* @param {boolean} [config.publish] - 是否将本地音频发布到房间中,默认为true。若在进房前调用该接口,并且 publish = true,则在进房后 SDK 会自动发布。可监听该事件获取推流状态 {@link module:EVENT.PUBLISH_STATE_CHANGED PUBLISH_STATE_CHANGED}。
|
|
875
875
|
* @param {object} [config.option] - 本地音频选项
|
|
876
876
|
* @param {string} [config.option.microphoneId]- 指定使用哪个麦克风
|
|
877
|
-
* @param {MediaStreamTrack} [config.option.audioTrack] - 自定义采集的 audioTrack
|
|
877
|
+
* @param {MediaStreamTrack} [config.option.audioTrack] - 自定义采集的 audioTrack。{@tutorial 20-advanced-customized-capture-rendering}。
|
|
878
878
|
* @param {number} [config.option.earMonitorVolume] - 设置耳返音量,取值[0, 100],本地麦克风默认静音播放。
|
|
879
879
|
* @param {string} [config.option.profile] - 音频编码配置, 默认{@link module:TYPE.AUDIO_PROFILE_STANDARD TRTC.TYPE.AUDIO_PROFILE_STANDARD}
|
|
880
880
|
* @throws
|
|
@@ -903,11 +903,11 @@
|
|
|
903
903
|
* - 调用时机:该接口需在 {@link TRTC#startLocalAudio startLocalAudio()} 成功后调用,可以多次调用。
|
|
904
904
|
* - 本方法采用增量更新方式:只更新传入的参数,不传入的参数保持不变。
|
|
905
905
|
* @param {object} [config]
|
|
906
|
-
* @param {boolean} [config.publish] - 是否将本地音频发布到房间中,默认为 true
|
|
907
|
-
* @param {boolean} [config.mute] - 静音麦克风。参考:
|
|
906
|
+
* @param {boolean} [config.publish] - 是否将本地音频发布到房间中,默认为 true。可监听该事件获取推流状态 {@link module:EVENT.PUBLISH_STATE_CHANGED PUBLISH_STATE_CHANGED}。
|
|
907
|
+
* @param {boolean} [config.mute] - 静音麦克风。参考:{@tutorial 15-basic-dynamic-add-video}。
|
|
908
908
|
* @param {object} [config.option] - 本地音频配置
|
|
909
909
|
* @param {string} [config.option.microphoneId] - 指定使用哪个麦克风,用来切换麦克风。
|
|
910
|
-
* @param {MediaStreamTrack} [config.option.
|
|
910
|
+
* @param {MediaStreamTrack} [config.option.audioTrack] - 自定义采集的 audioTrack。 {@tutorial 20-advanced-customized-capture-rendering}。
|
|
911
911
|
* @throws
|
|
912
912
|
* - {@link module:ERROR_CODE.INVALID_PARAMETER INVALID_PARAMETER}
|
|
913
913
|
* - {@link module:ERROR_CODE.DEVICE_ERROR DEVICE_ERROR}
|
|
@@ -924,7 +924,7 @@
|
|
|
924
924
|
updateLocalAudio(config: UpdateLocalAudioConfig): Promise<void>;
|
|
925
925
|
/**
|
|
926
926
|
* 停止本地麦克风的采集及发布。
|
|
927
|
-
* - 如果您只是想静音麦克风,请使用 updateLocalAudio({ mute: true })。参考:
|
|
927
|
+
* - 如果您只是想静音麦克风,请使用 updateLocalAudio({ mute: true })。参考:{@tutorial 15-basic-dynamic-add-video}。
|
|
928
928
|
* @throws {@link module:ERROR_CODE.OPERATION_ABORT OPERATION_ABORT}
|
|
929
929
|
* @example
|
|
930
930
|
* await trtc.stopLocalAudio();
|
|
@@ -981,11 +981,11 @@
|
|
|
981
981
|
*
|
|
982
982
|
* @param {object} [config]
|
|
983
983
|
* @param {string | HTMLElement | HTMLElement[] | null} [config.view] - 本地视频预览的 HTMLElement 实例或者 Id, 如果不传或传入 null, 则不会播放视频。
|
|
984
|
-
* @param {boolean} [config.publish] - 是否将本地视频发布到房间中。默认为 true,若在进房前调用该接口,SDK 会在进房成功后自动发布(若 publish=true
|
|
984
|
+
* @param {boolean} [config.publish] - 是否将本地视频发布到房间中。默认为 true,若在进房前调用该接口,SDK 会在进房成功后自动发布(若 publish=true)。可监听该事件获取推流状态 {@link module:EVENT.PUBLISH_STATE_CHANGED PUBLISH_STATE_CHANGED}。
|
|
985
985
|
* @param {object} [config.option] - 本地视频配置
|
|
986
986
|
* @param {string} [config.option.cameraId] - 指定使用哪个摄像头,用于切换摄像头。
|
|
987
987
|
* @param {boolean} [config.option.useFrontCamera] - 是否使用前置摄像头
|
|
988
|
-
* @param {MediaStreamTrack} [config.option.videoTrack] - 自定义采集的 videoTrack
|
|
988
|
+
* @param {MediaStreamTrack} [config.option.videoTrack] - 自定义采集的 videoTrack。{@tutorial 20-advanced-customized-capture-rendering}。
|
|
989
989
|
* @param {boolean} [config.option.mirror] - 是否开启本地预览镜像,默认为 true。
|
|
990
990
|
* @param {'contain' | 'cover' | 'fill'} [config.option.fillMode] - 视频填充模式。默认为 `cover`。参考 {@link https://developer.mozilla.org/zh-CN/docs/Web/CSS/object-fit CSS object-fit} 属性。
|
|
991
991
|
* @param {VideoProfile} [config.option.profile] - 视频大流编码参数。
|
|
@@ -1033,12 +1033,12 @@
|
|
|
1033
1033
|
* - 本方法采用增量更新方式:只更新传入的参数,不传入的参数保持不变。
|
|
1034
1034
|
* @param {object} [config]
|
|
1035
1035
|
* @param {string | HTMLElement | HTMLElement[] | null} [config.view] - 预览摄像头的 HTMLElement 实例或者 Id, 如果不传或传入null, 则不会渲染视频, 但会仍然会推流消耗带宽的容器
|
|
1036
|
-
* @param {boolean} [config.publish] -
|
|
1037
|
-
* @param {boolean} [config.mute] - 是否暂停摄像头采集,参考:
|
|
1036
|
+
* @param {boolean} [config.publish] - 是否将本地视频发布到房间中。可监听该事件获取推流状态 {@link module:EVENT.PUBLISH_STATE_CHANGED PUBLISH_STATE_CHANGED}。
|
|
1037
|
+
* @param {boolean} [config.mute] - 是否暂停摄像头采集,参考:{@tutorial 15-basic-dynamic-add-video}。
|
|
1038
1038
|
* @param {object} [config.option] - 本地视频配置
|
|
1039
1039
|
* @param {string} [config.option.cameraId] - 指定使用哪个摄像头,
|
|
1040
1040
|
* @param {boolean} [config.option.useFrontCamera] - 是否使用前置摄像头
|
|
1041
|
-
* @param {MediaStreamTrack} [config.option.videoTrack] - 自定义采集的 videoTrack
|
|
1041
|
+
* @param {MediaStreamTrack} [config.option.videoTrack] - 自定义采集的 videoTrack,{@tutorial 20-advanced-customized-capture-rendering}。
|
|
1042
1042
|
* @param {boolean} [config.option.mirror] - 是否开启镜像
|
|
1043
1043
|
* @param {'contain' | 'cover' | 'fill'} [config.option.fillMode] - 视频填充模式。参考 {@link https://developer.mozilla.org/zh-CN/docs/Web/CSS/object-fit| CSS object-fit} 属性
|
|
1044
1044
|
* @param {VideoProfile} [config.option.profile] - 视频大流编码参数
|
|
@@ -1101,12 +1101,13 @@
|
|
|
1101
1101
|
* - 开启屏幕分享后,房间内其他用户会收到 {@link module:EVENT.REMOTE_VIDEO_AVAILABLE REMOTE_VIDEO_AVAILABLE} 事件,streamType 为 {@link module:TYPE.STREAM_TYPE_SUB STREAM_TYPE_SUB},其他用户可以通过 {@link TRTC#startRemoteVideo startRemoteVideo} 播放屏幕分享。
|
|
1102
1102
|
* @param {object} [config]
|
|
1103
1103
|
* @param {string | HTMLElement | HTMLElement[] | null} [config.view] - 预览本地屏幕分享的 HTMLElement 实例或 Id, 如果不传或传入 null, 则不会渲染本地屏幕分享。
|
|
1104
|
-
* @param {boolean} [config.publish] - 是否将屏幕分享发布到房间中。默认为 true,若在进房前调用该接口,SDK
|
|
1104
|
+
* @param {boolean} [config.publish] - 是否将屏幕分享发布到房间中。默认为 true,若在进房前调用该接口,SDK 会在进房成功后自动发布。可监听该事件获取推流状态 {@link module:EVENT.PUBLISH_STATE_CHANGED PUBLISH_STATE_CHANGED}。
|
|
1105
1105
|
* @param {object} [config.option] - 屏幕分享配置
|
|
1106
1106
|
* @param {boolean} [config.option.systemAudio] - 是否采集系统声音,默认为 false。
|
|
1107
1107
|
* @param {'contain' | 'cover' | 'fill'} [config.option.fillMode] - 视频填充模式。默认为 `contain`,参考 {@link https://developer.mozilla.org/zh-CN/docs/Web/CSS/object-fit CSS object-fit} 属性。
|
|
1108
1108
|
* @param {ScreenShareProfile} [config.option.profile] - 屏幕分享编码配置。
|
|
1109
1109
|
* @param {QOS_PREFERENCE_SMOOTH|QOS_PREFERENCE_CLEAR} [config.option.qosPreference] - 设置弱网时,视频编码策略。流畅度优先({@link module:TYPE.QOS_PREFERENCE_SMOOTH QOS_PREFERENCE_SMOOTH})或 (默认)清晰度优先({@link module:TYPE.QOS_PREFERENCE_CLEAR QOS_PREFERENCE_CLEAR})
|
|
1110
|
+
* @param {MediaStreamTrack} [config.option.videoTrack] - 自定义采集的 videoTrack。{@tutorial 20-advanced-customized-capture-rendering}。
|
|
1110
1111
|
* @throws
|
|
1111
1112
|
* - {@link module:ERROR_CODE.ENV_NOT_SUPPORTED ENV_NOT_SUPPORTED}
|
|
1112
1113
|
* - {@link module:ERROR_CODE.INVALID_PARAMETER INVALID_PARAMETER}
|
|
@@ -1127,7 +1128,7 @@
|
|
|
1127
1128
|
* - 本方法采用增量更新方式:只更新传入的参数,不传入的参数保持不变。
|
|
1128
1129
|
* @param {object} [config]
|
|
1129
1130
|
* @param {string | HTMLElement | HTMLElement[] | null} [config.view] - 屏幕分享预览的 HTMLElement 实例或 Id, 如果不传或传入 null, 则不会渲染屏幕分享。
|
|
1130
|
-
* @param {boolean} [config.publish] -
|
|
1131
|
+
* @param {boolean} [config.publish] - 是否将屏幕分享发布到房间中。可监听该事件获取推流状态 {@link module:EVENT.PUBLISH_STATE_CHANGED PUBLISH_STATE_CHANGED}。
|
|
1131
1132
|
* @param {object} [config.option] - 屏幕分享配置
|
|
1132
1133
|
* @param {'contain' | 'cover' | 'fill'} [config.option.fillMode] - 视频填充模式。默认为 `contain`,参考 {@link https://developer.mozilla.org/zh-CN/docs/Web/CSS/object-fit CSS object-fit} 属性。
|
|
1133
1134
|
* @param {QOS_PREFERENCE_SMOOTH|QOS_PREFERENCE_CLEAR} [config.option.qosPreference] - 设置弱网时,视频编码策略。流畅度优先({@link module:TYPE.QOS_PREFERENCE_SMOOTH QOS_PREFERENCE_SMOOTH})或 (默认)清晰度优先({@link module:TYPE.QOS_PREFERENCE_CLEAR QOS_PREFERENCE_CLEAR})
|
|
@@ -1190,7 +1191,7 @@
|
|
|
1190
1191
|
* - {@link module:TYPE.STREAM_TYPE_MAIN TRTC.TYPE.STREAM_TYPE_MAIN}: 主流(远端用户的摄像头)
|
|
1191
1192
|
* - {@link module:TYPE.STREAM_TYPE_SUB TRTC.TYPE.STREAM_TYPE_SUB}: 辅流(远端用户的屏幕分享)
|
|
1192
1193
|
* @param {object} [config.option] - 远端视频配置
|
|
1193
|
-
* @param {boolean} [config.option.small] - 是否拉小流,参考:
|
|
1194
|
+
* @param {boolean} [config.option.small] - 是否拉小流,参考:{@tutorial 27-advanced-small-stream}
|
|
1194
1195
|
* @param {boolean} [config.option.mirror] - 是否开启镜像
|
|
1195
1196
|
* @param {'contain' | 'cover' | 'fill'} [config.option.fillMode] - 视频填充模式。参考 {@link https://developer.mozilla.org/zh-CN/docs/Web/CSS/object-fit CSS object-fit} 属性。
|
|
1196
1197
|
* @throws
|
|
@@ -1449,7 +1450,7 @@
|
|
|
1449
1450
|
/**
|
|
1450
1451
|
* 检测 TRTC Web SDK 是否支持当前浏览器
|
|
1451
1452
|
*
|
|
1452
|
-
* - 参考:
|
|
1453
|
+
* - 参考:{@tutorial 05-info-browser}。
|
|
1453
1454
|
* @example
|
|
1454
1455
|
* TRTC.isSupported().then((checkResult) => {
|
|
1455
1456
|
* if(!checkResult.result) {
|