trtc-sdk-v5 5.0.0 → 5.0.2-beta.1
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/README.md +2 -2
- package/index.d.ts +12 -11
- package/package.json +1 -1
- package/trtc.esm.js +33 -33
- package/trtc.js +1 -1
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@ An object-oriented WebRTC SDK library
|
|
|
14
14
|
|
|
15
15
|
</div>
|
|
16
16
|
|
|
17
|
-
English | [简体中文](https://github.com/LiteAVSDK/TRTC_Web/blob/main/SDK/README-zh_CN.md)
|
|
17
|
+
English | [简体中文](https://github.com/LiteAVSDK/TRTC_Web/blob/main/v5/SDK/README-zh_CN.md)
|
|
18
18
|
|
|
19
19
|
## Introduction
|
|
20
20
|
|
|
@@ -67,7 +67,7 @@ Explore SDK documents:[TRTC Web SDK](https://web.sdk.qcloud.com/trtc/webrtc/v5
|
|
|
67
67
|
- Turn off camera [trtc.stopLocalVideo](https://web.sdk.qcloud.com/trtc/webrtc/v5/doc/en/TRTC.html#stopLocalVideo)
|
|
68
68
|
- Turn off microphone [trtc.stopLocalAudio](https://web.sdk.qcloud.com/trtc/webrtc/v5/doc/en/TRTC.html#stopLocalAudio)
|
|
69
69
|
- Play remote video [trtc.startRemoteVideo](https://web.sdk.qcloud.com/trtc/webrtc/v5/doc/en/TRTC.html#startRemoteVideo)
|
|
70
|
-
- Stop playing
|
|
70
|
+
- Stop playing remote video [trtc.stopRemoteVideo](https://web.sdk.qcloud.com/trtc/webrtc/v5/doc/en/TRTC.html#stopRemoteVideo)
|
|
71
71
|
- Mute/unmute remote audio [trtc.muteRemoteAudio](https://web.sdk.qcloud.com/trtc/webrtc/v5/doc/en/TRTC.html#muteRemoteAudio)
|
|
72
72
|
|
|
73
73
|
## Directory
|
package/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference path="./core.d.ts" />
|
|
2
2
|
|
|
3
3
|
declare interface LocalVideoConfig {
|
|
4
|
-
view
|
|
4
|
+
view?: string | HTMLElement | HTMLElement[] | null;
|
|
5
5
|
publish?: boolean;
|
|
6
6
|
option?: {
|
|
7
7
|
cameraId?: string;
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
userDefineRecordId?: string;
|
|
42
42
|
}
|
|
43
43
|
declare interface ScreenShareConfig {
|
|
44
|
-
view?: string | HTMLElement | null;
|
|
44
|
+
view?: string | HTMLElement | HTMLElement[] | null;
|
|
45
45
|
publish?: boolean;
|
|
46
46
|
option?: {
|
|
47
47
|
profile?: keyof typeof screenProfileMap | VideoProfile;
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
64
|
declare interface RemoteVideoConfig {
|
|
65
|
-
view
|
|
65
|
+
view?: string | HTMLElement | HTMLElement[] | null;
|
|
66
66
|
userId: string;
|
|
67
67
|
streamType: TRTCStreamType;
|
|
68
68
|
option?: {
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
};
|
|
73
73
|
}
|
|
74
74
|
declare interface UpdateRemoteVideoConfig extends Omit<RemoteVideoConfig, 'view'> {
|
|
75
|
-
view?: string | HTMLElement | null;
|
|
75
|
+
view?: string | HTMLElement | HTMLElement[] | null;
|
|
76
76
|
}
|
|
77
77
|
declare interface StopRemoteVideoConfig {
|
|
78
78
|
userId: string;
|
|
@@ -738,7 +738,8 @@
|
|
|
738
738
|
* @param {string=} options.userDefineRecordId 用于设置云端录制的 userDefineRecordId(选填)。
|
|
739
739
|
* - 【推荐取值】限制长度为64字节,只允许包含大小写英文字母(a-zA-Z)、数字(0-9)及下划线和连词符。
|
|
740
740
|
* - 【参考文档】[云端录制](https://cloud.tencent.com/document/product/647/16823)。
|
|
741
|
-
* @param {string|ProxyServer} [options.proxy]
|
|
741
|
+
* @param {string|ProxyServer} [options.proxy] 设置代理服务器。参考最佳实践:{@tutorial 34-advanced-proxy}。
|
|
742
|
+
* @param {boolean} [options.privateMapKey] 进房钥匙,若需要权限控制请携带该参数(传空或传错会导致进房失败)。<br>[privateMapKey 权限设置](https://cloud.tencent.com/document/product/647/32240)
|
|
742
743
|
* @throws
|
|
743
744
|
* - {@link module:ERROR_CODE.INVALID_PARAMETER INVALID_PARAMETER}
|
|
744
745
|
* - {@link module:ERROR_CODE.OPERATION_FAILED OPERATION_FAILED}
|
|
@@ -920,7 +921,7 @@
|
|
|
920
921
|
* - 一个 trtc 实例只能开启一路摄像头。若您需要在已经开启一路摄像头的情况下,再开启一路摄像头用于测试,可以创建多个 trtc 实例实现。
|
|
921
922
|
*
|
|
922
923
|
* @param {object} [config]
|
|
923
|
-
* @param {string | HTMLElement | null} [config.view] - 本地视频预览的 HTMLElement 实例或者 Id, 如果不传或传入 null, 则不会播放视频。
|
|
924
|
+
* @param {string | HTMLElement | HTMLElement[] | null} [config.view] - 本地视频预览的 HTMLElement 实例或者 Id, 如果不传或传入 null, 则不会播放视频。
|
|
924
925
|
* @param {boolean} [config.publish] - 是否将本地视频发布到房间中。默认为 true,若在进房前调用该接口,SDK 会在进房成功后自动发布(若 publish=true)。
|
|
925
926
|
* @param {object} [config.option] - 本地视频配置
|
|
926
927
|
* @param {string} [config.option.cameraId] - 指定使用哪个摄像头,用于切换摄像头。
|
|
@@ -972,7 +973,7 @@
|
|
|
972
973
|
* - 该接口可以多次调用。
|
|
973
974
|
* - 本方法采用增量更新方式:只更新传入的参数,不传入的参数保持不变。
|
|
974
975
|
* @param {object} [config]
|
|
975
|
-
* @param {string | HTMLElement | null} [config.view] - 预览摄像头的 HTMLElement 实例或者 Id, 如果不传或传入null, 则不会渲染视频, 但会仍然会推流消耗带宽的容器
|
|
976
|
+
* @param {string | HTMLElement | HTMLElement[] | null} [config.view] - 预览摄像头的 HTMLElement 实例或者 Id, 如果不传或传入null, 则不会渲染视频, 但会仍然会推流消耗带宽的容器
|
|
976
977
|
* @param {boolean} [config.publish] - 是否将本地视频发布到房间中。默认为 true,若在进房前调用该接口,SDK 会在进房成功后自动发布。
|
|
977
978
|
* @param {boolean} [config.mute] - 是否暂停摄像头采集,参考:[开关麦克风、摄像头](./tutorial-15-basic-dynamic-add-video.html)
|
|
978
979
|
* @param {object} [config.option] - 本地视频配置
|
|
@@ -1040,7 +1041,7 @@
|
|
|
1040
1041
|
*
|
|
1041
1042
|
* - 开启屏幕分享后,房间内其他用户会收到 {@link module:EVENT.REMOTE_VIDEO_AVAILABLE REMOTE_VIDEO_AVAILABLE} 事件,streamType 为 {@link module:TYPE.STREAM_TYPE_SUB STREAM_TYPE_SUB},其他用户可以通过 {@link TRTC#startRemoteVideo startRemoteVideo} 播放屏幕分享。
|
|
1042
1043
|
* @param {object} [config]
|
|
1043
|
-
* @param {string | HTMLElement | null} [config.view] - 预览本地屏幕分享的 HTMLElement 实例或 Id, 如果不传或传入 null, 则不会渲染本地屏幕分享。
|
|
1044
|
+
* @param {string | HTMLElement | HTMLElement[] | null} [config.view] - 预览本地屏幕分享的 HTMLElement 实例或 Id, 如果不传或传入 null, 则不会渲染本地屏幕分享。
|
|
1044
1045
|
* @param {boolean} [config.publish] - 是否将屏幕分享发布到房间中。默认为 true,若在进房前调用该接口,SDK 会在进房成功后自动发布。
|
|
1045
1046
|
* @param {object} [config.option] - 屏幕分享配置
|
|
1046
1047
|
* @param {boolean} [config.option.systemAudio] - 是否采集系统声音,默认为 false。
|
|
@@ -1066,7 +1067,7 @@
|
|
|
1066
1067
|
* - 该接口可以多次调用。
|
|
1067
1068
|
* - 本方法采用增量更新方式:只更新传入的参数,不传入的参数保持不变。
|
|
1068
1069
|
* @param {object} [config]
|
|
1069
|
-
* @param {string | HTMLElement | null} [config.view] - 屏幕分享预览的 HTMLElement 实例或 Id, 如果不传或传入 null, 则不会渲染屏幕分享。
|
|
1070
|
+
* @param {string | HTMLElement | HTMLElement[] | null} [config.view] - 屏幕分享预览的 HTMLElement 实例或 Id, 如果不传或传入 null, 则不会渲染屏幕分享。
|
|
1070
1071
|
* @param {boolean} [config.publish] - 是否将屏幕分享发布到房间中
|
|
1071
1072
|
* @param {object} [config.option] - 屏幕分享配置
|
|
1072
1073
|
* @param {'contain' | 'cover' | 'fill'} [config.option.fillMode] - 视频填充模式。默认为 `contain`,参考 {@link https://developer.mozilla.org/zh-CN/docs/Web/CSS/object-fit CSS object-fit} 属性。
|
|
@@ -1099,7 +1100,7 @@
|
|
|
1099
1100
|
*
|
|
1100
1101
|
* - 调用时机:在收到 {@link module:EVENT.REMOTE_VIDEO_AVAILABLE TRTC.on(TRTC.EVENT.REMOTE_VIDEO_AVAILABLE)} 事件后调用。
|
|
1101
1102
|
* @param {object} [config]
|
|
1102
|
-
* @param {string | HTMLElement | null} [config.view] - 用于播放远端视频的 HTMLElement 实例或者 Id, 如果不传或传入null, 则不会渲染视频, 但会仍然会拉流消耗带宽
|
|
1103
|
+
* @param {string | HTMLElement | HTMLElement[] | null} [config.view] - 用于播放远端视频的 HTMLElement 实例或者 Id, 如果不传或传入null, 则不会渲染视频, 但会仍然会拉流消耗带宽
|
|
1103
1104
|
* @param {string} config.userId - 远端用户Id
|
|
1104
1105
|
* @param {TRTC.TYPE.STREAM_TYPE_MAIN|TRTC.TYPE.STREAM_TYPE_SUB} config.streamType - 远端流类型
|
|
1105
1106
|
* - {@link module:TYPE.STREAM_TYPE_MAIN TRTC.TYPE.STREAM_TYPE_MAIN}: 主流(远端用户的摄像头)(远端用户的摄像头)
|
|
@@ -1128,7 +1129,7 @@
|
|
|
1128
1129
|
* - 该方法可多次调用。
|
|
1129
1130
|
* - 该方法采用增量更新的方式,只需要传入需要更新的配置项即可。
|
|
1130
1131
|
* @param {object} [config]
|
|
1131
|
-
* @param {string | HTMLElement | null} [config.view] - 用于播放远端视频的 HTMLElement 实例或者 Id, 如果不传或传入null, 则不会渲染视频, 但会仍然会拉流消耗带宽
|
|
1132
|
+
* @param {string | HTMLElement | HTMLElement[] | null} [config.view] - 用于播放远端视频的 HTMLElement 实例或者 Id, 如果不传或传入null, 则不会渲染视频, 但会仍然会拉流消耗带宽
|
|
1132
1133
|
* @param {string} config.userId - 远端用户Id
|
|
1133
1134
|
* @param {TRTC.TYPE.STREAM_TYPE_MAIN|TRTC.TYPE.STREAM_TYPE_SUB} config.streamType - 远端流类型:
|
|
1134
1135
|
* - {@link module:TYPE.STREAM_TYPE_MAIN TRTC.TYPE.STREAM_TYPE_MAIN}: 主流(远端用户的摄像头)
|