Skip to content

🎥 Make videos programmatically with React

Revert unrelated example changes

Jonny Burger6a8800161c6d
diff --git a/packages/example/src/RemoteAudioTestbed/index.tsx b/packages/example/src/RemoteAudioTestbed/index.tsx
deleted file mode 100644
index 7205ba6e2c..0000000000
--- a/packages/example/src/RemoteAudioTestbed/index.tsx
+++ /dev/null
@@ -1,94 +0,0 @@
-import {Audio} from '@remotion/media';
-import {parseMedia} from '@remotion/media-parser';
-import React from 'react';
-import {AbsoluteFill, useCurrentFrame, useVideoConfig} from 'remotion';
-
-const AUDIO_URL =
- 'https://media.mkv.so/usr_f7260fb5-50f0-46c4-baee-9d50058a30c6/prj_9df9398c-f152-4a4d-8027-be122cb29ef9/RNX8pupQfgAOHdyB.mp3.m4a';
-
-export const calculateMetadataRemoteAudio = async () => {
- const fps = 30;
-
- const {slowDurationInSeconds} = await parseMedia({
- src: AUDIO_URL,
- fields: {
- slowDurationInSeconds: true,
- },
- });
-
- return {
- durationInFrames: Math.ceil(slowDurationInSeconds * fps),
- fps,
- width: 800,
- height: 800,
- };
-};
-
-export const RemoteAudioTestbed: React.FC = () => {
- const frame = useCurrentFrame();
- const {fps, durationInFrames} = useVideoConfig();
-
- const currentTime = (frame / fps).toFixed(2);
- const totalTime = (durationInFrames / fps).toFixed(2);
- const progress = frame / durationInFrames;
-
- return (
- <AbsoluteFill
- style={{
- backgroundColor: '#1a1a2e',
- justifyContent: 'center',
- alignItems: 'center',
- fontFamily: 'sans-serif',
- }}
- >
- <Audio src={AUDIO_URL} debugAudioScheduling />
- <div
- style={{
- display: 'flex',
- flexDirection: 'column',
- alignItems: 'center',
- gap: 24,
- }}
- >
- <div style={{fontSize: 32, color: '#e0e0e0', fontWeight: 'bold'}}>
- Remote Audio Testbed
- </div>
- <div
- style={{
- fontSize: 18,
- color: '#aaa',
- maxWidth: 600,
- wordBreak: 'break-all',
- textAlign: 'center',
- }}
- >
- {AUDIO_URL}
- </div>
- <div style={{fontSize: 48, color: '#00d4ff'}}>
- {currentTime}s / {totalTime}s
- </div>
- <div
- style={{
- width: 600,
- height: 12,
- backgroundColor: '#333',
- borderRadius: 6,
- overflow: 'hidden',
- }}
- >
- <div
- style={{
- width: `${progress * 100}%`,
- height: '100%',
- backgroundColor: '#00d4ff',
- borderRadius: 6,
- }}
- />
- </div>
- <div style={{fontSize: 16, color: '#888'}}>
- Frame {frame} / {durationInFrames} @ {fps}fps
- </div>
- </div>
- </AbsoluteFill>
- );
-};
diff --git a/packages/example/src/Root.tsx b/packages/example/src/Root.tsx
index d68b6289ae..b87e15daa7 100644
--- a/packages/example/src/Root.tsx
+++ b/packages/example/src/Root.tsx
@@ -149,10 +149,6 @@ import {
} from './PlayRangesMediaVideo';
import {PremountOnTransitionSeries} from './PremountOnTransitionSeries';
import {PrintProps} from './PrintProps';
-import {
- RemoteAudioTestbed,
- calculateMetadataRemoteAudio,
-} from './RemoteAudioTestbed';
import {SfxExample} from './Sfx';
import {SmoothTextTransition} from './SmoothTextTransition';
import {SpringSeason} from './SpringSeason';
@@ -1055,15 +1051,6 @@ export const Index: React.FC = () => {
/>
</Folder>
<Folder name="audio-tests">
- <Composition
- id="remote-audio-testbed"
- component={RemoteAudioTestbed}
- width={800}
- height={800}
- fps={30}
- durationInFrames={300}
- calculateMetadata={calculateMetadataRemoteAudio}
- />
<Composition
id="complex-sounds"
component={ComplexSounds}