Skip to content

Commit

Permalink
[Docs] Fix playbar not showing
Browse files Browse the repository at this point in the history
  • Loading branch information
Marten-Mrfc committed Sep 15, 2024
1 parent 002f941 commit 2ba5f0b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions documentation/src/components/Player/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React, { useState, useRef, useEffect } from "react";
import ReactPlayer from "react-player";
import { Icon } from "@iconify/react";
import screenfull from "screenfull";
import debounce from "lodash.debounce";

interface PlayerProps {
url: string;
Expand All @@ -19,11 +18,11 @@ export default function Player({ url }: PlayerProps) {
setPlaying((prev) => !prev);
};

const handleSeek = debounce((e: React.ChangeEvent<HTMLInputElement>) => {
const handleSeek = (e: React.ChangeEvent<HTMLInputElement>) => {
const newProgress = parseFloat(e.target.value);
setProgress(newProgress);
playerRef.current?.seekTo(newProgress / 100, "fraction");
}, 200);
};

const handleFullscreenToggle = () => {
if (screenfull.isEnabled) {
Expand Down Expand Up @@ -55,6 +54,7 @@ export default function Player({ url }: PlayerProps) {
loop
muted
playsInline={true}
playsinline={true}
controls={false}
width="100%"
height="100%"
Expand Down Expand Up @@ -125,7 +125,7 @@ function Bar({ progress, onSeek }: BarProps) {
}}
/>
<div
className="h-full bg-primary transition-width duration-200"
className="h-full bg-primary transition-width duration-200 pb-2"
style={{ width: `${progress}%` }}
/>
</div>
Expand Down

0 comments on commit 2ba5f0b

Please sign in to comment.