aboutsummaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
Diffstat (limited to 'components')
-rw-r--r--components/videoPlayer.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/components/videoPlayer.js b/components/videoPlayer.js
index 5d35874..b5f8412 100644
--- a/components/videoPlayer.js
+++ b/components/videoPlayer.js
@@ -83,16 +83,18 @@ export default function VideoPlayer({
}
});
- art.on("destroy", () => {
+ art.on("video:timeupdate", () => {
const currentTime = art.currentTime;
const duration = art.duration;
const percentage = currentTime / duration;
+ // console.log(percentage);
+
if (percentage >= 0.9) {
// use >= instead of >
markProgress(aniId, progress, stats);
- } else {
- return;
+ art.off("video:timeupdate");
+ console.log("Video progress marked");
}
});