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 handleNextTrack = useCallback(() => {
|
||||||
const isLastTrack = checkIsLastTrack();
|
const isLastTrack = checkIsLastTrack();
|
||||||
|
setCurrentTime(0);
|
||||||
|
|
||||||
const handleRepeatAll = {
|
const handleRepeatAll = {
|
||||||
local: () => {
|
local: () => {
|
||||||
|
@ -287,6 +288,8 @@ export const useCenterControls = (args: { playersRef: any }) => {
|
||||||
|
|
||||||
// Reset the current track more than 10 seconds have elapsed
|
// Reset the current track more than 10 seconds have elapsed
|
||||||
if (currentTime >= 10) {
|
if (currentTime >= 10) {
|
||||||
|
setCurrentTime(0);
|
||||||
|
|
||||||
if (isMpvPlayer) {
|
if (isMpvPlayer) {
|
||||||
return mpvPlayer.seekTo(0);
|
return mpvPlayer.seekTo(0);
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue