Skip to content

Commit

Permalink
reduce number of completion calls
Browse files Browse the repository at this point in the history
  • Loading branch information
alex40724 authored and oliversamoila committed Sep 30, 2024
1 parent e4dadf5 commit cdad7f3
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions components/ILIAS/MediaCast/resources/video_widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -338,11 +338,14 @@ il.VideoPlaylist = il.VideoPlaylist || {};
perc = 100 / duration * current_time;
if (t.playlist[list_wrapper].completed_cb !== '') {
if (perc > t.playlist[list_wrapper].percentage) {
t.playlist[list_wrapper].items[i].completed = true;
$.ajax({
type: 'GET',
url: `${t.playlist[list_wrapper].completed_cb}&mob_id=${v.id}`,
});
if (!t.playlist[list_wrapper].items[i].completed) {
t.playlist[list_wrapper].items[i].completed = true;
console.log('sending completed cb');
$.ajax({
type: 'GET',
url: `${t.playlist[list_wrapper].completed_cb}&mob_id=${v.id}`,
});
}
}
}
}
Expand Down

0 comments on commit cdad7f3

Please sign in to comment.