Skip to content

Commit

Permalink
fix: prevent addition with negative duration
Browse files Browse the repository at this point in the history
  • Loading branch information
KaustubhKumar05 committed Mar 13, 2024
1 parent 03bc7df commit d29e035
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/hms-video-store/src/common/PluginUsageTracker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class PluginUsageTracker {
this.pluginLastAddedAt.set(pluginKey, addedAt);
} else if (event.name === 'mediaPlugin.stats') {
const duration = event.properties.duration;
if (duration) {
if (duration > 0) {
this.pluginUsage.set(pluginKey, (this.pluginUsage.get(pluginKey) || 0) + duration * 1000);
this.pluginLastAddedAt.delete(pluginKey);
}
Expand Down

0 comments on commit d29e035

Please sign in to comment.