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