Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remotion test ios #191

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 88 additions & 0 deletions components/basecomponents/KidsCompSeq.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import { AbsoluteFill, useVideoConfig, Audio, Sequence, useCurrentFrame } from 'remotion';
import { KidsTranslationsContainer } from 'components/basecomponents/KidsTranslationContainer';
import React, { useMemo } from 'react';
import { Phrase } from 'utils/getDataUtils';

interface KidsCompProps {
translations: Phrase[];
}

const KidsCompOld = ({ translations }: KidsCompProps) => {
const { fps } = useVideoConfig();

const duration = fps * 3; // in seconds

// const sequenceList = useMemo(
// () =>
// translations.map((phrase, i) => {
// return (
// <Sequence key={phrase.getTranslation('uk')} from={i * duration} durationInFrames={(i + 1) * duration}>
// <AbsoluteFill
// style={{
// justifyContent: 'center',
// alignItems: 'center',
// backgroundColor: 'white',
// }}
// >
// <KidsTranslationsContainer imageUrl={phrase.getImageUrl()} phrase={phrase} />
// <Audio src={phrase.getSoundUrl('uk')} />
// </AbsoluteFill>
// </Sequence>
// );
// }),
// [translations, duration]
// );

const sequenceList = translations.map((phrase, i) => {
return (
<Sequence key={phrase.getTranslation('uk')} from={i * duration} durationInFrames={(i + 1) * duration}>
<AbsoluteFill
style={{
justifyContent: 'center',
alignItems: 'center',
backgroundColor: 'white',
}}
>
<KidsTranslationsContainer imageUrl={phrase.getImageUrl()} phrase={phrase} />
<Audio src={phrase.getSoundUrl('uk')} />
</AbsoluteFill>
</Sequence>
);
});

return <>{sequenceList}</>;
};

// interface CardProps {
// phrase: Phrase;
// }

// const Card = ({ phrase }: CardProps) => (
// <>
// <KidsTranslationsContainer imageUrl={phrase.getImageUrl()} phrase={phrase} />
// <Audio src={phrase.getSoundUrl('uk')} />
// </>
// );

// const KidsComp = ({ translations }: KidsCompProps) => {
// const { fps } = useVideoConfig();
// const frame = useCurrentFrame();

// const duration = fps * 3; // in seconds
// const phrase = translations[Math.trunc(frame / duration)];

// return (
// <AbsoluteFill
// style={{
// justifyContent: 'center',
// alignItems: 'center',
// backgroundColor: 'white',
// }}
// >
// <Card phrase={phrase} />
// </AbsoluteFill>
// );
// };

export default KidsCompOld;
Loading