Skip to content

Commit a1dc485

Browse files
authored
release: TRTC Web SDK v5.15.0
release: TRTC Web SDK v5.15.0
2 parents dd3cdf6 + ecb6d8c commit a1dc485

59 files changed

Lines changed: 672 additions & 153 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

SDK/assets/debug-dialog.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

SDK/index.d.ts

Lines changed: 113 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ import { CustomEncryption, EncryptionOptions } from './plugins/custom-encryption
99
import { VideoMixerOptions, UpdateVideoMixerOptions, VideoMixer } from './plugins/video-effect/video-mixer';
1010
import { SmallStreamAutoSwitcher, SmallStreamAutoSwitcherOptions } from './plugins/small-stream-auto-switcher';
1111
import { Chorus, StartChorusOption, UpdateChorusOption } from './plugins/chorus';
12+
import { LEBPlayer, StartLEBPlayerOption, UpdateLEBPlayerOption } from './plugins/lebplayer';
1213

1314
export { 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;
1516
export 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

4143
export 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

5659
export 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

7478
export 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+
334345
export declare type PluginWithAssets = {
335346
plugin: TRTCPlugin;
336347
assetsPath?: string;
337348
};
338349
export 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 {
411423
export 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
}
435450
export 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
}
450467
export 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+
508549
export 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
};
12551348
export 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

13581470
export declare interface CustomMessageData {

SDK/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "trtc-sdk-v5",
3-
"version": "5.14.1",
3+
"version": "5.15.0",
44
"description": "Tencent Cloud RTC SDK for Web",
55
"main": "trtc.js",
66
"types": "index.d.ts",

SDK/plugins/cdn-streaming/cdn-streaming.esm.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

SDK/plugins/cdn-streaming/cdn-streaming.umd.js

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

SDK/plugins/cdn-streaming/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@rtc-plugin/cdn-streaming",
3-
"version": "5.14.1",
3+
"version": "5.15.0",
44
"description": "TRTC Web SDK 5.x CDN streaming plugin",
55
"main": "./cdn-streaming.esm.js",
66
"module": "./cdn-streaming.esm.js",

SDK/plugins/chorus/chorus.esm.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@ export declare class Chorus {
1111
update(option: any): Promise<void>;
1212
stop(option?: any): Promise<void>;
1313
}
14+
15+
export default Chorus;

SDK/plugins/chorus/chorus.esm.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

SDK/plugins/chorus/chorus.umd.js

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

SDK/plugins/chorus/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@rtc-plugin/chorus",
3-
"version": "5.14.1",
3+
"version": "5.15.0",
44
"description": "TRTC Web SDK 5.x Chorus plugin",
55
"main": "./chorus.esm.js",
66
"module": "./chorus.esm.js",

0 commit comments

Comments
 (0)