Skip to content

Commit

Permalink
chore: remove infinite loop in handleSeek
Browse files Browse the repository at this point in the history
  • Loading branch information
ambar committed Jan 29, 2022
1 parent dff731b commit 014b3fa
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions packages/griffith/src/components/Player.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -341,14 +341,9 @@ const InnerPlayer: React.FC<InnerPlayerProps> = ({
}

const handleSeek = (value: number) => {
const isPlayEnded =
!isPlaybackStarted && !isNeverPlayed && currentTime !== 0 // 播放结束,显示「重新播放」状态
setCurrentTime(value)
// TODO 想办法去掉这个实例方法调用
videoRef.current?.seek(value)
if (isPlayEnded) {
handlePlay()
}
}

const handleLoadingChange = (value: boolean) => {
Expand Down

0 comments on commit 014b3fa

Please sign in to comment.