Skip to content

Commit

Permalink
OV-424: * fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanchousina committed Sep 25, 2024
1 parent 64c3327 commit 44a35e4
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 14 deletions.
15 changes: 12 additions & 3 deletions frontend/src/bundles/studio/components/video/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,23 @@
justify-content: center;
}

.image {
position: absolute;
object-fit: cover;
z-index: 2;
height: 100%;
width: 100%;
}

.background {
background-size: cover;
height: 100%;
width: 100%;
justify-content: center;
z-index: 1;
position: absolute;
}

.image {
.avatar {
z-index: 3;
position: absolute;
object-fit: contain;
bottom: 0;
Expand Down
30 changes: 19 additions & 11 deletions frontend/src/bundles/studio/components/video/video.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {
AbsoluteFill,
Audio,
Flex,
RemotionImg,
Series,
} from '~/bundles/common/components/components.js';
Expand Down Expand Up @@ -38,19 +37,28 @@ const VideoComponent: React.FC<Properties> = ({ scenes, scripts }) => {
durationInFrames={scene.duration * FPS}
className={styles['sequence'] as string}
>
{scene?.avatar?.url || scene.background ? (
<Flex
background={`${scene.background?.color ?? ''} url(${scene.background?.url ?? ''}) no-repeat`}
className={styles['background']}
>
<RemotionImg
className={styles['image']}
src={scene?.avatar?.url ?? ''}
/>
</Flex>
{scene?.avatar?.url ? (
<RemotionImg
className={styles['avatar']}
src={scene?.avatar?.url ?? ''}
/>
) : (
<></>
)}
{scene?.background?.url && (
<RemotionImg
className={styles['image']}
src={scene?.background?.url}
/>
)}
{scene?.background?.color && (
<div
style={{
backgroundColor: `${scene?.background?.color}`,
}}
className={styles['background']}
></div>
)}
</Series.Sequence>
);
})}
Expand Down

0 comments on commit 44a35e4

Please sign in to comment.