Skip to content

Commit

Permalink
Round time
Browse files Browse the repository at this point in the history
  • Loading branch information
davidvanleeuwen committed Mar 19, 2024
1 parent 9a645f8 commit 979beef
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions client/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ export class Metrics {
{
...params,
name: 'play',
from: this.#video?.currentTime,
from: this.#currentTime(),
},
this.timeout
);
Expand All @@ -249,7 +249,7 @@ export class Metrics {
'event',
{
...params,
to: this.#video?.currentTime,
to: this.#currentTime(),
},
this.timeout
);
Expand Down Expand Up @@ -278,4 +278,8 @@ export class Metrics {

}
}

#currentTime() {
return this.#video?.currentTime.toFixed(2);
}
}

0 comments on commit 979beef

Please sign in to comment.