Ver código fonte

Fix video hero thumbnail issues (#1169)

Bartosz Dryl 3 anos atrás
pai
commit
cacdd467fa

+ 3 - 0
src/components/VideoHero/VideoHero.tsx

@@ -68,6 +68,9 @@ export const VideoHero: React.FC = () => {
                 playing={videoPlaying}
                 posterUrl={thumbnailPhotoUrl}
                 onDataLoaded={handlePlaybackDataLoaded}
+                onPlay={() => setVideoPlaying(true)}
+                onPause={() => setVideoPlaying(false)}
+                onEnd={() => setVideoPlaying(false)}
                 src={coverVideo?.coverCutMediaUrl}
               />
             )}

+ 1 - 0
src/shared/components/VideoPlayer/VideoPlayer.style.tsx

@@ -233,6 +233,7 @@ const backgroundContainerCss = css`
     display: block;
     opacity: 0;
     height: 100%;
+    position: relative;
     transition: opacity ${transitions.timings.loading} ${transitions.easing};
   }