pull/333/head
Mikael Finstad 2020-04-17 23:59:22 +08:00
rodzic b3b4b6206c
commit 5346d412b9
1 zmienionych plików z 4 dodań i 1 usunięć

Wyświetl plik

@ -585,7 +585,10 @@ const App = memo(() => {
const onStopPlaying = useCallback(() => onPlayingChange(false), []); const onStopPlaying = useCallback(() => onPlayingChange(false), []);
const onSartPlaying = useCallback(() => onPlayingChange(true), []); const onSartPlaying = useCallback(() => onPlayingChange(true), []);
const onDurationChange = useCallback(e => setDuration(e.target.duration), []); const onDurationChange = useCallback((e) => {
// Some files report duration infinity first, then proper duration later
if (e.target.duration !== Infinity) setDuration(e.target.duration);
}, []);
const onTimeUpdate = useCallback((e) => { const onTimeUpdate = useCallback((e) => {
const { currentTime } = e.target; const { currentTime } = e.target;