@@ -9,9 +9,10 @@ import { CustomEncryption, EncryptionOptions } from './plugins/custom-encryption
99import { VideoMixerOptions , UpdateVideoMixerOptions , VideoMixer } from './plugins/video-effect/video-mixer' ;
1010import { SmallStreamAutoSwitcher , SmallStreamAutoSwitcherOptions } from './plugins/small-stream-auto-switcher' ;
1111import { Chorus , StartChorusOption , UpdateChorusOption } from './plugins/chorus' ;
12+ import { LEBPlayer , StartLEBPlayerOption , UpdateLEBPlayerOption } from './plugins/lebplayer' ;
1213
1314export { CDNStreamingOptions , DeviceDetectorOptions , VirtualBackgroundOptions , UpdateVirtualBackgroundOptions , WatermarkOptions , BeautyOptions , UpdateBeautyOptions , BasicBeautyOptions , StartCrossRoomOption , UpdateCrossRoomOption , StopCrossRoomOption , SmallStreamAutoSwitcherOptions , VideoMixerOptions , UpdateVideoMixerOptions } ;
14- type TRTCPlugin = typeof CrossRoom | typeof CDNStreaming | typeof DeviceDetector | typeof VirtualBackground | typeof Watermark | typeof Beauty | typeof BasicBeauty | typeof CustomEncryption | typeof SmallStreamAutoSwitcher | typeof VideoMixer | typeof Chorus ;
15+ type TRTCPlugin = typeof CrossRoom | typeof CDNStreaming | typeof DeviceDetector | typeof VirtualBackground | typeof Watermark | typeof Beauty | typeof BasicBeauty | typeof CustomEncryption | typeof SmallStreamAutoSwitcher | typeof VideoMixer | typeof Chorus | typeof LEBPlayer ;
1516export type ExperimentalAPIFunctionMap = {
1617 'enableAudioFrameEvent' : EnableAudioFrameEventOptions ;
1718 'resumeRemotePlayer' : RemotePlayerOptions ;
@@ -36,6 +37,7 @@ export declare type PluginStartOptionsMap = {
3637 'SmallStreamAutoSwitcher' : SmallStreamAutoSwitcherOptions ;
3738 'AudioProcessor' : InitAudioProcessorOptions ;
3839 'Chorus' : StartChorusOption ;
40+ 'LEBPlayer' : StartLEBPlayerOption ;
3941} ;
4042
4143export declare type PluginUpdateOptionsMap = {
@@ -51,6 +53,7 @@ export declare type PluginUpdateOptionsMap = {
5153 'AudioProcessor' : UpdateAudioProcessorOptions ;
5254 'Debug' : UpdateDebugOptions ;
5355 'Chorus' : UpdateChorusOption ;
56+ 'LEBPlayer' : UpdateLEBPlayerOption ;
5457} ;
5558
5659export declare type PluginStopOptionsMap = {
@@ -69,6 +72,7 @@ export declare type PluginStopOptionsMap = {
6972 'AudioProcessor' : undefined ;
7073 'CustomEncryption' : undefined ;
7174 'Chorus' : undefined ;
75+ 'LEBPlayer' : undefined ;
7276} ;
7377
7478export declare class RtcError extends Error implements RTCErrorInterface {
@@ -331,13 +335,21 @@ export declare const enum BannedReason {
331335 ROOM_DISBAND = 'room_disband'
332336}
333337
338+ export declare const enum PEER_LEAVE_REASON {
339+ NORMAL_LEAVE = 'normal leave' ,
340+ TIMEOUT_LEAVE = 'timeout leave' ,
341+ KICK = 'kick' ,
342+ ROLE_CHANGE = 'role change'
343+ }
344+
334345export declare type PluginWithAssets = {
335346 plugin : TRTCPlugin ;
336347 assetsPath ?: string ;
337348} ;
338349export declare interface TRTCOptions {
339350 plugins ?: Array < TRTCPlugin > ;
340351 enableSEI ?: boolean ;
352+ enableAutoPlayDialog ?: boolean ;
341353 assetsPath ?: string ;
342354 volumeType ?: number ;
343355 enableAutoSwitchWhenRecapturing ?: boolean ;
@@ -411,6 +423,7 @@ export declare interface SwitchRoomConfig {
411423export declare interface ScreenShareConfig {
412424 view ?: string | HTMLElement | HTMLElement [ ] | null ;
413425 publish ?: boolean ;
426+ streamType ?: TRTCStreamType ;
414427 muteSystemAudio ?: boolean ;
415428 option ?: {
416429 profile ?: keyof typeof screenProfileMap | VideoProfile ;
@@ -430,6 +443,8 @@ export declare interface UpdateScreenShareConfig extends ScreenShareConfig {
430443 option ?: {
431444 fillMode ?: 'contain' | 'cover' | 'fill' ;
432445 qosPreference ?: typeof TRTCType . QOS_PREFERENCE_SMOOTH | typeof TRTCType . QOS_PREFERENCE_CLEAR ;
446+ audioTrack ?: MediaStreamTrack ;
447+ videoTrack ?: MediaStreamTrack ;
433448 } ;
434449}
435450export declare interface RemoteVideoConfig {
@@ -445,6 +460,8 @@ export declare interface RemoteVideoConfig {
445460 canvasRender ?: boolean ;
446461 poster ?: string ;
447462 draggable ?:boolean ;
463+ pictureInPicture ?: boolean ;
464+ fullScreen ?: boolean ;
448465 } ;
449466}
450467export declare interface StopRemoteVideoConfig {
@@ -505,6 +522,30 @@ export declare interface PermissionOption {
505522 types ?: ( 'camera' | 'microphone' ) [ ] ;
506523}
507524
525+ export declare interface RealtimeTranscriberStateEvent {
526+ state : 'started' | 'stopped' ;
527+ roomId : string | number ;
528+ transcriberRobotId : string ;
529+ sourceLanguage ?: string ;
530+ error ?: number ;
531+ errorMessage ?: string ;
532+ }
533+
534+ export declare interface TranslationText {
535+ language : string ;
536+ text : string ;
537+ }
538+
539+ export declare interface RealtimeTranscriberMessageEvent {
540+ segmentId : string ;
541+ speakerUserId : string ;
542+ sourceText : string ;
543+ translationTexts : TranslationText [ ] ;
544+ timestamp : number ;
545+ isCompleted : boolean ;
546+ robotId : string ;
547+ }
548+
508549export declare interface PermissionResult {
509550 camera : PermissionState | null ;
510551 microphone : PermissionState | null ;
@@ -1038,6 +1079,9 @@ export declare const TRTCEvent: {
10381079 * trtc.on(TRTC.EVENT.CONNECTION_STATE_CHANGED, event => {
10391080 * const prevState = event.prevState;
10401081 * const curState = event.state;
1082+ * if (curState === 'CONNECTING') {
1083+ * const isReconnecting = event.isReconnecting;
1084+ * }
10411085 * });
10421086 */
10431087 readonly CONNECTION_STATE_CHANGED : 'connection-state-changed' ;
@@ -1251,6 +1295,55 @@ export declare const TRTCEvent: {
12511295 * })
12521296 */
12531297 readonly VIDEO_SIZE_CHANGED : 'video-size-changed' ;
1298+ /**
1299+ * @since v5.15.0
1300+ * @description Realtime transcriber message
1301+ * @default 'realtime-transcriber-message'
1302+ * @memberof module:EVENT
1303+ * @example
1304+ * trtc.on(TRTC.EVENT.REALTIME_TRANSCRIBER_MESSAGE, event => {
1305+ * // event.data: custom message data, type is ArrayBuffer.
1306+ * })
1307+ */
1308+ readonly REALTIME_TRANSCRIBER_MESSAGE : 'realtime-transcriber-message' ;
1309+ /**
1310+ * @since v5.15.0
1311+ * @description Realtime transcriber state changed
1312+ * @default 'realtime-transcriber-state-changed'
1313+ * @memberof module:EVENT
1314+ * @example
1315+ * trtc.on(TRTC.EVENT.REALTIME_TRANSCRIBER_STATE_CHANGED, event => {
1316+ * // event.state: transcriber state.
1317+ * })
1318+ */
1319+ readonly REALTIME_TRANSCRIBER_STATE_CHANGED : 'realtime-transcriber-state-changed' ;
1320+ /**
1321+ * @since v5.15.0
1322+ * @description Picture in picture state change event
1323+ * @default 'picture-in-picture-state-changed'
1324+ * @memberof module:EVENT
1325+ * @example
1326+ * trtc.on(TRTC.EVENT.PICTURE_IN_PICTURE_STATE_CHANGED, event => {
1327+ * // event.userId: userId.
1328+ * // event.streamType: video stream type.
1329+ * // event.isPictureInPicture: is in picture in picture.
1330+ * // event.pictureInPictureWindow: Exist when isPictureInPicture is true. See: https://developer.mozilla.org/en-US/docs/Web/API/PictureInPictureWindow
1331+ * })
1332+ */
1333+ readonly PICTURE_IN_PICTURE_STATE_CHANGED : 'picture-in-picture-state-changed' ,
1334+ /**
1335+ * @since v5.15.0
1336+ * @description Full screen state change event
1337+ * @default 'full-screen-state-changed'
1338+ * @memberof module:EVENT
1339+ * @example
1340+ * trtc.on(TRTC.EVENT.FULL_SCREEN_STATE_CHANGED, event => {
1341+ * // event.userId: userId.
1342+ * // event.streamType: video stream type.
1343+ * // event.isFullScreen: is in full screen.
1344+ * })
1345+ */
1346+ readonly FULL_SCREEN_STATE_CHANGED : 'full-screen-state-changed'
12541347} ;
12551348export declare interface TRTCEventTypes {
12561349 [ TRTCEvent . ERROR ] : [ RtcError ] ;
@@ -1267,6 +1360,7 @@ export declare interface TRTCEventTypes {
12671360 } ] ;
12681361 [ TRTCEvent . REMOTE_USER_EXIT ] : [ {
12691362 userId : string ;
1363+ reason ?: keyof typeof PEER_LEAVE_REASON ;
12701364 } ] ;
12711365 [ TRTCEvent . REMOTE_AUDIO_AVAILABLE ] : [ {
12721366 userId : string ;
@@ -1296,6 +1390,7 @@ export declare interface TRTCEventTypes {
12961390 [ TRTCEvent . CONNECTION_STATE_CHANGED ] : [ {
12971391 prevState : ConnectionState ;
12981392 state : ConnectionState ;
1393+ isReconnecting ?: boolean ;
12991394 } ] ;
13001395 [ TRTCEvent . AUDIO_PLAY_STATE_CHANGED ] : [ {
13011396 userId : string ;
@@ -1353,6 +1448,23 @@ export declare interface TRTCEventTypes {
13531448 width : number ;
13541449 height : number ;
13551450 } ] ;
1451+ [ TRTCEvent . REALTIME_TRANSCRIBER_MESSAGE ] : [ RealtimeTranscriberMessageEvent ] ;
1452+ [ TRTCEvent . REALTIME_TRANSCRIBER_STATE_CHANGED ] : [ RealtimeTranscriberStateEvent ] ;
1453+ [ TRTCEvent . PICTURE_IN_PICTURE_STATE_CHANGED ] : [ PictureInPictureStateChangedEvent ] ;
1454+ [ TRTCEvent . FULL_SCREEN_STATE_CHANGED ] : [ FullScreenStateChangedEvent ]
1455+ }
1456+
1457+ export interface PictureInPictureStateChangedEvent {
1458+ userId : string ;
1459+ streamType : TRTCStreamType ;
1460+ isPictureInPicture : boolean ;
1461+ pictureInPictureWindow ?: PictureInPictureWindow ;
1462+ }
1463+
1464+ export interface FullScreenStateChangedEvent {
1465+ userId : string ;
1466+ streamType : TRTCStreamType ;
1467+ isFullScreen : boolean ;
13561468}
13571469
13581470export declare interface CustomMessageData {
0 commit comments