Skip to content

Commit

Permalink
feat(player): add save to watchhistory on pause
Browse files Browse the repository at this point in the history
  • Loading branch information
RCVZ committed Aug 4, 2021
1 parent 810d104 commit 403671a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/containers/Cinema/Cinema.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,10 @@ const Cinema: React.FC<Props> = ({ item, onPlay, onPause, onComplete, onUserActi
setPlayer(playerRef.current);

const handlePlay = () => onPlay && onPlay();
const handlePause = () => onPause && onPause();
const handlePause = () => {
enableWatchHistory && saveItem(item, getProgress);
onPause && onPause();
};
const handleComplete = () => onComplete && onComplete();
const handleUserActive = () => onUserActive && onUserActive();
const handleUserInactive = () => onUserInActive && onUserInActive();
Expand Down

0 comments on commit 403671a

Please sign in to comment.