More memo
Browse files
Remotion-app/src/HelloWorld/AudioStream.jsx
CHANGED
|
@@ -20,12 +20,7 @@ const AudioStream = React.memo(() => {
|
|
| 20 |
from={fps * entry.start}
|
| 21 |
durationInFrames={fps * (entry.end - entry.start)}
|
| 22 |
>
|
| 23 |
-
<
|
| 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 |
})}
|
|
@@ -33,4 +28,16 @@ const AudioStream = React.memo(() => {
|
|
| 33 |
);
|
| 34 |
});
|
| 35 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
export default AudioStream;
|
|
|
|
| 20 |
from={fps * entry.start}
|
| 21 |
durationInFrames={fps * (entry.end - entry.start)}
|
| 22 |
>
|
| 23 |
+
<AudioX entry={entry} />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
</TransitionSeries.Sequence>
|
| 25 |
);
|
| 26 |
})}
|
|
|
|
| 28 |
);
|
| 29 |
});
|
| 30 |
|
| 31 |
+
const AudioX = React.memo(({entry}) => {
|
| 32 |
+
const {fps} = useVideoConfig();
|
| 33 |
+
return (
|
| 34 |
+
<Audio
|
| 35 |
+
startFrom={fps * entry.props.startFrom}
|
| 36 |
+
endAt={fps * entry.props.endAt}
|
| 37 |
+
volume={entry.props.volume}
|
| 38 |
+
src={staticFile(entry.name)}
|
| 39 |
+
/>
|
| 40 |
+
);
|
| 41 |
+
});
|
| 42 |
+
|
| 43 |
export default AudioStream;
|
Remotion-app/src/HelloWorld/VideoStream.jsx
CHANGED
|
@@ -4,13 +4,11 @@ import {Video, staticFile, useVideoConfig} from 'remotion';
|
|
| 4 |
import videoSequences from './Assets/VideoSequences.json';
|
| 5 |
import {TransitionSeries} from '@remotion/transitions';
|
| 6 |
|
| 7 |
-
|
| 8 |
-
export default function VideoStream() {
|
| 9 |
const {fps} = useVideoConfig();
|
| 10 |
return (
|
| 11 |
<TransitionSeries
|
| 12 |
style={{
|
| 13 |
-
// color: 'white',
|
| 14 |
position: 'absolute',
|
| 15 |
zIndex: 1,
|
| 16 |
}}
|
|
@@ -22,10 +20,24 @@ export default function VideoStream() {
|
|
| 22 |
from={fps * entry.start}
|
| 23 |
durationInFrames={fps * (entry.end - entry.start)}
|
| 24 |
>
|
| 25 |
-
<
|
| 26 |
</TransitionSeries.Sequence>
|
| 27 |
);
|
| 28 |
})}
|
| 29 |
</TransitionSeries>
|
| 30 |
);
|
| 31 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
import videoSequences from './Assets/VideoSequences.json';
|
| 5 |
import {TransitionSeries} from '@remotion/transitions';
|
| 6 |
|
| 7 |
+
const VideoStream = React.memo(() => {
|
|
|
|
| 8 |
const {fps} = useVideoConfig();
|
| 9 |
return (
|
| 10 |
<TransitionSeries
|
| 11 |
style={{
|
|
|
|
| 12 |
position: 'absolute',
|
| 13 |
zIndex: 1,
|
| 14 |
}}
|
|
|
|
| 20 |
from={fps * entry.start}
|
| 21 |
durationInFrames={fps * (entry.end - entry.start)}
|
| 22 |
>
|
| 23 |
+
<VideoX entry={entry} />
|
| 24 |
</TransitionSeries.Sequence>
|
| 25 |
);
|
| 26 |
})}
|
| 27 |
</TransitionSeries>
|
| 28 |
);
|
| 29 |
+
});
|
| 30 |
+
|
| 31 |
+
const VideoX = React.memo(({entry}) => {
|
| 32 |
+
const {fps} = useVideoConfig();
|
| 33 |
+
return (
|
| 34 |
+
<Video
|
| 35 |
+
startFrom={fps * entry.props.startFrom}
|
| 36 |
+
endAt={fps * entry.props.endAt}
|
| 37 |
+
volume={entry.props.volume}
|
| 38 |
+
src={staticFile(entry.name)}
|
| 39 |
+
/>
|
| 40 |
+
);
|
| 41 |
+
});
|
| 42 |
+
|
| 43 |
+
export default VideoStream;
|