trtc-sdk-v5 5.0.2-beta.2 → 5.0.3
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 +32 -27
- package/package.json +1 -1
- package/trtc.esm.js +39 -37
- package/trtc.js +1 -1
package/index.d.ts
CHANGED
|
@@ -309,7 +309,12 @@
|
|
|
309
309
|
*/
|
|
310
310
|
readonly AUTOPLAY_FAILED: "autoplay-failed";
|
|
311
311
|
/**
|
|
312
|
-
*
|
|
312
|
+
* 被踢出房间,原因如下:<br/>
|
|
313
|
+
* - kick: 相同 userId 的用户同时进入同一个房间(以下简称为同名进房),先进入房间的用户会被后进入的用户踢出房间。<br>
|
|
314
|
+
* - 同名进房是不允许的行为,可能会导致双方音视频通话异常,业务侧应避免出现这种情况。
|
|
315
|
+
* - TRTC 后台不保证观众角色同名进房互踢。即观众角色的用户,使用同 userId 进同一个房间,可能不会收到该事件。
|
|
316
|
+
* - banned: 系统管理员通过{@link https://cloud.tencent.com/document/product/647/40496 服务端 API} 将该用户踢出房间。
|
|
317
|
+
* - room-disband: 系统管理员通过{@link https://cloud.tencent.com/document/product/647/40496 服务端 API} 解散房间。
|
|
313
318
|
* @default 'kicked-out'
|
|
314
319
|
* @memberof module:EVENT
|
|
315
320
|
* @example
|
|
@@ -600,6 +605,17 @@
|
|
|
600
605
|
* });
|
|
601
606
|
*/
|
|
602
607
|
readonly PUBLISH_STATE_CHANGED: "publish-state-changed";
|
|
608
|
+
/**
|
|
609
|
+
* @private
|
|
610
|
+
* @description 收到 SEI message<br>
|
|
611
|
+
* @default 'sei-message'
|
|
612
|
+
* @memberof module:EVENT
|
|
613
|
+
* @example
|
|
614
|
+
* trtc.on(TRTC.EVENT.SEI_MESSAGE, event => {
|
|
615
|
+
* console.log(`收到 ${event.userId} 的 sei message: ${event.data}`)
|
|
616
|
+
* })
|
|
617
|
+
*/
|
|
618
|
+
readonly SEI_MESSAGE: "sei-message";
|
|
603
619
|
};
|
|
604
620
|
declare interface TRTCEventTypes {
|
|
605
621
|
[TRTCEvent.ERROR]: [RtcError];
|
|
@@ -664,8 +680,17 @@
|
|
|
664
680
|
error?: RtcError;
|
|
665
681
|
}
|
|
666
682
|
];
|
|
683
|
+
[TRTCEvent.SEI_MESSAGE]: [{
|
|
684
|
+
data: Uint8Array;
|
|
685
|
+
userId: string;
|
|
686
|
+
}];
|
|
667
687
|
}
|
|
668
|
-
|
|
688
|
+
|
|
689
|
+
interface TRTCOptions {
|
|
690
|
+
plugins?: Array<{
|
|
691
|
+
new (core: Core): IPlugin;
|
|
692
|
+
}>;
|
|
693
|
+
} class TRTC extends EventEmitter<TRTCEventTypes> {
|
|
669
694
|
/**
|
|
670
695
|
* 创建一个 TRTC 对象,用于实现进房、预览、推流、拉流等功能。<br>
|
|
671
696
|
*
|
|
@@ -677,7 +702,7 @@
|
|
|
677
702
|
*
|
|
678
703
|
* @returns {TRTC} trtc对象
|
|
679
704
|
*/
|
|
680
|
-
static create(): TRTC;
|
|
705
|
+
static create(options?: TRTCOptions): TRTC;
|
|
681
706
|
/**
|
|
682
707
|
* @typedef TurnServer
|
|
683
708
|
* @property {string} url TURN 服务器 url
|
|
@@ -1088,30 +1113,9 @@
|
|
|
1088
1113
|
* await trtc.stopScreenShare();
|
|
1089
1114
|
* */
|
|
1090
1115
|
stopScreenShare(): Promise<void>;
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
* - {@link module:ERROR_CODE.INVALID_PARAMETER INVALID_PARAMETER}
|
|
1095
|
-
* - {@link module:ERROR_CODE.OPERATION_FAILED OPERATION_FAILED}
|
|
1096
|
-
*
|
|
1097
|
-
* */
|
|
1098
|
-
startPlugin(name: PLUGIN_NAME, options: AudioSourceOptions | DenoiserOptions): Promise<void>;
|
|
1099
|
-
/**
|
|
1100
|
-
* 用于使用插件能力,详情见文档。
|
|
1101
|
-
* @throws
|
|
1102
|
-
* - {@link module:ERROR_CODE.INVALID_PARAMETER INVALID_PARAMETER}
|
|
1103
|
-
* - {@link module:ERROR_CODE.OPERATION_FAILED OPERATION_FAILED}
|
|
1104
|
-
*
|
|
1105
|
-
* */
|
|
1106
|
-
updatePlugin(name: PLUGIN_NAME, options: UpdateAudioSourceOptions): Promise<void>;
|
|
1107
|
-
/**
|
|
1108
|
-
* 用于使用插件能力,详情见文档。
|
|
1109
|
-
* @throws
|
|
1110
|
-
* - {@link module:ERROR_CODE.INVALID_PARAMETER INVALID_PARAMETER}
|
|
1111
|
-
* - {@link module:ERROR_CODE.OPERATION_FAILED OPERATION_FAILED}
|
|
1112
|
-
*
|
|
1113
|
-
* */
|
|
1114
|
-
stopPlugin(name: PLUGIN_NAME, options?: UpdateAudioSourceOptions): Promise<void>;
|
|
1116
|
+
startPlugin(plugin: PLUGIN_NAME, options: any): Promise<void>;
|
|
1117
|
+
updatePlugin(plugin: PLUGIN_NAME, options: any): Promise<void>;
|
|
1118
|
+
stopPlugin(plugin: PLUGIN_NAME, options: any): Promise<void>;
|
|
1115
1119
|
/**
|
|
1116
1120
|
* 播放远端视频
|
|
1117
1121
|
*
|
|
@@ -1323,6 +1327,7 @@
|
|
|
1323
1327
|
readonly SCREEN_SHARE_STOPPED: "screen-share-stopped";
|
|
1324
1328
|
readonly DEVICE_CHANGED: "device-changed";
|
|
1325
1329
|
readonly PUBLISH_STATE_CHANGED: "publish-state-changed";
|
|
1330
|
+
readonly SEI_MESSAGE: "sei-message";
|
|
1326
1331
|
};
|
|
1327
1332
|
static ERROR_CODE: {
|
|
1328
1333
|
INVALID_PARAMETER: number;
|