@revideo/2d 0.1.5 → 0.1.8
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/lib/components/AudioTest.d.ts +95 -95
- package/lib/components/AudioTest.js +259 -261
- package/lib/components/Media.d.ts +4 -0
- package/lib/components/Media.d.ts.map +1 -1
- package/lib/components/Media.js +14 -1
- package/lib/scenes/Scene2D.d.ts.map +1 -1
- package/lib/scenes/Scene2D.js +3 -1
- package/lib/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/src/lib/components/Media.ts +18 -0
- package/src/lib/scenes/Scene2D.ts +2 -0
|
@@ -1,99 +1,99 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import {SerializedVector2, SignalValue, SimpleSignal} from '@revideo/core';
|
|
2
|
+
import {DesiredLength} from '../partials';
|
|
3
|
+
import {Rect, RectProps} from './Rect';
|
|
4
4
|
export interface AudioTestProps extends RectProps {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
5
|
+
/**
|
|
6
|
+
* {@inheritDoc Video.src}
|
|
7
|
+
*/
|
|
8
|
+
src?: SignalValue<string>;
|
|
9
|
+
/**
|
|
10
|
+
* {@inheritDoc Video.alpha}
|
|
11
|
+
*/
|
|
12
|
+
alpha?: SignalValue<number>;
|
|
13
|
+
/**
|
|
14
|
+
* {@inheritDoc Video.smoothing}
|
|
15
|
+
*/
|
|
16
|
+
smoothing?: SignalValue<boolean>;
|
|
17
|
+
/**
|
|
18
|
+
* {@inheritDoc Video.loop}
|
|
19
|
+
*/
|
|
20
|
+
loop?: SignalValue<boolean>;
|
|
21
|
+
/**
|
|
22
|
+
* {@inheritDoc Video.playbackRate}
|
|
23
|
+
*/
|
|
24
|
+
playbackRate?: number;
|
|
25
|
+
/**
|
|
26
|
+
* The starting time for this video in seconds.
|
|
27
|
+
*/
|
|
28
|
+
time?: SignalValue<number>;
|
|
29
|
+
play?: boolean;
|
|
30
30
|
}
|
|
31
31
|
export declare class AudioTest extends Rect {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
32
|
+
private static readonly pool;
|
|
33
|
+
/**
|
|
34
|
+
* The source of this video.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* Using a local video:
|
|
38
|
+
* ```tsx
|
|
39
|
+
* import video from './example.mp4';
|
|
40
|
+
* // ...
|
|
41
|
+
* view.add(<Video src={video} />)
|
|
42
|
+
* ```
|
|
43
|
+
* Loading an image from the internet:
|
|
44
|
+
* ```tsx
|
|
45
|
+
* view.add(<Video src="https://example.com/video.mp4" />)
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
readonly src: SimpleSignal<string, this>;
|
|
49
|
+
/**
|
|
50
|
+
* The alpha value of this video.
|
|
51
|
+
*
|
|
52
|
+
* @remarks
|
|
53
|
+
* Unlike opacity, the alpha value affects only the video itself, leaving the
|
|
54
|
+
* fill, stroke, and children intact.
|
|
55
|
+
*/
|
|
56
|
+
readonly alpha: SimpleSignal<number, this>;
|
|
57
|
+
/**
|
|
58
|
+
* Whether the video should be smoothed.
|
|
59
|
+
*
|
|
60
|
+
* @remarks
|
|
61
|
+
* When disabled, the video will be scaled using the nearest neighbor
|
|
62
|
+
* interpolation with no smoothing. The resulting video will appear pixelated.
|
|
63
|
+
*
|
|
64
|
+
* @defaultValue true
|
|
65
|
+
*/
|
|
66
|
+
readonly smoothing: SimpleSignal<boolean, this>;
|
|
67
|
+
/**
|
|
68
|
+
* Whether this video should loop upon reaching the end.
|
|
69
|
+
*/
|
|
70
|
+
readonly loop: SimpleSignal<boolean, this>;
|
|
71
|
+
/**
|
|
72
|
+
* The rate at which the video plays, as multiples of the normal speed.
|
|
73
|
+
*
|
|
74
|
+
* @defaultValue 1
|
|
75
|
+
*/
|
|
76
|
+
readonly playbackRate: SimpleSignal<number, this>;
|
|
77
|
+
protected readonly time: SimpleSignal<number, this>;
|
|
78
|
+
protected readonly playing: SimpleSignal<boolean, this>;
|
|
79
|
+
private lastTime;
|
|
80
|
+
constructor({play, ...props}: AudioTestProps);
|
|
81
|
+
isPlaying(): boolean;
|
|
82
|
+
getCurrentTime(): number;
|
|
83
|
+
getDuration(): number;
|
|
84
|
+
protected desiredSize(): SerializedVector2<DesiredLength>;
|
|
85
|
+
completion(): number;
|
|
86
|
+
protected video(): HTMLAudioElement;
|
|
87
|
+
protected seekedVideo(): HTMLAudioElement;
|
|
88
|
+
protected fastSeekedVideo(): HTMLAudioElement;
|
|
89
|
+
protected draw(context: CanvasRenderingContext2D): void;
|
|
90
|
+
protected applyFlex(): void;
|
|
91
|
+
protected setCurrentTime(value: number): void;
|
|
92
|
+
protected setPlaybackRate(playbackRate: number): void;
|
|
93
|
+
play(): void;
|
|
94
|
+
pause(): void;
|
|
95
|
+
seek(time: number): void;
|
|
96
|
+
clampTime(time: number): number;
|
|
97
|
+
protected collectAsyncResources(): void;
|
|
98
98
|
}
|
|
99
|
-
//# sourceMappingURL=AudioTest.d.ts.map
|
|
99
|
+
//# sourceMappingURL=AudioTest.d.ts.map
|