Skip to content

Commit

Permalink
fix(SUP-42252): Actual view time for clips is not correct (#173)
Browse files Browse the repository at this point in the history
Issue:
When playing only part of video by using the seekFrom the duration and currentTime is calculated according to the new times. so the position value (sent to analytics) is calculated from start time =0 (even that this is not 0 in the fully video).

Solution:
If seekFrom is defined, calculate the currentTime with the seekFrom value.

Solves SUP-42252
  • Loading branch information
Tzipi-kaltura authored May 27, 2024
1 parent 005ac73 commit 0007fad
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/kava.ts
Original file line number Diff line number Diff line change
Expand Up @@ -884,7 +884,11 @@ class Kava extends BasePlugin {
}
return 0;
}
return this._isFirstPlaying ? this.player.currentTime! || this.player.sources.startTime || 0 : this.player.currentTime!;
let currentTime = this.player.currentTime;
if (typeof this.player.sources.seekFrom === 'number' && currentTime) {
currentTime += this.player.sources.seekFrom;
}
return this._isFirstPlaying ? currentTime! || this.player.sources.startTime || 0 : currentTime!;
}

private _getDeliveryType(): string {
Expand Down

0 comments on commit 0007fad

Please sign in to comment.