Skip to content
Open
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
6 changes: 2 additions & 4 deletions src/features/videoEditor/components/TrimSlider.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useEffect, useRef, useState } from "react";
import { useEffect, useState } from "react";

import { Slider } from "antd";
import PropTypes from "prop-types";
Expand All @@ -15,7 +15,6 @@ const TrimSlider = ({
setIsLoading,
}) => {
const [thumbs, setThumbs] = useState([]);
const videoEl = useRef(null);
const count = Math.max(8, Math.ceil(width / THUMB_W));

const formatTime = (sec) => {
Expand All @@ -35,7 +34,6 @@ const TrimSlider = ({
video.src = videoSrc;
video.muted = true;
video.crossOrigin = "anonymous";
videoEl.current = video;

const grab = (time) => {
return new Promise((res) => {
Expand Down Expand Up @@ -65,7 +63,7 @@ const TrimSlider = ({
};

video.addEventListener("loadedmetadata", build, { once: true });
}, [videoSrc, duration, width, count]);
}, [duration]);

return (
<div
Expand Down