trtc-sdk-v5 5.11.1 → 5.11.2-beta.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trtc-sdk-v5",
3
- "version": "5.11.1",
3
+ "version": "5.11.2-beta.2",
4
4
  "description": "Tencent Cloud RTC SDK for Web",
5
5
  "main": "trtc.js",
6
6
  "types": "index.d.ts",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rtc-plugin/cdn-streaming",
3
- "version": "5.11.1",
3
+ "version": "5.11.2-beta.2",
4
4
  "description": "TRTC Web SDK 5.x CDN streaming plugin",
5
5
  "main": "./cdn-streaming.esm.js",
6
6
  "module": "./cdn-streaming.esm.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rtc-plugin/cross-room",
3
- "version": "5.11.1",
3
+ "version": "5.11.2-beta.2",
4
4
  "description": "TRTC Web SDK 5.x Cross Room plugin",
5
5
  "main": "./cross-room.esm.js",
6
6
  "module": "./cross-room.esm.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rtc-plugin/custom-encryption",
3
- "version": "5.11.1",
3
+ "version": "5.11.2-beta.2",
4
4
  "main": "./custom-encryption.esm.js",
5
5
  "module": "./custom-encryption.esm.js",
6
6
  "types": "./custom-encryption.esm.d.ts"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rtc-plugin/device-detector",
3
- "version": "5.11.1",
3
+ "version": "5.11.2-beta.2",
4
4
  "description": "TRTC Web SDK 5.x device detector plugin",
5
5
  "main": "./device-detector.esm.js",
6
6
  "module": "./device-detector.esm.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rtc-plugin/small-stream-auto-switcher",
3
- "version": "5.11.1",
3
+ "version": "5.11.2-beta.2",
4
4
  "description": "",
5
5
  "main": "./small-stream-auto-switcher.esm.js",
6
6
  "keywords": [],
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rtc-plugin/video-decoder",
3
- "version": "5.11.1",
3
+ "version": "5.11.2-beta.2",
4
4
  "description": "Video decoder plugin for TRTC",
5
5
  "main": "./video-decoder.esm.js",
6
6
  "module": "./video-decoder.esm.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rtc-plugin/basic-beauty",
3
- "version": "5.11.1",
3
+ "version": "5.11.2-beta.2",
4
4
  "description": "TRTC Web SDK 5.x basic-beauty plugin",
5
5
  "main": "./basic-beauty.esm.js",
6
6
  "module": "./basic-beauty.esm.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rtc-plugin/beauty",
3
- "version": "5.11.1",
3
+ "version": "5.11.2-beta.2",
4
4
  "description": "TRTC Web SDK 5.x beauty plugin",
5
5
  "main": "./beauty.esm.js",
6
6
  "module": "./beauty.esm.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rtc-plugin/video-mixer",
3
- "version": "5.11.1",
3
+ "version": "5.11.2-beta.2",
4
4
  "description": "TRTC Web SDK 5.x videoMixer plugin",
5
5
  "main": "./video-mixer.esm.js",
6
6
  "module": "./video-mixer.esm.js",
@@ -1,23 +1,81 @@
1
+ import {
2
+ screenProfileMap,
3
+ VideoProfile,
4
+ videoProfileMap,
5
+ } from 'trtc-sdk-v5';
6
+
1
7
  export interface VideoMixerOptions {
2
- camera?: LayerOption;
3
- screen?: LayerOption;
4
- container?: {
5
- width: number,
6
- height: number
7
- }
8
+ view?: string | HTMLElement | null;
9
+ canvasInfo: {
10
+ canvasColor?: string; // 合流背景色
11
+ // 合流画布分辨率
12
+ width: number;
13
+ height: number;
14
+ frameRate?: number; // 合流帧率
15
+ };
16
+ camera?: CameraSource[];
17
+ screen?: ScreenSource[];
18
+ text?: TextSource[];
19
+ video?: VideoSource[];
20
+ image?: ImageSource[];
8
21
  }
22
+ // 更新时画布配置变为可选
23
+ export type UpdateVideoMixerOptions = VideoMixerOptions & {
24
+ canvasInfo?: {
25
+ canvasColor?: string;
26
+ width: number;
27
+ height: number;
28
+ frameRate?: number;
29
+ };
30
+ };
9
31
 
32
+ export interface CameraSource {
33
+ // 参数与 startLocalVideo 对齐
34
+ id: string;
35
+ cameraId?: string;
36
+ videoTrack?: MediaStreamTrack;
37
+ profile?: keyof typeof videoProfileMap | VideoProfile;
38
+ layout: LayerOption;
39
+ }
40
+ export interface ScreenSource {
41
+ // 参数与 startScreenShare 对齐
42
+ id: string;
43
+ profile?: keyof typeof screenProfileMap | VideoProfile;
44
+ captureElement?: HTMLElement;
45
+ preferDisplaySurface?: 'current-tab' | 'tab' | 'window' | 'monitor';
46
+ layout: LayerOption;
47
+ }
48
+ export interface TextSource {
49
+ id: string;
50
+ content: string;
51
+ font?: string;
52
+ color?: string | CanvasGradient | CanvasPattern;
53
+ layout: LayerOption;
54
+ }
55
+ export interface VideoSource {
56
+ id: string;
57
+ url: string;
58
+ layout: LayerOption;
59
+ }
60
+ export interface ImageSource {
61
+ id: string;
62
+ url: string;
63
+ layout: LayerOption;
64
+ }
10
65
  export interface LayerOption {
11
- x?: number;
12
- y?: number;
13
- width?: number;
14
- height?: number;
15
- // hidden?: boolean
66
+ x: number;
67
+ y: number;
68
+ width: number;
69
+ height: number;
70
+ zIndex: number;
71
+ fillMode?: 'contain' | 'cover' | 'fill';
72
+ mirror?: boolean;
73
+ rotation?: 0 | 90 | 180 | 270;
16
74
  }
17
75
 
18
76
  export declare class VideoMixer {
19
- start(options: VideoMixerOptions): void;
20
- update(options: VideoMixerOptions): void;
77
+ start(options: VideoMixerOptions): Promise<MediaStreamVideoTrack>;
78
+ update(options: UpdateVideoMixerOptions): Promise<MediaStreamVideoTrack>;
21
79
  stop(): void;
22
80
  }
23
81