Set current time on local state for prev
This commit is contained in:
parent
a354cab797
commit
9100b6197a
1 changed files with 3 additions and 0 deletions
|
@ -203,6 +203,7 @@ export const useCenterControls = (args: { playersRef: any }) => {
|
|||
|
||||
const handleNextTrack = useCallback(() => {
|
||||
const isLastTrack = checkIsLastTrack();
|
||||
setCurrentTime(0);
|
||||
|
||||
const handleRepeatAll = {
|
||||
local: () => {
|
||||
|
@ -287,6 +288,8 @@ export const useCenterControls = (args: { playersRef: any }) => {
|
|||
|
||||
// Reset the current track more than 10 seconds have elapsed
|
||||
if (currentTime >= 10) {
|
||||
setCurrentTime(0);
|
||||
|
||||
if (isMpvPlayer) {
|
||||
return mpvPlayer.seekTo(0);
|
||||
}
|
||||
|
|
Reference in a new issue