Skip to content

Commit bfb38a2

Browse files
committed
pro check added to syncInterval ajax call
1 parent 9097bd9 commit bfb38a2

File tree

1 file changed

+8
-4
lines changed
  • assets/src/js/frontend/learning-area/lesson

1 file changed

+8
-4
lines changed

assets/src/js/frontend/learning-area/lesson/player.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -305,9 +305,11 @@ class LessonPlayer {
305305
* Send to tutor backend about video playing time in this interval
306306
*/
307307
const intervalSeconds = 10;
308-
this.syncInterval = setInterval(() => {
309-
this.syncTime();
310-
}, intervalSeconds * 1000);
308+
if (tutorConfig.tutor_pro_url) {
309+
this.syncInterval = setInterval(() => {
310+
this.syncTime();
311+
}, intervalSeconds * 1000);
312+
}
311313

312314
/**
313315
* Unmute automatically after first user interaction
@@ -340,7 +342,9 @@ class LessonPlayer {
340342
this.player.on('pause', () => {
341343
if (this.syncInterval) clearInterval(this.syncInterval);
342344

343-
this.syncTime();
345+
if (tutorConfig.tutor_pro_url) {
346+
this.syncTime();
347+
}
344348
});
345349

346350
this.player.on('ended', (event: Plyr.PlyrEvent) => {

0 commit comments

Comments
 (0)