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 committed Sep 30, 2024
1 parent eb35eb3 commit 230a62a
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions Modules/MediaCast/Video/js/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 230a62a

Please sign in to comment.