Skip to content

Commit

Permalink
VID-727: Use interval counter
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Thies committed Mar 5, 2024
1 parent 3815807 commit 48af1f8
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion amd/build/videotime.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion amd/build/videotime.min.js.map

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion amd/src/videotime.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ define([
this.played = false;

this.playing = false;
this.intervalcount = 0;
this.time = 0;
this.percent = 0;
this.currentTime = 0;
Expand Down Expand Up @@ -336,9 +337,10 @@ define([
return;
}
this.time += this.playbackRate;
this.intervalcount += 1;

this.getSession().then(function(session) {
if (this.time / this.playbackRate % this.interval === 0) {
if (this.intervalcount % this.interval === 0) {
Log.debug('VIDEO_TIME watch_time: ' + this.time + '. percent: ' + this.percent);
this.recordWatchTime(session.id, this.time);
this.setPercent(session.id, this.percent);
Expand Down
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@

$plugin->component = 'mod_videotime';
$plugin->release = '1.5.7';
$plugin->version = 2022091406;
$plugin->version = 2022091407;
$plugin->requires = 2015111610;
$plugin->maturity = MATURITY_STABLE;

0 comments on commit 48af1f8

Please sign in to comment.