Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(SUP-42252): Actual view time for clips is not correct #173

Merged
merged 4 commits into from
May 27, 2024

Conversation

Tzipi-kaltura
Copy link
Contributor

@Tzipi-kaltura Tzipi-kaltura commented May 26, 2024

Description of the Changes

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

CheckLists

  • changes have been done against master branch, and PR does not conflict
  • new unit / functional tests have been added (whenever applicable)
  • test are passing in local environment
  • Travis tests are passing (or test results are not worse than on master branch :))
  • Docs have been updated

src/kava.ts Outdated Show resolved Hide resolved
src/kava.ts Outdated
}
return 0;
}
return this._isFirstPlaying ? this.player.currentTime! || this.player.sources.startTime || 0 : this.player.currentTime!;
if (this.player.sources.seekFrom && currentTime) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well, i dont like the structure of the function, but i dont want to refactor the whole thing now.

i think this would be more readable

let currentTime = this.player.currentTime;
if (typeof this.player.sources.seekFrom === "number" && currentTime) {
  currentTime += this.player.sources.seekFrom;
}

and in the use of currentTime in the lines above, keep the existing syntax of this.player.currentTime.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@Tzipi-kaltura Tzipi-kaltura merged commit 0007fad into master May 27, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants