Skip to content

Commit

Permalink
Slow down speed, autoplay after 3 seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
skanderm committed Sep 26, 2023
1 parent 3a10690 commit 79334f2
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions ui/src/components/Player/Player.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export default function Player({
"id" | "slug" | "nodeName" | "name" | "latLng" | "imageUrl"
>;
}) {
const [playMarquee, setPlayMarquee] = useState(false);
const [playerStatus, setPlayerStatus] = useState<PlayerStatus>("idle");
const playerRef = useRef<VideoJSPlayer | null>(null);

Expand All @@ -56,6 +55,13 @@ export default function Player({
);
const theme = useTheme();
const isDesktop = useMediaQuery(theme.breakpoints.up("sm"));
const [playMarquee, setPlayMarquee] = useState(false);

useEffect(() => {
setTimeout(() => {
setPlayMarquee(true);
}, 3000);
}, [])

const playerOptions = useMemo(
() => ({
Expand Down Expand Up @@ -209,7 +215,7 @@ export default function Player({
}}
>
<Marquee
speed={20}
speed={15}
play={playerTextOverflowing && !isDesktop && playMarquee}
key={`${playerText}-${playerTextOverflowing}-${playMarquee}`}
>
Expand Down

0 comments on commit 79334f2

Please sign in to comment.