background separate stream
Browse files
App/Editor/Schema.py
CHANGED
@@ -14,7 +14,7 @@ class Assets(BaseModel):
|
|
14 |
|
15 |
@validator("type")
|
16 |
def valid_type(cls, v):
|
17 |
-
if v not in ["video", "audio", "text", "image", "sfx"]:
|
18 |
raise ValueError("Invalid asset type")
|
19 |
return v
|
20 |
|
|
|
14 |
|
15 |
@validator("type")
|
16 |
def valid_type(cls, v):
|
17 |
+
if v not in ["video", "audio", "text", "image", "sfx", "background"]:
|
18 |
raise ValueError("Invalid asset type")
|
19 |
return v
|
20 |
|
Remotion-app/src/HelloWorld/Assets/BackgroundSequences.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
[]
|
Remotion-app/src/HelloWorld/BackGroundStream.jsx
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import {Series} from 'remotion';
|
2 |
+
import React from 'react';
|
3 |
+
import {staticFile, useVideoConfig, Audio} from 'remotion';
|
4 |
+
import backgroundSequences from './Assets/BackgroundSequences.json';
|
5 |
+
import {TransitionSeries} from '@remotion/transitions';
|
6 |
+
export default function BackgroundStream() {
|
7 |
+
const {fps} = useVideoConfig();
|
8 |
+
return (
|
9 |
+
<TransitionSeries
|
10 |
+
style={{
|
11 |
+
color: 'white',
|
12 |
+
position: 'absolute',
|
13 |
+
zIndex: 0,
|
14 |
+
}}
|
15 |
+
>
|
16 |
+
{backgroundSequences.map((entry, index) => {
|
17 |
+
return (
|
18 |
+
<TransitionSeries.Sequence
|
19 |
+
key={index}
|
20 |
+
from={fps * entry.start}
|
21 |
+
durationInFrames={fps * (entry.end - entry.start)}
|
22 |
+
>
|
23 |
+
<Audio
|
24 |
+
volume={entry.props.volume}
|
25 |
+
endAt={entry.props.endAt}
|
26 |
+
startFrom={entry.props.startFrom}
|
27 |
+
src={staticFile(entry.name)}
|
28 |
+
/>
|
29 |
+
</TransitionSeries.Sequence>
|
30 |
+
);
|
31 |
+
})}
|
32 |
+
</TransitionSeries>
|
33 |
+
);
|
34 |
+
}
|
Remotion-app/src/HelloWorld/index.jsx
CHANGED
@@ -5,10 +5,12 @@ import {TextStream} from './TextStream';
|
|
5 |
import AudioStream from './AudioStream';
|
6 |
import ImageStream from './ImageStream';
|
7 |
import SfxStream from './SfxStream';
|
|
|
8 |
|
9 |
export const HelloWorld = () => {
|
10 |
return (
|
11 |
<AbsoluteFill style={{position: 'relative', backgroundColor: 'black'}}>
|
|
|
12 |
<SfxStream />
|
13 |
<ImageStream />
|
14 |
<TextStream />
|
|
|
5 |
import AudioStream from './AudioStream';
|
6 |
import ImageStream from './ImageStream';
|
7 |
import SfxStream from './SfxStream';
|
8 |
+
import BackgroundStream from './BackGroundStream';
|
9 |
|
10 |
export const HelloWorld = () => {
|
11 |
return (
|
12 |
<AbsoluteFill style={{position: 'relative', backgroundColor: 'black'}}>
|
13 |
+
<BackgroundStream />
|
14 |
<SfxStream />
|
15 |
<ImageStream />
|
16 |
<TextStream />
|